Makefile

changeset 10
ecf787666f44
parent 3
510d6b198dde
child 13
51b1ba3776b1
--- a/Makefile	Mon May 30 08:45:08 2011 +0200
+++ b/Makefile	Thu Sep 15 13:29:06 2011 +0200
@@ -1,11 +1,14 @@
 CC = gcc
-OBJ = cline.o functions.o
+BUILDDIR = build
+OBJ = ${BUILDDIR}/cline.o ${BUILDDIR}/scanner.o ${BUILDDIR}/settings.o ${BUILDDIR}/suffix_fnc.o ${BUILDDIR}/suffix_list.o ${BUILDDIR}/arguments.o
+BIN = ${BUILDDIR}/cline
 
-cline: ${OBJ}
-	${CC} -o cline ${OBJ}
+all: ${OBJ}
+	${CC} -o ${BIN} ${OBJ}
 
-%.o: %.c
-	${CC} -c -std=c99 $<
+${BUILDDIR}/%.o: %.c
+	mkdir -p ${BUILDDIR}
+	${CC} -c -std=c99 -o ${BUILDDIR}/$*.o $<
 
 clean:
-	rm *.o
+	rm build/*

mercurial