baum
annotate Makefile @ 13:bf660b45bba9
added commandline options (-v, -c, file); logging only if -v is set
author | meillo@marmaro.de |
---|---|
date | Wed, 13 Feb 2008 09:13:02 +0100 |
parents | 2f71d692d4f9 |
children | 3c64b5ac821b |
rev | line source |
---|---|
meillo@0 | 1 # common makefile |
meillo@0 | 2 |
meillo@0 | 3 # program |
meillo@0 | 4 PROGRAM = baum |
meillo@2 | 5 SRC = baum.c actions.c |
meillo@0 | 6 OBJ = ${SRC:.c=.o} |
meillo@2 | 7 DEP = baum.h actions.h |
meillo@0 | 8 |
meillo@0 | 9 # compile env |
meillo@0 | 10 CC = gcc |
meillo@0 | 11 LD = ${CC} |
meillo@0 | 12 DEBUG = -g |
meillo@0 | 13 CFLAGS = -Wall -c ${DEBUG} |
meillo@0 | 14 LFLAGS = -Wall ${DEBUG} |
meillo@0 | 15 |
meillo@0 | 16 #### |
meillo@0 | 17 |
meillo@0 | 18 all: options ${PROGRAM} |
meillo@0 | 19 |
meillo@0 | 20 options: |
meillo@0 | 21 @echo build options: |
meillo@0 | 22 @echo "CC = ${CC}" |
meillo@0 | 23 @echo "LD = ${LD}" |
meillo@0 | 24 @echo "CFLAGS = ${CFLAGS}" |
meillo@0 | 25 @echo "LFLAGS = ${LFLAGS}" |
meillo@0 | 26 @echo |
meillo@0 | 27 |
meillo@0 | 28 .cpp.o: |
meillo@0 | 29 $(CC) $(CFLAGS) $< |
meillo@0 | 30 |
meillo@0 | 31 ${OBJ}: ${DEP} |
meillo@0 | 32 |
meillo@0 | 33 ${PROGRAM}: ${OBJ} |
meillo@0 | 34 $(LD) $(LFLAGS) ${OBJ} -o $@ |
meillo@0 | 35 |
meillo@0 | 36 debug: all |
meillo@0 | 37 gdb ${PROGRAM} |
meillo@0 | 38 |
meillo@0 | 39 strip: ${PROGRAM} |
meillo@0 | 40 @echo stripping ${PROGRAM} |
meillo@0 | 41 @strip ${PROGRAM} |
meillo@0 | 42 |
meillo@0 | 43 tar: clean |
meillo@0 | 44 @echo creating archive |
meillo@0 | 45 @tar -czvf ${PROGRAM}.tar.gz * |
meillo@0 | 46 |
meillo@0 | 47 clean: |
meillo@0 | 48 @echo cleaning |
meillo@0 | 49 @rm -f ${PROGRAM} ${OBJ} |
meillo@0 | 50 |
meillo@0 | 51 .PHONY: all options debug strip tar clean |