Makefile

Mon, 19 Sep 2011 08:11:08 +0200

author
Mike Becker <universe@uap-core.de>
date
Mon, 19 Sep 2011 08:11:08 +0200
changeset 15
9a262e046ab8
parent 14
ee9333c91dda
child 16
bc9a0fefd892
permissions
-rw-r--r--

added license

     1 CC = gcc
     2 BUILDDIR = build/
     3 OBJ = $(shell ls | grep \.c | sed 's/^\([^.]*\)\.c/${BUILDDIR:/=\/}\1.o/g' | tr '\n' ' ')
     4 BIN = ${BUILDDIR}cline
     6 all: addrnum ${OBJ} remrnum
     7 	${CC} -o ${BIN} ${OBJ}
     9 addrnum:
    10 	rm build/cline.o
    11 	mv cline.h cline.src
    12 	cat cline.src | sed "s/VERSION.*/VERSION=\"$(shell hg identify -i)\";/g" > cline.h
    14 remrnum:
    15 	rm cline.h
    16 	mv cline.src cline.h
    18 ${BUILDDIR}%.o: %.c
    19 	mkdir -p ${BUILDDIR}
    20 	${CC} -c -std=c99 -o ${BUILDDIR}$*.o $<
    22 clean:
    23 	rm build/*

mercurial