abduco

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

Makefile (1416B)


      1 include config.mk
      2 
      3 VERSION = 0.6
      4 
      5 CFLAGS_STD ?= -std=c99 -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -DNDEBUG
      6 CFLAGS_STD += -DVERSION=\"${VERSION}\"
      7 
      8 LDFLAGS_STD ?= -lc -lutil
      9 
     10 STRIP ?= strip
     11 
     12 SRC = abduco.c
     13 
     14 all: abduco
     15 
     16 config.h:
     17 	cp config.def.h config.h
     18 
     19 config.mk:
     20 	@touch $@
     21 
     22 abduco: config.h config.mk *.c
     23 	${CC} ${CFLAGS} ${CFLAGS_STD} ${CFLAGS_AUTO} ${CFLAGS_EXTRA} ${SRC} ${LDFLAGS} ${LDFLAGS_STD} ${LDFLAGS_AUTO} -o $@
     24 
     25 debug: clean
     26 	make CFLAGS_EXTRA='${CFLAGS_DEBUG}'
     27 
     28 clean:
     29 	@echo cleaning
     30 	@rm -f abduco abduco-*.tar.gz
     31 
     32 dist: clean
     33 	@echo creating dist tarball
     34 	@git archive --prefix=abduco-${VERSION}/ -o abduco-${VERSION}.tar.gz HEAD
     35 
     36 install: abduco
     37 	@echo installing executable file to ${DESTDIR}${PREFIX}/bin
     38 	@mkdir -p ${DESTDIR}${PREFIX}/bin
     39 	@cp -f abduco ${DESTDIR}${PREFIX}/bin
     40 	@echo stripping executable
     41 	@${STRIP} ${DESTDIR}${PREFIX}/bin/abduco
     42 	@chmod 755 ${DESTDIR}${PREFIX}/bin/abduco
     43 	@echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
     44 	@mkdir -p ${DESTDIR}${MANPREFIX}/man1
     45 	@sed "s/VERSION/${VERSION}/g" < abduco.1 > ${DESTDIR}${MANPREFIX}/man1/abduco.1
     46 	@chmod 644 ${DESTDIR}${MANPREFIX}/man1/abduco.1
     47 
     48 uninstall:
     49 	@echo removing executable file from ${DESTDIR}${PREFIX}/bin
     50 	@rm -f ${DESTDIR}${PREFIX}/bin/abduco
     51 	@echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
     52 	@rm -f ${DESTDIR}${MANPREFIX}/man1/abduco.1
     53 
     54 .PHONY: all clean dist install uninstall debug