garten

annotate Makefile @ 10:13c6828bd4a5

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