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@3: DOCS=COPYRIGHT ChangeLog TODO meillo@3: meillo@3: # paths meillo@3: PREFIX = /usr meillo@3: BINDIR = ${PREFIX}/bin meillo@3: MANDIR = ${PREFIX}/share/man meillo@3: meillo@3: SRC=birthday.c bdengine.c meillo@3: OBJ=$(SRC:.c=.o) meillo@3: meillo@0: CFLAGS=-O2 -Wall -Wstrict-prototypes meillo@0: meillo@3: all: meillo@3: @echo usage: make [un]install meillo@0: meillo@3: build: ${NAME} meillo@0: meillo@3: ${NAME}: $(OBJ) meillo@0: $(CC) $(LDFLAGS) $(OBJ) -o $@ meillo@0: meillo@3: dist: build changelog meillo@3: @mkdir -p ${NV} meillo@3: @cp -f ${NAME} ${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@3: debuild ;\ 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