Makefile

Thu, 01 Dec 2011 17:04:30 +0100

author
Mike Becker <universe@uap-core.de>
date
Thu, 01 Dec 2011 17:04:30 +0100
changeset 25
802c5382f499
parent 23
778388400f7b
child 28
72a98cbcb9f1
permissions
-rw-r--r--

Added line buffer (and warning message - there is no regexp parser, though)

     1 CC = gcc
     2 CARG = -Wall -std=gnu99 -O
     3 BUILDDIR = build/
     4 OBJ = $(shell ls | grep '\.c' | sed 's/^\([^.]*\)\.c$$/${BUILDDIR:/=\/}\1.o/g' | tr '\n' ' ')
     5 BIN = ${BUILDDIR}cline
     7 .PHONY: setup run-compile teardown
     9 all: setup run-compile teardown
    12 run-compile:
    13 	-${MAKE} compile
    15 compile: ${OBJ}
    16 	${CC} -o ${BIN} ${OBJ}
    18 setup:
    19 	mkdir -p ${BUILDDIR}
    20 	rm -f build/cline.o
    21 	mv cline.h cline.src
    22 	cat cline.src | sed "s/VERSION.*/VERSION=\"$(shell hg identify -n) ($(shell hg identify -i))\";/g" > cline.h
    24 teardown:
    25 	rm -f cline.h
    26 	mv cline.src cline.h
    28 ${BUILDDIR}%.o: %.c
    29 	${CC} ${CARG} -c -o ${BUILDDIR}$*.o $<
    31 clean:
    32 	rm -f build/*

mercurial