Thu, 20 Oct 2011 15:21:53 +0200
implemented bfile heuristics option + TODO: implement algorithm
universe@0 | 1 | CC = gcc |
universe@18 | 2 | CARG = -Wall -std=gnu99 |
universe@13 | 3 | BUILDDIR = build/ |
universe@16 | 4 | OBJ = $(shell ls | grep '\.c' | sed 's/^\([^.]*\)\.c$$/${BUILDDIR:/=\/}\1.o/g' | tr '\n' ' ') |
universe@14 | 5 | BIN = ${BUILDDIR}cline |
universe@0 | 6 | |
universe@16 | 7 | .PHONY: setup run-compile teardown |
universe@16 | 8 | |
universe@16 | 9 | all: setup run-compile teardown |
universe@16 | 10 | |
universe@16 | 11 | |
universe@16 | 12 | run-compile: |
universe@16 | 13 | -${MAKE} compile |
universe@16 | 14 | |
universe@16 | 15 | compile: ${OBJ} |
universe@10 | 16 | ${CC} -o ${BIN} ${OBJ} |
universe@1 | 17 | |
universe@16 | 18 | setup: |
universe@16 | 19 | mkdir -p ${BUILDDIR} |
universe@16 | 20 | rm -f build/cline.o |
universe@14 | 21 | mv cline.h cline.src |
universe@16 | 22 | cat cline.src | sed "s/VERSION.*/VERSION=\"$(shell hg identify -n) ($(shell hg identify -i))\";/g" > cline.h |
universe@14 | 23 | |
universe@16 | 24 | teardown: |
universe@16 | 25 | rm -f cline.h |
universe@14 | 26 | mv cline.src cline.h |
universe@14 | 27 | |
universe@13 | 28 | ${BUILDDIR}%.o: %.c |
universe@18 | 29 | ${CC} ${CARG} -c -o ${BUILDDIR}$*.o $< |
universe@3 | 30 | |
universe@3 | 31 | clean: |
universe@16 | 32 | rm -f build/* |
universe@16 | 33 |