meillo@5: # garten by meillo@marmaro.de meillo@5: meillo@5: meillo@5: NAME=garten meillo@5: # extracts VERSION from the sources meillo@5: #VERSION=$(shell cat *.c | sed -n '/define VERSION/ s/.*"\([^"]*\)".*/\1/p' ) meillo@5: #NV=${NAME}-${VERSION} meillo@5: meillo@5: #DOCS=LICENSE README ChangeLog TODO examples meillo@5: meillo@5: # paths meillo@5: #PREFIX = /usr meillo@5: #BINDIR = ${PREFIX}/bin meillo@5: #MANDIR = ${PREFIX}/share/man meillo@5: meillo@5: # compile env meillo@5: CC = gcc meillo@5: LD = ${CC} meillo@5: DEBUG = -g meillo@5: CFLAGS = -Wall -c ${DEBUG} meillo@10: LDFLAGS = -Wall ${DEBUG} -lsqlite3 meillo@5: meillo@5: # files meillo@10: DEP = db.h game.h meillo@12: SRC = main.c clock.c environment.c weather.c growth.c db.c meillo@12: OBJ = $(SRC:.c=.o) meillo@5: meillo@5: meillo@10: .PHONY: all meillo@5: all: options build meillo@5: meillo@10: .PHONY: options meillo@5: options: meillo@5: @echo build options: meillo@5: @echo "CC = ${CC}" meillo@5: @echo "LD = ${LD}" meillo@5: @echo "CFLAGS = ${CFLAGS}" meillo@5: @echo "LDFLAGS = ${LDFLAGS}" meillo@5: @echo meillo@5: meillo@5: meillo@10: .PHONY: build meillo@5: build: options ${NAME} meillo@5: meillo@5: meillo@12: $(OBJ): $(SRC) $(DEP) meillo@5: meillo@12: ${NAME}: $(DEP) $(OBJ) meillo@12: gcc -o $(NAME) $(LDFLAGS) $(OBJ) meillo@5: meillo@5: meillo@10: .PHONY: car meillo@5: car: clean all meillo@5: meillo@5: meillo@10: .PHONY: strip meillo@5: strip: ${NAME} meillo@5: @echo stripping meillo@14: @strip $(NAME) meillo@5: meillo@5: meillo@10: .PHONY: changelog meillo@10: changelog: meillo@10: @echo generating changelog from mercurial log meillo@10: @hg log -v --style changelog > ChangeLog meillo@10: meillo@10: meillo@10: .PHONY: clean meillo@10: clean: meillo@10: rm -f *.o meillo@14: rm -f $(NAME) meillo@10: meillo@10: meillo@5: #dist: build changelog meillo@5: #@echo "generating tarball" meillo@5: #@mkdir -p ${NV} meillo@5: #@cp -rf ${SRC} ${DEP} ${NAME}.1 Makefile ${DOCS} ${NV} meillo@5: #@fakeroot tar -czhof ${NV}.tar.gz ${NV} meillo@5: #@rm -rf ${NV}