summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile14
-rw-r--r--config.mk4
2 files changed, 14 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index cf84102..ad673b4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,14 @@
-CC=c89
-CFLAGS=-Wall -Wextra -Wpedantic
+.POSIX:
-testlibc: main.o test.o assert.o ctype.o locale.o
- $(CC) -o $@ *.o
+include config.mk
+
+CFLAGS=-I$(INCLUDEDIR) -nostdinc -fno-builtin
+LDFLAGS=-L$(LIBDIR) $(LIBS)
+
+TESTOBJS=main.o test.o assert.o ctype.o locale.o
+
+testlibc: $(TESTOBJS)
+ $(CC) -o $@ $(TESTOBJS) $(LDFLAGS)
assert.o: assert.c test.h
diff --git a/config.mk b/config.mk
new file mode 100644
index 0000000..e55161a
--- /dev/null
+++ b/config.mk
@@ -0,0 +1,4 @@
+CC=c99
+INCLUDEDIR=../include
+LIBDIR=../
+LIBS=-lc -lm