baum

diff Makefile @ 62:80df58d240b2

merge
author meillo@marmaro.de
date Thu, 13 Nov 2008 13:19:42 +0100
parents c31b5bb6d493
children
line diff
     1.1 --- a/Makefile	Thu Nov 13 13:15:11 2008 +0100
     1.2 +++ b/Makefile	Thu Nov 13 13:19:42 2008 +0100
     1.3 @@ -9,7 +9,7 @@
     1.4  DOCS=LICENSE README ChangeLog TODO examples
     1.5  
     1.6  # paths
     1.7 -PREFIX = /usr
     1.8 +PREFIX = /usr/local
     1.9  BINDIR = ${PREFIX}/bin
    1.10  MANDIR = ${PREFIX}/share/man
    1.11  
    1.12 @@ -26,9 +26,10 @@
    1.13  DEP = baum.h
    1.14  
    1.15  
    1.16 +.PHONY: all
    1.17 +all: options $(NAME)
    1.18  
    1.19 -all: options build
    1.20 -
    1.21 +.PHONY: options
    1.22  options:
    1.23  	@echo build options:
    1.24  	@echo "CC     = ${CC}"
    1.25 @@ -37,56 +38,48 @@
    1.26  	@echo "LDFLAGS = ${LDFLAGS}"
    1.27  	@echo
    1.28  
    1.29 -build: options ${NAME}
    1.30  
    1.31  ${NAME}: $(OBJ) ${DEP}
    1.32  	$(CC) $(LDFLAGS) $(OBJ) -o $@
    1.33  
    1.34 +
    1.35  ${OBJ}: ${DEP}
    1.36  
    1.37 -car: clean all
    1.38  
    1.39 -debug: all
    1.40 -	gdb ${NAME}
    1.41 -
    1.42 +.PHONY: strip
    1.43  strip: ${NAME}
    1.44  	@echo stripping ${NAME}
    1.45  	@strip ${NAME}
    1.46  
    1.47 -dist: build changelog
    1.48 +
    1.49 +.PHONY: dist
    1.50 +dist: all changelog
    1.51  	@echo "generating tarball"
    1.52  	@mkdir -p ${NV}
    1.53  	@cp -rf ${SRC} ${DEP} ${NAME}.1 Makefile ${DOCS} ${NV}
    1.54  	@fakeroot tar -czhof ${NV}.tar.gz ${NV}
    1.55  	@rm -rf ${NV}
    1.56  
    1.57 -deb: dist
    1.58 -	@mkdir -p Packages
    1.59 -	@cp ${NV}.tar.gz Packages/
    1.60 -	@( \
    1.61 -		cd Packages/ ;\
    1.62 -		tar -xzf ${NV}.tar.gz ;\
    1.63 -		mv ${NV}.tar.gz ${NAME}_${VERSION}.orig.tar.gz ;\
    1.64 -		cd ${NV}/ ;\
    1.65 -		cp -r ../../debian/ . ;\
    1.66 -		debuild ;\
    1.67 -	 )
    1.68 -	@rm -rf Packages/${NV}
    1.69  
    1.70 +.PHONY: changelog
    1.71  changelog:
    1.72  	@echo generating changelog from mercurial log
    1.73  	@hg log -v --style changelog > ChangeLog
    1.74  
    1.75 -install: build strip
    1.76 +
    1.77 +.PHONY: install
    1.78 +install: all strip
    1.79  	@echo installing executable file to ${DESTDIR}${BINDIR}
    1.80  	@mkdir -p ${DESTDIR}${BINDIR}
    1.81  	@cp ${NAME} ${DESTDIR}${BINDIR}
    1.82  	@chmod 755 ${DESTDIR}${BINDIR}/${NAME}
    1.83  	@echo installing manual page to ${DESTDIR}${MANDIR}/man1
    1.84  	@mkdir -p ${DESTDIR}${MANDIR}/man1
    1.85 -	@sed 's/VERSION/${VERSION}/g' < ${NAME}.1 > ${DESTDIR}${MANDIR}/man1/${NAME}.1
    1.86 +	@cp ${NAME}.1 ${DESTDIR}${MANDIR}/man1
    1.87  	@chmod 644 ${DESTDIR}${MANDIR}/man1/${NAME}.1
    1.88  
    1.89 +
    1.90 +.PHONY: uninstall
    1.91  uninstall:
    1.92  	@echo removing executable file from ${DESTDIR}${BINDIR}
    1.93  	@rm -f ${DESTDIR}${BINDIR}/${NAME}
    1.94 @@ -94,17 +87,11 @@
    1.95  	@rm -f ${DESTDIR}${MANDIR}/man1/${NAME}.1
    1.96  
    1.97  
    1.98 +.PHONY: clean
    1.99  clean:
   1.100  	rm -f *.o
   1.101  
   1.102 +
   1.103 +.PHONY: realclean
   1.104  realclean: clean
   1.105 -	rm -f ${NAME}
   1.106 -
   1.107 -distclean: realclean
   1.108 -	@rm -f ${NAME}-*.tar.gz ChangeLog
   1.109 -
   1.110 -debclean: distclean
   1.111 -	@cd Packages/${NV}/ ; debuild clean ;
   1.112 -
   1.113 -
   1.114 -.PHONY: all dist deb changelog clean distclean debclean build install uninstall
   1.115 +	rm -f ${NAME} ChangeLog