bday

diff Makefile @ 16:79d22407a6be

a lot of refactoring
author markus schnalke <meillo@marmaro.de>
date Mon, 24 Feb 2014 21:11:38 +0100
parents dc220ec8248d
children
line diff
     1.1 --- a/Makefile	Mon Feb 24 17:46:57 2014 +0100
     1.2 +++ b/Makefile	Mon Feb 24 21:11:38 2014 +0100
     1.3 @@ -1,81 +1,53 @@
     1.4  # bday by meillo@marmaro.de
     1.5  
     1.6  
     1.7 -NAME=bday
     1.8 -VERSION = 0.1
     1.9 -NV=${NAME}-${VERSION}
    1.10 +VERSION = 0.2
    1.11  
    1.12 -DOCS=COPYRIGHT COPYING ChangeLog TODO examples
    1.13 +DOCS=COPYRIGHT COPYING ChangeLog
    1.14  
    1.15  # paths
    1.16 -PREFIX = /usr
    1.17 +PREFIX = /usr/local
    1.18  BINDIR = ${PREFIX}/bin
    1.19  MANDIR = ${PREFIX}/share/man
    1.20  
    1.21 -SRC=bday.c
    1.22 -OBJ=$(SRC:.c=.o)
    1.23 -
    1.24  CFLAGS=-O2 -Wall
    1.25  
    1.26  all: build
    1.27 +build: bday
    1.28  
    1.29 -build: ${NAME}
    1.30 -
    1.31 -${NAME}: $(OBJ)
    1.32 -	$(CC) $(LDFLAGS) $(OBJ) -o $@
    1.33 -
    1.34 -car: clean all
    1.35 +bday: bday.o
    1.36 +	$(CC) $(LDFLAGS) bday.o -o $@
    1.37  
    1.38  dist: build changelog
    1.39 -	@mkdir -p ${NV}
    1.40 -	@cp -rf ${NAME} ${SRC} ${NAME}.1 Makefile ${DOCS} ${NV}
    1.41 -	@tar -czhof ${NV}.tar.gz ${NV}
    1.42 -	@rm -rf ${NV}
    1.43 -
    1.44 -deb: dist
    1.45 -	@mkdir -p Packages
    1.46 -	@cp ${NV}.tar.gz Packages/
    1.47 -	@( \
    1.48 -		cd Packages/ ;\
    1.49 -		tar -xzf ${NV}.tar.gz ;\
    1.50 -		mv ${NV}.tar.gz ${NAME}_${VERSION}.orig.tar.gz ;\
    1.51 -		cd ${NV}/ ;\
    1.52 -		cp -r ../../debian/ . ;\
    1.53 -		debuild -sa ;\
    1.54 -	 )
    1.55 +	@mkdir -p bday-${VERSION}
    1.56 +	@cp bday bday.c bday.1 Makefile ${DOCS} bday-${VERSION}
    1.57 +	@tar -czhf bday-${VERSION}.tar.gz bday-${VERSION}
    1.58 +	@rm -rf bday-${VERSION}
    1.59  
    1.60  changelog:
    1.61  	@echo generating changelog from mercurial log
    1.62  	@hg log -v --style changelog > ChangeLog
    1.63  
    1.64  install:
    1.65 -	@echo installing executable file to ${DESTDIR}${BINDIR}
    1.66 -	@mkdir -p ${DESTDIR}${BINDIR}
    1.67 -	@cp ${NAME} ${DESTDIR}${BINDIR}
    1.68 -	@chmod 755 ${DESTDIR}${BINDIR}/${NAME}
    1.69 -	@echo installing manual page to ${DESTDIR}${MANDIR}/man1
    1.70 -	@mkdir -p ${DESTDIR}${MANDIR}/man1
    1.71 -	@sed 's/VERSION/${VERSION}/g' < ${NAME}.1 > ${DESTDIR}${MANDIR}/man1/${NAME}.1
    1.72 -	@chmod 644 ${DESTDIR}${MANDIR}/man1/${NAME}.1
    1.73 +	@echo installing executable file to ${BINDIR}
    1.74 +	@mkdir -p ${BINDIR}
    1.75 +	@cp bday ${BINDIR}
    1.76 +	@chmod 755 ${BINDIR}/bday
    1.77 +	@echo installing manual page to ${MANDIR}/man1
    1.78 +	@mkdir -p ${MANDIR}/man1
    1.79 +	@sed 's/VERSION/${VERSION}/g' <bday.1 >${MANDIR}/man1/bday.1
    1.80 +	@chmod 644 ${MANDIR}/man1/bday.1
    1.81  
    1.82  uninstall:
    1.83 -	@echo removing executable file from ${DESTDIR}${BINDIR}
    1.84 -	@rm -f ${DESTDIR}${BINDIR}/${NAME}
    1.85 -	@echo removing manual page from ${DESTDIR}${MANDIR}/man1
    1.86 -	@rm -f ${DESTDIR}${MANDIR}/man1/${NAME}.1
    1.87 +	@echo removing executable file from ${BINDIR}
    1.88 +	@rm -f ${BINDIR}/bday
    1.89 +	@echo removing manual page from ${MANDIR}/man1
    1.90 +	@rm -f ${MANDIR}/man1/bday.1
    1.91  
    1.92  
    1.93  clean:
    1.94  	rm -f *.o
    1.95 -
    1.96  realclean: clean
    1.97 -	rm -f ${NAME}
    1.98 -
    1.99 +	rm -f bday
   1.100  distclean: realclean
   1.101 -	@rm -f ${NAME}-*.tar.gz ChangeLog
   1.102 -
   1.103 -debclean: distclean
   1.104 -	@cd Packages/${NV}/ ; debuild clean ;
   1.105 -
   1.106 -
   1.107 -.PHONY: all dist deb changelog clean distclean debclean build install uninstall
   1.108 +	@rm -f bday-*.tar.gz ChangeLog