meillo@3: # bday by meillo@marmaro.de meillo@0: meillo@0: meillo@3: NAME=bday meillo@3: VERSION = 0.1 meillo@3: NV=${NAME}-${VERSION} meillo@3: meillo@12: DOCS=COPYRIGHT COPYING ChangeLog TODO examples meillo@3: meillo@3: # paths meillo@3: PREFIX = /usr meillo@3: BINDIR = ${PREFIX}/bin meillo@3: MANDIR = ${PREFIX}/share/man meillo@3: meillo@7: SRC=bday.c meillo@3: OBJ=$(SRC:.c=.o) meillo@3: meillo@5: CFLAGS=-O2 -Wall meillo@0: meillo@5: all: build meillo@0: meillo@3: build: ${NAME} meillo@0: meillo@3: ${NAME}: $(OBJ) meillo@0: $(CC) $(LDFLAGS) $(OBJ) -o $@ meillo@0: meillo@5: car: clean all meillo@5: meillo@3: dist: build changelog meillo@3: @mkdir -p ${NV} meillo@12: @cp -rf ${NAME} ${SRC} ${NAME}.1 Makefile ${DOCS} ${NV} meillo@3: @tar -czhof ${NV}.tar.gz ${NV} meillo@3: @rm -rf ${NV} meillo@0: meillo@3: deb: dist meillo@3: @mkdir -p Packages meillo@3: @cp ${NV}.tar.gz Packages/ meillo@3: @( \ meillo@3: cd Packages/ ;\ meillo@3: tar -xzf ${NV}.tar.gz ;\ meillo@3: mv ${NV}.tar.gz ${NAME}_${VERSION}.orig.tar.gz ;\ meillo@3: cd ${NV}/ ;\ meillo@3: cp -r ../../debian/ . ;\ meillo@12: debuild -sa ;\ meillo@3: ) meillo@3: meillo@3: changelog: meillo@3: @echo generating changelog from mercurial log meillo@3: @hg log -v --style changelog > ChangeLog meillo@3: meillo@3: install: meillo@3: @echo installing executable file to ${DESTDIR}${BINDIR} meillo@3: @mkdir -p ${DESTDIR}${BINDIR} meillo@3: @cp ${NAME} ${DESTDIR}${BINDIR} meillo@3: @chmod 755 ${DESTDIR}${BINDIR}/${NAME} meillo@3: @echo installing manual page to ${DESTDIR}${MANDIR}/man1 meillo@3: @mkdir -p ${DESTDIR}${MANDIR}/man1 meillo@3: @sed 's/VERSION/${VERSION}/g' < ${NAME}.1 > ${DESTDIR}${MANDIR}/man1/${NAME}.1 meillo@3: @chmod 644 ${DESTDIR}${MANDIR}/man1/${NAME}.1 meillo@3: meillo@3: uninstall: meillo@3: @echo removing executable file from ${DESTDIR}${BINDIR} meillo@3: @rm -f ${DESTDIR}${BINDIR}/${NAME} meillo@3: @echo removing manual page from ${DESTDIR}${MANDIR}/man1 meillo@3: @rm -f ${DESTDIR}${MANDIR}/man1/${NAME}.1 meillo@0: meillo@0: meillo@0: clean: meillo@0: rm -f *.o meillo@0: meillo@0: realclean: clean meillo@3: rm -f ${NAME} meillo@3: meillo@3: distclean: realclean meillo@3: @rm -f ${NAME}-*.tar.gz ChangeLog meillo@3: meillo@3: debclean: distclean meillo@3: @cd Packages/${NV}/ ; debuild clean ; meillo@3: meillo@3: meillo@3: .PHONY: all dist deb changelog clean distclean debclean build install uninstall