garten
annotate Makefile @ 5:26ca6c79fc22
added a Makefile (which needs improvement)
author | meillo@marmaro.de |
---|---|
date | Wed, 14 May 2008 21:10:45 +0200 |
parents | |
children | e3679f888813 |
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@5 | 49 |
meillo@5 | 50 ${NAME}: bin/clock bin/weather |
meillo@5 | 51 |
meillo@5 | 52 |
meillo@5 | 53 #${OBJ}: ${DEP} |
meillo@5 | 54 |
meillo@5 | 55 |
meillo@5 | 56 car: clean all |
meillo@5 | 57 |
meillo@5 | 58 |
meillo@5 | 59 #debug: all |
meillo@5 | 60 #gdb ${NAME} |
meillo@5 | 61 |
meillo@5 | 62 |
meillo@5 | 63 strip: ${NAME} |
meillo@5 | 64 @echo stripping |
meillo@5 | 65 @strip bin/* |
meillo@5 | 66 |
meillo@5 | 67 |
meillo@5 | 68 #dist: build changelog |
meillo@5 | 69 #@echo "generating tarball" |
meillo@5 | 70 #@mkdir -p ${NV} |
meillo@5 | 71 #@cp -rf ${SRC} ${DEP} ${NAME}.1 Makefile ${DOCS} ${NV} |
meillo@5 | 72 #@fakeroot tar -czhof ${NV}.tar.gz ${NV} |
meillo@5 | 73 #@rm -rf ${NV} |
meillo@5 | 74 |
meillo@5 | 75 |
meillo@5 | 76 changelog: |
meillo@5 | 77 @echo generating changelog from mercurial log |
meillo@5 | 78 @hg log -v --style changelog > ChangeLog |
meillo@5 | 79 |
meillo@5 | 80 |
meillo@5 | 81 clean: |
meillo@5 | 82 rm -f *.o |
meillo@5 | 83 |
meillo@5 | 84 |
meillo@5 | 85 realclean: clean |
meillo@5 | 86 rm -f bin/* |
meillo@5 | 87 |
meillo@5 | 88 |
meillo@5 | 89 .PHONY: all dist deb changelog clean distclean debclean build install uninstall |