random

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

Makefile (946B)


      1 # See LICENSE file for copyright and license details.
      2 # fnc - a simple finance program
      3 .POSIX:
      4 
      5 PREFIX = /usr/local
      6 MAN_DIR = ${PREFIX}/share/man/man1
      7 # OpenBSD
      8 #MAN_DIR = ${PREFIX}//man/man1
      9 BIN_DIR = ${PREFIX}/bin
     10 
     11 BIN = fnc
     12 VERSION = 0
     13 DIST = ${BIN}-${VERSION}
     14 MAN1 = ${BIN}.1
     15 
     16 SRC = fnc.go
     17 
     18 all: ${BIN}
     19 
     20 ${BIN}: ${SRC}
     21 	go build ${SRC}
     22 
     23 dist: clean
     24 	mkdir -p ${DIST}
     25 	cp -fR fnc.1 fnc.go Makefile ${DIST}
     26 	tar -cf ${DIST}.tar ${DIST}
     27 	gzip ${DIST}.tar
     28 	rm -rf ${DIST}
     29 
     30 install: all
     31 	mkdir -p ${DESTDIR}${BIN_DIR} ${DESTDIR}${MAN_DIR}
     32 	cp -f ${BIN} ${BIN_DIR}
     33 	cp -f ${MAN1} ${DESTDIR}${MAN_DIR}
     34 	sed "s/VERSION/${VERSION}/g" < ${MAN1} > ${DESTDIR}${MAN_DIR}/${MAN1}
     35 	chmod 755 ${DESTDIR}${BIN_DIR}/${BIN}
     36 	chmod 644 ${DESTDIR}${MAN_DIR}/${MAN1}
     37 
     38 uninstall:
     39 	rm -f ${DESTDIR}${BIN_DIR}/${BIN}
     40 	rm -f ${DESTDIR}${MAN_DIR}/${MAN1}
     41 
     42 run:
     43 	./${BIN}
     44 
     45 clean:
     46 	rm -f ${BIN} ${OBJ} ${DIST}.tar.gz
     47 
     48 .PHONY: all options clean dist install uninstall run