Mon, 19 Sep 2011 08:11:08 +0200
added license
0 | 1 | CC = gcc |
13
51b1ba3776b1
changed makefile to auto-include any source file
Mike Becker <universe@uap-core.de>
parents:
10
diff
changeset
|
2 | BUILDDIR = build/ |
51b1ba3776b1
changed makefile to auto-include any source file
Mike Becker <universe@uap-core.de>
parents:
10
diff
changeset
|
3 | 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
|
4 | BIN = ${BUILDDIR}cline |
ee9333c91dda
some minor fixes + makefile now injects revisionnumber into cline.h
Mike Becker <universe@uap-core.de>
parents:
13
diff
changeset
|
5 | |
ee9333c91dda
some minor fixes + makefile now injects revisionnumber into cline.h
Mike Becker <universe@uap-core.de>
parents:
13
diff
changeset
|
6 | all: addrnum ${OBJ} remrnum |
ee9333c91dda
some minor fixes + makefile now injects revisionnumber into cline.h
Mike Becker <universe@uap-core.de>
parents:
13
diff
changeset
|
7 | ${CC} -o ${BIN} ${OBJ} |
0 | 8 | |
14
ee9333c91dda
some minor fixes + makefile now injects revisionnumber into cline.h
Mike Becker <universe@uap-core.de>
parents:
13
diff
changeset
|
9 | addrnum: |
ee9333c91dda
some minor fixes + makefile now injects revisionnumber into cline.h
Mike Becker <universe@uap-core.de>
parents:
13
diff
changeset
|
10 | rm build/cline.o |
ee9333c91dda
some minor fixes + makefile now injects revisionnumber into cline.h
Mike Becker <universe@uap-core.de>
parents:
13
diff
changeset
|
11 | mv cline.h cline.src |
ee9333c91dda
some minor fixes + makefile now injects revisionnumber into cline.h
Mike Becker <universe@uap-core.de>
parents:
13
diff
changeset
|
12 | cat cline.src | sed "s/VERSION.*/VERSION=\"$(shell hg identify -i)\";/g" > cline.h |
ee9333c91dda
some minor fixes + makefile now injects revisionnumber into cline.h
Mike Becker <universe@uap-core.de>
parents:
13
diff
changeset
|
13 | |
ee9333c91dda
some minor fixes + makefile now injects revisionnumber into cline.h
Mike Becker <universe@uap-core.de>
parents:
13
diff
changeset
|
14 | remrnum: |
ee9333c91dda
some minor fixes + makefile now injects revisionnumber into cline.h
Mike Becker <universe@uap-core.de>
parents:
13
diff
changeset
|
15 | rm cline.h |
ee9333c91dda
some minor fixes + makefile now injects revisionnumber into cline.h
Mike Becker <universe@uap-core.de>
parents:
13
diff
changeset
|
16 | mv cline.src cline.h |
1 | 17 | |
13
51b1ba3776b1
changed makefile to auto-include any source file
Mike Becker <universe@uap-core.de>
parents:
10
diff
changeset
|
18 | ${BUILDDIR}%.o: %.c |
10 | 19 | mkdir -p ${BUILDDIR} |
13
51b1ba3776b1
changed makefile to auto-include any source file
Mike Becker <universe@uap-core.de>
parents:
10
diff
changeset
|
20 | ${CC} -c -std=c99 -o ${BUILDDIR}$*.o $< |
3
510d6b198dde
Moved some functions to functions.c
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
21 | |
510d6b198dde
Moved some functions to functions.c
Mike Becker <universe@uap-core.de>
parents:
1
diff
changeset
|
22 | clean: |
10 | 23 | rm build/* |