garten

annotate Makefile @ 9:ac67f688ed2e

switched from gamename to database for identifing we have one db per game now
author meillo@marmaro.de
date Wed, 23 Jul 2008 11:39:15 +0200
parents e3679f888813
children 13c6828bd4a5
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@5 21 LDFLAGS = -Wall ${DEBUG}
meillo@5 22
meillo@5 23 # files
meillo@5 24 #SRC=baum.c actions.c
meillo@5 25 #OBJ=$(SRC:.c=.o)
meillo@5 26 #DEP = baum.h
meillo@5 27
meillo@5 28
meillo@5 29
meillo@5 30 all: options build
meillo@5 31
meillo@5 32 options:
meillo@5 33 @echo build options:
meillo@5 34 @echo "CC = ${CC}"
meillo@5 35 @echo "LD = ${LD}"
meillo@5 36 @echo "CFLAGS = ${CFLAGS}"
meillo@5 37 @echo "LDFLAGS = ${LDFLAGS}"
meillo@5 38 @echo
meillo@5 39
meillo@5 40
meillo@5 41 build: options ${NAME}
meillo@5 42
meillo@5 43 bin/clock: clock.c db.h game.h
meillo@5 44 $(CC) -o $@ $(LDFLAGS) `mysql_config --cflags` clock.c `mysql_config --libs`
meillo@5 45
meillo@5 46 bin/weather: weather.c db.h game.h
meillo@5 47 $(CC) -o $@ $(LDFLAGS) `mysql_config --cflags` weather.c `mysql_config --libs`
meillo@5 48
meillo@6 49 bin/environment: environment.c db.h game.h
meillo@6 50 $(CC) -o $@ $(LDFLAGS) `mysql_config --cflags` environment.c `mysql_config --libs`
meillo@5 51
meillo@7 52 bin/growth: growth.c db.h game.h
meillo@7 53 $(CC) -o $@ $(LDFLAGS) `mysql_config --cflags` growth.c `mysql_config --libs`
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@5 59 #${OBJ}: ${DEP}
meillo@5 60
meillo@5 61
meillo@5 62 car: clean all
meillo@5 63
meillo@5 64
meillo@5 65 #debug: all
meillo@5 66 #gdb ${NAME}
meillo@5 67
meillo@5 68
meillo@5 69 strip: ${NAME}
meillo@5 70 @echo stripping
meillo@5 71 @strip bin/*
meillo@5 72
meillo@5 73
meillo@5 74 #dist: build changelog
meillo@5 75 #@echo "generating tarball"
meillo@5 76 #@mkdir -p ${NV}
meillo@5 77 #@cp -rf ${SRC} ${DEP} ${NAME}.1 Makefile ${DOCS} ${NV}
meillo@5 78 #@fakeroot tar -czhof ${NV}.tar.gz ${NV}
meillo@5 79 #@rm -rf ${NV}
meillo@5 80
meillo@5 81
meillo@5 82 changelog:
meillo@5 83 @echo generating changelog from mercurial log
meillo@5 84 @hg log -v --style changelog > ChangeLog
meillo@5 85
meillo@5 86
meillo@5 87 clean:
meillo@5 88 rm -f *.o
meillo@5 89
meillo@5 90
meillo@5 91 realclean: clean
meillo@5 92 rm -f bin/*
meillo@5 93
meillo@5 94
meillo@5 95 .PHONY: all dist deb changelog clean distclean debclean build install uninstall