Mercurial > garten
annotate Makefile @ 20:17b2bcc42d72 default tip
added check for empty result; minor stuff
author | meillo@marmaro.de |
---|---|
date | Sun, 27 Jul 2008 21:34:54 +0200 |
parents | 5937504619f2 |
children |
rev | line source |
---|---|
5 | 1 # garten by meillo@marmaro.de |
2 | |
3 | |
4 NAME=garten | |
5 # extracts VERSION from the sources | |
6 #VERSION=$(shell cat *.c | sed -n '/define VERSION/ s/.*"\([^"]*\)".*/\1/p' ) | |
7 #NV=${NAME}-${VERSION} | |
8 | |
9 #DOCS=LICENSE README ChangeLog TODO examples | |
10 | |
11 # paths | |
12 #PREFIX = /usr | |
13 #BINDIR = ${PREFIX}/bin | |
14 #MANDIR = ${PREFIX}/share/man | |
15 | |
16 # compile env | |
17 CC = gcc | |
18 LD = ${CC} | |
19 DEBUG = -g | |
20 CFLAGS = -Wall -c ${DEBUG} | |
10
13c6828bd4a5
switched from mysql to sqlite; (+ some cleanups)
meillo@marmaro.de
parents:
7
diff
changeset
|
21 LDFLAGS = -Wall ${DEBUG} -lsqlite3 |
5 | 22 |
23 # files | |
18
5937504619f2
rename game.h -> modules.h; added some error handling; and more
meillo@marmaro.de
parents:
14
diff
changeset
|
24 DEP = db.h |
12 | 25 SRC = main.c clock.c environment.c weather.c growth.c db.c |
26 OBJ = $(SRC:.c=.o) | |
5 | 27 |
28 | |
10
13c6828bd4a5
switched from mysql to sqlite; (+ some cleanups)
meillo@marmaro.de
parents:
7
diff
changeset
|
29 .PHONY: all |
5 | 30 all: options build |
31 | |
10
13c6828bd4a5
switched from mysql to sqlite; (+ some cleanups)
meillo@marmaro.de
parents:
7
diff
changeset
|
32 .PHONY: options |
5 | 33 options: |
34 @echo build options: | |
35 @echo "CC = ${CC}" | |
36 @echo "LD = ${LD}" | |
37 @echo "CFLAGS = ${CFLAGS}" | |
38 @echo "LDFLAGS = ${LDFLAGS}" | |
39 @echo | |
40 | |
41 | |
10
13c6828bd4a5
switched from mysql to sqlite; (+ some cleanups)
meillo@marmaro.de
parents:
7
diff
changeset
|
42 .PHONY: build |
5 | 43 build: options ${NAME} |
44 | |
45 | |
12 | 46 $(OBJ): $(SRC) $(DEP) |
5 | 47 |
18
5937504619f2
rename game.h -> modules.h; added some error handling; and more
meillo@marmaro.de
parents:
14
diff
changeset
|
48 main.o: main.c $(DEP) modules.h |
5937504619f2
rename game.h -> modules.h; added some error handling; and more
meillo@marmaro.de
parents:
14
diff
changeset
|
49 |
12 | 50 ${NAME}: $(DEP) $(OBJ) |
51 gcc -o $(NAME) $(LDFLAGS) $(OBJ) | |
5 | 52 |
53 | |
10
13c6828bd4a5
switched from mysql to sqlite; (+ some cleanups)
meillo@marmaro.de
parents:
7
diff
changeset
|
54 .PHONY: car |
5 | 55 car: clean all |
56 | |
57 | |
10
13c6828bd4a5
switched from mysql to sqlite; (+ some cleanups)
meillo@marmaro.de
parents:
7
diff
changeset
|
58 .PHONY: strip |
5 | 59 strip: ${NAME} |
60 @echo stripping | |
14
bbc214c6fa6f
fixed the result of an unchecked rename ...
meillo@marmaro.de
parents:
12
diff
changeset
|
61 @strip $(NAME) |
5 | 62 |
63 | |
10
13c6828bd4a5
switched from mysql to sqlite; (+ some cleanups)
meillo@marmaro.de
parents:
7
diff
changeset
|
64 .PHONY: changelog |
13c6828bd4a5
switched from mysql to sqlite; (+ some cleanups)
meillo@marmaro.de
parents:
7
diff
changeset
|
65 changelog: |
13c6828bd4a5
switched from mysql to sqlite; (+ some cleanups)
meillo@marmaro.de
parents:
7
diff
changeset
|
66 @echo generating changelog from mercurial log |
13c6828bd4a5
switched from mysql to sqlite; (+ some cleanups)
meillo@marmaro.de
parents:
7
diff
changeset
|
67 @hg log -v --style changelog > ChangeLog |
13c6828bd4a5
switched from mysql to sqlite; (+ some cleanups)
meillo@marmaro.de
parents:
7
diff
changeset
|
68 |
13c6828bd4a5
switched from mysql to sqlite; (+ some cleanups)
meillo@marmaro.de
parents:
7
diff
changeset
|
69 |
13c6828bd4a5
switched from mysql to sqlite; (+ some cleanups)
meillo@marmaro.de
parents:
7
diff
changeset
|
70 .PHONY: clean |
13c6828bd4a5
switched from mysql to sqlite; (+ some cleanups)
meillo@marmaro.de
parents:
7
diff
changeset
|
71 clean: |
13c6828bd4a5
switched from mysql to sqlite; (+ some cleanups)
meillo@marmaro.de
parents:
7
diff
changeset
|
72 rm -f *.o |
14
bbc214c6fa6f
fixed the result of an unchecked rename ...
meillo@marmaro.de
parents:
12
diff
changeset
|
73 rm -f $(NAME) |
10
13c6828bd4a5
switched from mysql to sqlite; (+ some cleanups)
meillo@marmaro.de
parents:
7
diff
changeset
|
74 |
13c6828bd4a5
switched from mysql to sqlite; (+ some cleanups)
meillo@marmaro.de
parents:
7
diff
changeset
|
75 |
5 | 76 #dist: build changelog |
77 #@echo "generating tarball" | |
78 #@mkdir -p ${NV} | |
79 #@cp -rf ${SRC} ${DEP} ${NAME}.1 Makefile ${DOCS} ${NV} | |
80 #@fakeroot tar -czhof ${NV}.tar.gz ${NV} | |
81 #@rm -rf ${NV} |