Fri, 16 Sep 2011 10:36:45 +0200
some minor fixes + makefile now injects revisionnumber into cline.h
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@14 | 4 | BIN = ${BUILDDIR}cline |
universe@0 | 5 | |
universe@14 | 6 | all: addrnum ${OBJ} remrnum |
universe@10 | 7 | ${CC} -o ${BIN} ${OBJ} |
universe@1 | 8 | |
universe@14 | 9 | addrnum: |
universe@14 | 10 | rm build/cline.o |
universe@14 | 11 | mv cline.h cline.src |
universe@14 | 12 | cat cline.src | sed "s/VERSION.*/VERSION=\"$(shell hg identify -i)\";/g" > cline.h |
universe@14 | 13 | |
universe@14 | 14 | remrnum: |
universe@14 | 15 | rm cline.h |
universe@14 | 16 | mv cline.src cline.h |
universe@14 | 17 | |
universe@13 | 18 | ${BUILDDIR}%.o: %.c |
universe@10 | 19 | mkdir -p ${BUILDDIR} |
universe@13 | 20 | ${CC} -c -std=c99 -o ${BUILDDIR}$*.o $< |
universe@3 | 21 | |
universe@3 | 22 | clean: |
universe@10 | 23 | rm build/* |