Makefile

Thu, 20 Oct 2011 14:13:56 +0200

author
Mike Becker <universe@uap-core.de>
date
Thu, 20 Oct 2011 14:13:56 +0200
changeset 20
43725438ac50
parent 18
cae1294702aa
child 23
778388400f7b
permissions
-rw-r--r--

Changed author comments + added signatures for upcomming bfile heuristics

CC = gcc
CARG = -Wall -std=gnu99
BUILDDIR = build/
OBJ = $(shell ls | grep '\.c' | sed 's/^\([^.]*\)\.c$$/${BUILDDIR:/=\/}\1.o/g' | tr '\n' ' ')
BIN = ${BUILDDIR}cline

.PHONY: setup run-compile teardown

all: setup run-compile teardown
	
	
run-compile:
	-${MAKE} compile

compile: ${OBJ}
	${CC} -o ${BIN} ${OBJ}

setup:
	mkdir -p ${BUILDDIR}
	rm -f build/cline.o
	mv cline.h cline.src
	cat cline.src | sed "s/VERSION.*/VERSION=\"$(shell hg identify -n) ($(shell hg identify -i))\";/g" > cline.h
	
teardown:
	rm -f cline.h
	mv cline.src cline.h

${BUILDDIR}%.o: %.c
	${CC} ${CARG} -c -o ${BUILDDIR}$*.o $<

clean:
	rm -f build/*
	

mercurial