Thu, 20 Oct 2011 17:29:23 +0200
completed binary file heuristics
0 | 1 | CC = gcc |
18
cae1294702aa
Increased warning level, fixed resulting warnings, changed std form c99 to gnu99
Mike Becker <universe@uap-core.de>
parents:
16
diff
changeset
|
2 | CARG = -Wall -std=gnu99 |
13
51b1ba3776b1
changed makefile to auto-include any source file
Mike Becker <universe@uap-core.de>
parents:
10
diff
changeset
|
3 | BUILDDIR = build/ |
16
bc9a0fefd892
fixed makefile to run safely on compile errors + added -V option to cline
Mike Becker <universe@uap-core.de>
parents:
14
diff
changeset
|
4 | OBJ = $(shell ls | grep '\.c' | sed 's/^\([^.]*\)\.c$$/${BUILDDIR:/=\/}\1.o/g' | tr '\n' ' ') |
14
ee9333c91dda
some minor fixes + makefile now injects revisionnumber into cline.h
Mike Becker <universe@uap-core.de>
parents:
13
diff
changeset
|
5 | BIN = ${BUILDDIR}cline |
ee9333c91dda
some minor fixes + makefile now injects revisionnumber into cline.h
Mike Becker <universe@uap-core.de>
parents:
13
diff
changeset
|
6 | |
16
bc9a0fefd892
fixed makefile to run safely on compile errors + added -V option to cline
Mike Becker <universe@uap-core.de>
parents:
14
diff
changeset
|
7 | .PHONY: setup run-compile teardown |
bc9a0fefd892
fixed makefile to run safely on compile errors + added -V option to cline
Mike Becker <universe@uap-core.de>
parents:
14
diff
changeset
|
8 | |
bc9a0fefd892
fixed makefile to run safely on compile errors + added -V option to cline
Mike Becker <universe@uap-core.de>
parents:
14
diff
changeset
|
9 | all: setup run-compile teardown |
bc9a0fefd892
fixed makefile to run safely on compile errors + added -V option to cline
Mike Becker <universe@uap-core.de>
parents:
14
diff
changeset
|
10 | |
bc9a0fefd892
fixed makefile to run safely on compile errors + added -V option to cline
Mike Becker <universe@uap-core.de>
parents:
14
diff
changeset
|
11 | |
bc9a0fefd892
fixed makefile to run safely on compile errors + added -V option to cline
Mike Becker <universe@uap-core.de>
parents:
14
diff
changeset
|
12 | run-compile: |
bc9a0fefd892
fixed makefile to run safely on compile errors + added -V option to cline
Mike Becker <universe@uap-core.de>
parents:
14
diff
changeset
|
13 | -${MAKE} compile |
bc9a0fefd892
fixed makefile to run safely on compile errors + added -V option to cline
Mike Becker <universe@uap-core.de>
parents:
14
diff
changeset
|
14 | |
bc9a0fefd892
fixed makefile to run safely on compile errors + added -V option to cline
Mike Becker <universe@uap-core.de>
parents:
14
diff
changeset
|
15 | compile: ${OBJ} |
14
ee9333c91dda
some minor fixes + makefile now injects revisionnumber into cline.h
Mike Becker <universe@uap-core.de>
parents:
13
diff
changeset
|
16 | ${CC} -o ${BIN} ${OBJ} |
0 | 17 | |
16
bc9a0fefd892
fixed makefile to run safely on compile errors + added -V option to cline
Mike Becker <universe@uap-core.de>
parents:
14
diff
changeset
|
18 | setup: |
bc9a0fefd892
fixed makefile to run safely on compile errors + added -V option to cline
Mike Becker <universe@uap-core.de>
parents:
14
diff
changeset
|
19 | mkdir -p ${BUILDDIR} |
bc9a0fefd892
fixed makefile to run safely on compile errors + added -V option to cline
Mike Becker <universe@uap-core.de>
parents:
14
diff
changeset
|
20 | rm -f build/cline.o |
14
ee9333c91dda
some minor fixes + makefile now injects revisionnumber into cline.h
Mike Becker <universe@uap-core.de>
parents:
13
diff
changeset
|
21 | mv cline.h cline.src |
16
bc9a0fefd892
fixed makefile to run safely on compile errors + added -V option to cline
Mike Becker <universe@uap-core.de>
parents:
14
diff
changeset
|
22 | cat cline.src | sed "s/VERSION.*/VERSION=\"$(shell hg identify -n) ($(shell hg identify -i))\";/g" > cline.h |
14
ee9333c91dda
some minor fixes + makefile now injects revisionnumber into cline.h
Mike Becker <universe@uap-core.de>
parents:
13
diff
changeset
|
23 | |
16
bc9a0fefd892
fixed makefile to run safely on compile errors + added -V option to cline
Mike Becker <universe@uap-core.de>
parents:
14
diff
changeset
|
24 | teardown: |
bc9a0fefd892
fixed makefile to run safely on compile errors + added -V option to cline
Mike Becker <universe@uap-core.de>
parents:
14
diff
changeset
|
25 | rm -f cline.h |
14
ee9333c91dda
some minor fixes + makefile now injects revisionnumber into cline.h
Mike Becker <universe@uap-core.de>
parents:
13
diff
changeset
|
26 | mv cline.src cline.h |
1 | 27 | |
13
51b1ba3776b1
changed makefile to auto-include any source file
Mike Becker <universe@uap-core.de>
parents:
10
diff
changeset
|
28 | ${BUILDDIR}%.o: %.c |
18
cae1294702aa
Increased warning level, fixed resulting warnings, changed std form c99 to gnu99
Mike Becker <universe@uap-core.de>
parents:
16
diff
changeset
|
29 | ${CC} ${CARG} -c -o ${BUILDDIR}$*.o $< |
3
510d6b198dde
Moved some functions to functions.c
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
30 | |
510d6b198dde
Moved some functions to functions.c
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
31 | clean: |
16
bc9a0fefd892
fixed makefile to run safely on compile errors + added -V option to cline
Mike Becker <universe@uap-core.de>
parents:
14
diff
changeset
|
32 | rm -f build/* |
bc9a0fefd892
fixed makefile to run safely on compile errors + added -V option to cline
Mike Becker <universe@uap-core.de>
parents:
14
diff
changeset
|
33 |