Makefile

changeset 14
ee9333c91dda
parent 13
51b1ba3776b1
child 16
bc9a0fefd892
     1.1 --- a/Makefile	Fri Sep 16 09:59:20 2011 +0200
     1.2 +++ b/Makefile	Fri Sep 16 10:36:45 2011 +0200
     1.3 @@ -1,11 +1,20 @@
     1.4  CC = gcc
     1.5  BUILDDIR = build/
     1.6  OBJ = $(shell ls | grep \.c | sed 's/^\([^.]*\)\.c/${BUILDDIR:/=\/}\1.o/g' | tr '\n' ' ')
     1.7 -BIN = ${BUILDDIR}/cline
     1.8 +BIN = ${BUILDDIR}cline
     1.9  
    1.10 -all: ${OBJ}
    1.11 +all: addrnum ${OBJ} remrnum
    1.12  	${CC} -o ${BIN} ${OBJ}
    1.13  
    1.14 +addrnum:
    1.15 +	rm build/cline.o
    1.16 +	mv cline.h cline.src
    1.17 +	cat cline.src | sed "s/VERSION.*/VERSION=\"$(shell hg identify -i)\";/g" > cline.h
    1.18 +	
    1.19 +remrnum:
    1.20 +	rm cline.h
    1.21 +	mv cline.src cline.h
    1.22 +
    1.23  ${BUILDDIR}%.o: %.c
    1.24  	mkdir -p ${BUILDDIR}
    1.25  	${CC} -c -std=c99 -o ${BUILDDIR}$*.o $<

mercurial