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