sdep

A simple "date+event" line parser
git clone https://git.tronto.net/sdep
Download | Log | Files | Refs | README | LICENSE

Makefile (1538B)


      1 # See LICENSE file for copyright and license details.
      2 
      3 VERSION = 0.2
      4 
      5 PREFIX = /usr/local
      6 MANPREFIX = ${PREFIX}/share/man
      7 SCRIPTS = sdep-add sdep-checknow sdep-checkpast sdep-clear sdep-edit sdep-list
      8 
      9 CPPFLAGS = -D_XOPEN_SOURCE=700 -DVERSION=\"${VERSION}\"
     10 CFLAGS   = -pedantic -Wall -Os ${CPPFLAGS}
     11 DBGFLAGS = -pedantic -Wall -Wextra \
     12            -fsanitize=address -fsanitize=undefined ${CPPFLAGS}
     13 
     14 CC = cc
     15 
     16 
     17 all: options sdep
     18 
     19 options:
     20 	@echo sdep build options:
     21 	@echo "CFLAGS   = ${CFLAGS}"
     22 	@echo "CC       = ${CC}"
     23 
     24 sdep:
     25 	${CC} ${CFLAGS} -o sdep sdep.c
     26 
     27 debug:
     28 	${CC} ${CFLAGS} -o sdep sdep.c
     29 
     30 clean:
     31 	rm -rf sdep
     32 
     33 dist: clean
     34 	mkdir -p sdep-${VERSION}
     35 	cp -R LICENSE Makefile README.md sdep.1 sdep.c sdep-${VERSION}
     36 	tar -cf sdep-${VERSION}.tar sdep-${VERSION}
     37 	gzip sdep-${VERSION}.tar
     38 	mv sdep-${VERSION}.tar.gz releases/
     39 	rm -rf sdep-${VERSION}
     40 
     41 install: all
     42 	mkdir -p ${DESTDIR}${PREFIX}/bin
     43 	cp -f sdep ${DESTDIR}${PREFIX}/bin/sdep
     44 	chmod 755 ${DESTDIR}${PREFIX}/bin/sdep
     45 	mkdir -p ${DESTDIR}${MANPREFIX}/man1
     46 	sed "s/VERSION/${VERSION}/g" < sdep.1 \
     47 				     > ${DESTDIR}${MANPREFIX}/man1/sdep.1
     48 	chmod 644 ${DESTDIR}${MANPREFIX}/man1/sdep.1
     49 
     50 scripts:
     51 	for s in ${SCRIPTS}; do\
     52 		sed "s|SDEPDATA|${SD}|g" < scripts/$$s > \
     53 			${DESTDIR}${PREFIX}/bin/$$s ; \
     54 		chmod 755 ${DESTDIR}${PREFIX}/bin/$$s ;\
     55 	done
     56 
     57 uninstall:
     58 	rm -rf ${DESTDIR}${PREFIX}/bin/sdep ${DESTDIR}${MANPREFIX}/man1/sdep.1
     59 	for s in ${SCRIPTS}; do rm -rf ${DESTDIR}${PREFIX}/bin/$$s; done
     60 
     61 .PHONY: all options debug clean dist install scripts uninstall
     62