garten
view Makefile @ 12:8db6497d6065
merged everything to only one program
author | meillo@marmaro.de |
---|---|
date | Wed, 23 Jul 2008 15:19:45 +0200 |
parents | 13c6828bd4a5 |
children | bbc214c6fa6f |
line source
1 # garten by meillo@marmaro.de
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}
9 #DOCS=LICENSE README ChangeLog TODO examples
11 # paths
12 #PREFIX = /usr
13 #BINDIR = ${PREFIX}/bin
14 #MANDIR = ${PREFIX}/share/man
16 # compile env
17 CC = gcc
18 LD = ${CC}
19 DEBUG = -g
20 CFLAGS = -Wall -c ${DEBUG}
21 LDFLAGS = -Wall ${DEBUG} -lsqlite3
23 # files
24 DEP = db.h game.h
25 SRC = main.c clock.c environment.c weather.c growth.c db.c
26 OBJ = $(SRC:.c=.o)
29 .PHONY: all
30 all: options build
32 .PHONY: options
33 options:
34 @echo build options:
35 @echo "CC = ${CC}"
36 @echo "LD = ${LD}"
37 @echo "CFLAGS = ${CFLAGS}"
38 @echo "LDFLAGS = ${LDFLAGS}"
39 @echo
42 .PHONY: build
43 build: options ${NAME}
46 $(OBJ): $(SRC) $(DEP)
48 ${NAME}: $(DEP) $(OBJ)
49 gcc -o $(NAME) $(LDFLAGS) $(OBJ)
52 .PHONY: car
53 car: clean all
56 .PHONY: strip
57 strip: ${NAME}
58 @echo stripping
59 @strip *
62 .PHONY: changelog
63 changelog:
64 @echo generating changelog from mercurial log
65 @hg log -v --style changelog > ChangeLog
68 .PHONY: clean
69 clean:
70 rm -f *.o
71 rm -f *
74 #dist: build changelog
75 #@echo "generating tarball"
76 #@mkdir -p ${NV}
77 #@cp -rf ${SRC} ${DEP} ${NAME}.1 Makefile ${DOCS} ${NV}
78 #@fakeroot tar -czhof ${NV}.tar.gz ${NV}
79 #@rm -rf ${NV}