garten

annotate Makefile @ 14:bbc214c6fa6f

fixed the result of an unchecked rename ...
author meillo@marmaro.de
date Wed, 23 Jul 2008 16:39:06 +0200
parents 8db6497d6065
children 5937504619f2
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@12 25 SRC = main.c clock.c environment.c weather.c growth.c db.c
meillo@12 26 OBJ = $(SRC:.c=.o)
meillo@5 27
meillo@5 28
meillo@10 29 .PHONY: all
meillo@5 30 all: options build
meillo@5 31
meillo@10 32 .PHONY: options
meillo@5 33 options:
meillo@5 34 @echo build options:
meillo@5 35 @echo "CC = ${CC}"
meillo@5 36 @echo "LD = ${LD}"
meillo@5 37 @echo "CFLAGS = ${CFLAGS}"
meillo@5 38 @echo "LDFLAGS = ${LDFLAGS}"
meillo@5 39 @echo
meillo@5 40
meillo@5 41
meillo@10 42 .PHONY: build
meillo@5 43 build: options ${NAME}
meillo@5 44
meillo@5 45
meillo@12 46 $(OBJ): $(SRC) $(DEP)
meillo@5 47
meillo@12 48 ${NAME}: $(DEP) $(OBJ)
meillo@12 49 gcc -o $(NAME) $(LDFLAGS) $(OBJ)
meillo@5 50
meillo@5 51
meillo@10 52 .PHONY: car
meillo@5 53 car: clean all
meillo@5 54
meillo@5 55
meillo@10 56 .PHONY: strip
meillo@5 57 strip: ${NAME}
meillo@5 58 @echo stripping
meillo@14 59 @strip $(NAME)
meillo@5 60
meillo@5 61
meillo@10 62 .PHONY: changelog
meillo@10 63 changelog:
meillo@10 64 @echo generating changelog from mercurial log
meillo@10 65 @hg log -v --style changelog > ChangeLog
meillo@10 66
meillo@10 67
meillo@10 68 .PHONY: clean
meillo@10 69 clean:
meillo@10 70 rm -f *.o
meillo@14 71 rm -f $(NAME)
meillo@10 72
meillo@10 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}