graphcurses

Curses 2D graph generator
git clone git://git.margiolis.net/graphcurses.git
Log | Files | Refs | README | LICENSE

Makefile (1154B)


      1 # See LICENSE file for copyright and license details.
      2 # graphcurses - curses(3) 2D graph generator
      3 .POSIX:
      4 
      5 include config.mk
      6 
      7 BIN = graphcurses
      8 DIST = ${BIN}-${VERSION}
      9 MAN1 = ${BIN}.1
     10 
     11 SRC = graphcurses.c
     12 OBJ = ${SRC:.c=.o}
     13 
     14 all: options ${BIN}
     15 
     16 options:
     17 	@echo ${BIN} build options:
     18 	@echo "CFLAGS	= ${CFLAGS}"
     19 	@echo "LDFLAGS	= ${LDFLAGS}"
     20 	@echo "CC	= ${CC}"
     21 
     22 ${BIN}: ${OBJ}
     23 	${CC} ${LDFLAGS} ${OBJ} -o $@
     24 
     25 .c.o:
     26 	${CC} -c ${CFLAGS} $<
     27 
     28 dist: clean
     29 	mkdir -p ${DIST}
     30 	cp -R config.mk graphcurses.1 graphcurses.c LICENSE Makefile \
     31 		README.md ${DIST}
     32 	tar -cf ${DIST}.tar ${DIST}
     33 	gzip ${DIST}.tar
     34 	rm -rf ${DIST}
     35 
     36 run:
     37 	./${BIN}
     38 
     39 install: all
     40 	mkdir -p ${DESTDIR}${PREFIX}/bin ${DESTDIR}${MANPREFIX}/man1
     41 	cp -f ${BIN} ${DESTDIR}${PREFIX}/bin
     42 	cp -f ${MAN1} ${DESTDIR}${MANPREFIX}/man1
     43 	sed "s/VERSION/${VERSION}/g" < ${MAN1} > ${DESTDIR}${MANPREFIX}/man1/${MAN1}
     44 	chmod 755 ${DESTDIR}${PREFIX}/bin/${BIN}
     45 	chmod 644 ${DESTDIR}${MANPREFIX}/man1/${MAN1}
     46 
     47 uninstall:
     48 	rm -f ${DESTDIR}${PREFIX}/bin/${BIN} \
     49 		${DESTDIR}${MANPREFIX}/man1/${MAN1}
     50 
     51 clean:
     52 	rm -f ${BIN} ${OBJ} ${DIST}.tar.gz *.core
     53 
     54 .PHONY: all options clean dist install uninstall run