# HG changeset patch # User meillo@marmaro.de # Date 1214384954 -7200 # Node ID f5f06d6f62b39c207ebf858b9562d030981e8aa5 # Parent 21ff1783f6406b61db7237e264f9d8fdfbdf5318 made Makefile much simpler (installs now to /usr/local) diff -r 21ff1783f640 -r f5f06d6f62b3 Makefile --- a/Makefile Wed Jun 25 09:20:16 2008 +0200 +++ b/Makefile Wed Jun 25 11:09:14 2008 +0200 @@ -9,7 +9,7 @@ DOCS=LICENSE README ChangeLog TODO examples # paths -PREFIX = /usr +PREFIX = /usr/local BINDIR = ${PREFIX}/bin MANDIR = ${PREFIX}/share/man @@ -26,9 +26,10 @@ DEP = baum.h +.PHONY: all +all: options $(NAME) -all: options build - +.PHONY: options options: @echo build options: @echo "CC = ${CC}" @@ -37,56 +38,48 @@ @echo "LDFLAGS = ${LDFLAGS}" @echo -build: options ${NAME} ${NAME}: $(OBJ) ${DEP} $(CC) $(LDFLAGS) $(OBJ) -o $@ + ${OBJ}: ${DEP} -car: clean all -debug: all - gdb ${NAME} - +.PHONY: strip strip: ${NAME} @echo stripping ${NAME} @strip ${NAME} -dist: build changelog + +.PHONY: dist +dist: all 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} -deb: dist - @mkdir -p Packages - @cp ${NV}.tar.gz Packages/ - @( \ - cd Packages/ ;\ - tar -xzf ${NV}.tar.gz ;\ - mv ${NV}.tar.gz ${NAME}_${VERSION}.orig.tar.gz ;\ - cd ${NV}/ ;\ - cp -r ../../debian/ . ;\ - debuild ;\ - ) - @rm -rf Packages/${NV} +.PHONY: changelog changelog: @echo generating changelog from mercurial log @hg log -v --style changelog > ChangeLog -install: build strip + +.PHONY: install +install: all strip @echo installing executable file to ${DESTDIR}${BINDIR} @mkdir -p ${DESTDIR}${BINDIR} @cp ${NAME} ${DESTDIR}${BINDIR} @chmod 755 ${DESTDIR}${BINDIR}/${NAME} @echo installing manual page to ${DESTDIR}${MANDIR}/man1 @mkdir -p ${DESTDIR}${MANDIR}/man1 - @sed 's/VERSION/${VERSION}/g' < ${NAME}.1 > ${DESTDIR}${MANDIR}/man1/${NAME}.1 + @cp ${NAME}.1 ${DESTDIR}${MANDIR}/man1 @chmod 644 ${DESTDIR}${MANDIR}/man1/${NAME}.1 + +.PHONY: uninstall uninstall: @echo removing executable file from ${DESTDIR}${BINDIR} @rm -f ${DESTDIR}${BINDIR}/${NAME} @@ -94,17 +87,11 @@ @rm -f ${DESTDIR}${MANDIR}/man1/${NAME}.1 +.PHONY: clean clean: rm -f *.o + +.PHONY: realclean realclean: clean - rm -f ${NAME} - -distclean: realclean - @rm -f ${NAME}-*.tar.gz ChangeLog - -debclean: distclean - @cd Packages/${NV}/ ; debuild clean ; - - -.PHONY: all dist deb changelog clean distclean debclean build install uninstall + rm -f ${NAME} ChangeLog