Makefile

changeset 18
cae1294702aa
parent 16
bc9a0fefd892
child 23
778388400f7b
equal deleted inserted replaced
17:5f43f733cc12 18:cae1294702aa
1 CC = gcc 1 CC = gcc
2 CARG = -Wall -std=gnu99
2 BUILDDIR = build/ 3 BUILDDIR = build/
3 OBJ = $(shell ls | grep '\.c' | sed 's/^\([^.]*\)\.c$$/${BUILDDIR:/=\/}\1.o/g' | tr '\n' ' ') 4 OBJ = $(shell ls | grep '\.c' | sed 's/^\([^.]*\)\.c$$/${BUILDDIR:/=\/}\1.o/g' | tr '\n' ' ')
4 BIN = ${BUILDDIR}cline 5 BIN = ${BUILDDIR}cline
5 6
6 .PHONY: setup run-compile teardown 7 .PHONY: setup run-compile teardown
23 teardown: 24 teardown:
24 rm -f cline.h 25 rm -f cline.h
25 mv cline.src cline.h 26 mv cline.src cline.h
26 27
27 ${BUILDDIR}%.o: %.c 28 ${BUILDDIR}%.o: %.c
28 ${CC} -c -std=c99 -o ${BUILDDIR}$*.o $< 29 ${CC} ${CARG} -c -o ${BUILDDIR}$*.o $<
29 30
30 clean: 31 clean:
31 rm -f build/* 32 rm -f build/*
32 33

mercurial