Fri, 16 Sep 2011 09:59:20 +0200
changed makefile to auto-include any source file
0 | 1 | CC = gcc |
13
51b1ba3776b1
changed makefile to auto-include any source file
Mike Becker <universe@uap-core.de>
parents:
10
diff
changeset
|
2 | BUILDDIR = build/ |
51b1ba3776b1
changed makefile to auto-include any source file
Mike Becker <universe@uap-core.de>
parents:
10
diff
changeset
|
3 | OBJ = $(shell ls | grep \.c | sed 's/^\([^.]*\)\.c/${BUILDDIR:/=\/}\1.o/g' | tr '\n' ' ') |
10 | 4 | BIN = ${BUILDDIR}/cline |
0 | 5 | |
10 | 6 | all: ${OBJ} |
7 | ${CC} -o ${BIN} ${OBJ} | |
1 | 8 | |
13
51b1ba3776b1
changed makefile to auto-include any source file
Mike Becker <universe@uap-core.de>
parents:
10
diff
changeset
|
9 | ${BUILDDIR}%.o: %.c |
10 | 10 | mkdir -p ${BUILDDIR} |
13
51b1ba3776b1
changed makefile to auto-include any source file
Mike Becker <universe@uap-core.de>
parents:
10
diff
changeset
|
11 | ${CC} -c -std=c99 -o ${BUILDDIR}$*.o $< |
3
510d6b198dde
Moved some functions to functions.c
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
12 | |
510d6b198dde
Moved some functions to functions.c
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
13 | clean: |
10 | 14 | rm build/* |