view 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
line wrap: on
line source

# garten by meillo@marmaro.de


NAME=garten
# extracts VERSION from the sources
#VERSION=$(shell cat *.c | sed -n '/define VERSION/ s/.*"\([^"]*\)".*/\1/p'  )
#NV=${NAME}-${VERSION}

#DOCS=LICENSE README ChangeLog TODO examples

# paths
#PREFIX = /usr
#BINDIR = ${PREFIX}/bin
#MANDIR = ${PREFIX}/share/man

# compile env
CC = gcc
LD = ${CC}
DEBUG = -g
CFLAGS = -Wall -c ${DEBUG}
LDFLAGS = -Wall ${DEBUG}

# files
#SRC=baum.c actions.c
#OBJ=$(SRC:.c=.o)
#DEP = baum.h



all: options build

options:
	@echo build options:
	@echo "CC     = ${CC}"
	@echo "LD     = ${LD}"
	@echo "CFLAGS = ${CFLAGS}"
	@echo "LDFLAGS = ${LDFLAGS}"
	@echo


build: options ${NAME}

bin/clock: clock.c db.h game.h
	$(CC) -o $@ $(LDFLAGS) `mysql_config --cflags` clock.c `mysql_config --libs`

bin/weather: weather.c db.h game.h
	$(CC) -o $@ $(LDFLAGS) `mysql_config --cflags` weather.c `mysql_config --libs`


${NAME}: bin/clock bin/weather


#${OBJ}: ${DEP}


car: clean all


#debug: all
#gdb ${NAME}


strip: ${NAME}
	@echo stripping
	@strip bin/*


#dist: build changelog
#@echo "generating tarball"
#@mkdir -p ${NV}
#@cp -rf ${SRC} ${DEP} ${NAME}.1 Makefile ${DOCS} ${NV}
#@fakeroot tar -czhof ${NV}.tar.gz ${NV}
#@rm -rf ${NV}


changelog:
	@echo generating changelog from mercurial log
	@hg log -v --style changelog > ChangeLog


clean:
	rm -f *.o


realclean: clean
	rm -f bin/*


.PHONY: all dist deb changelog clean distclean debclean build install uninstall