garten

view Makefile @ 17:5e6c9260913a

lots of cleanups and small fixes
author meillo@marmaro.de
date Wed, 23 Jul 2008 17:14:38 +0200
parents 8db6497d6065
children 5937504619f2
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 $(NAME)
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 $(NAME)
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}