universe@0: CC = gcc universe@13: BUILDDIR = build/ universe@16: OBJ = $(shell ls | grep '\.c' | sed 's/^\([^.]*\)\.c$$/${BUILDDIR:/=\/}\1.o/g' | tr '\n' ' ') universe@14: BIN = ${BUILDDIR}cline universe@0: universe@16: .PHONY: setup run-compile teardown universe@16: universe@16: all: setup run-compile teardown universe@16: universe@16: universe@16: run-compile: universe@16: -${MAKE} compile universe@16: universe@16: compile: ${OBJ} universe@10: ${CC} -o ${BIN} ${OBJ} universe@1: universe@16: setup: universe@16: mkdir -p ${BUILDDIR} universe@16: rm -f build/cline.o universe@14: mv cline.h cline.src universe@16: cat cline.src | sed "s/VERSION.*/VERSION=\"$(shell hg identify -n) ($(shell hg identify -i))\";/g" > cline.h universe@14: universe@16: teardown: universe@16: rm -f cline.h universe@14: mv cline.src cline.h universe@14: universe@13: ${BUILDDIR}%.o: %.c universe@13: ${CC} -c -std=c99 -o ${BUILDDIR}$*.o $< universe@3: universe@3: clean: universe@16: rm -f build/* universe@16: