garten

view Makefile @ 20:17b2bcc42d72

added check for empty result; minor stuff
author meillo@marmaro.de
date Sun, 27 Jul 2008 21:34:54 +0200
parents bbc214c6fa6f
children
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
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 main.o: main.c $(DEP) modules.h
50 ${NAME}: $(DEP) $(OBJ)
51 gcc -o $(NAME) $(LDFLAGS) $(OBJ)
54 .PHONY: car
55 car: clean all
58 .PHONY: strip
59 strip: ${NAME}
60 @echo stripping
61 @strip $(NAME)
64 .PHONY: changelog
65 changelog:
66 @echo generating changelog from mercurial log
67 @hg log -v --style changelog > ChangeLog
70 .PHONY: clean
71 clean:
72 rm -f *.o
73 rm -f $(NAME)
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}