random

:-)
git clone read: git://git.margiolis.net/random.git
Log | Files | Refs | LICENSE

Makefile (1152B)


      1 # See LICENSE file for copyright and license details.
      2 # minecurses - curses(3) minesweeper game
      3 .POSIX:
      4 
      5 include config.mk
      6 
      7 BIN = minecurses
      8 DIST = ${BIN}-${VERSION}
      9 MAN6 = ${BIN}.6
     10 
     11 SRC = minecurses.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 defs.h Makefile minecurses.6 minecurses.c \
     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}/man6
     41 	cp -f ${BIN} ${DESTDIR}${PREFIX}/bin
     42 	cp -f ${MAN6} ${DESTDIR}${MANPREFIX}/man6
     43 	sed "s/VERSION/${VERSION}/g" < ${MAN6} > ${DESTDIR}${MANPREFIX}/man6/${MAN6}
     44 	chmod 755 ${DESTDIR}${PREFIX}/bin/${BIN}
     45 	chmod 644 ${DESTDIR}${MANPREFIX}/man6/${MAN6}
     46 
     47 uninstall:
     48 	rm -f ${DESTDIR}${PREFIX}/bin/${BIN} \
     49 		${DESTDIR}${MANPREFIX}/man6/${MAN6}
     50 
     51 clean:
     52 	rm -f ${BIN} ${OBJ} ${DIST}.tar.gz *.core
     53 
     54 .PHONY: all options clean dist install uninstall run