Makefile

changeset 14
ee9333c91dda
parent 13
51b1ba3776b1
child 16
bc9a0fefd892
--- a/Makefile	Fri Sep 16 09:59:20 2011 +0200
+++ b/Makefile	Fri Sep 16 10:36:45 2011 +0200
@@ -1,10 +1,19 @@
 CC = gcc
 BUILDDIR = build/
 OBJ = $(shell ls | grep \.c | sed 's/^\([^.]*\)\.c/${BUILDDIR:/=\/}\1.o/g' | tr '\n' ' ')
-BIN = ${BUILDDIR}/cline
+BIN = ${BUILDDIR}cline
+
+all: addrnum ${OBJ} remrnum
+	${CC} -o ${BIN} ${OBJ}
 
-all: ${OBJ}
-	${CC} -o ${BIN} ${OBJ}
+addrnum:
+	rm build/cline.o
+	mv cline.h cline.src
+	cat cline.src | sed "s/VERSION.*/VERSION=\"$(shell hg identify -i)\";/g" > cline.h
+	
+remrnum:
+	rm cline.h
+	mv cline.src cline.h
 
 ${BUILDDIR}%.o: %.c
 	mkdir -p ${BUILDDIR}

mercurial