mk

Makefile templates
git clone git://git.margiolis.net/mk.git
Log | Files | Refs | README | LICENSE

sh.mk (909B)


      1 # See LICENSE file for copyright and license details.
      2 # <++>
      3 .POSIX:
      4 
      5 TARGS = <++>
      6 VERSION = <++>
      7 DIST = <++>-${VERSION}
      8 PREFIX = /usr/local
      9 MANPREFIX = ${PREFIX}/share/man
     10 # OpenBSD
     11 #MANPREFIX = ${PREFIX}/man
     12 
     13 all: ${TARGS}
     14 	chmod +x ${TARGS}
     15 
     16 dist:
     17 	mkdir -p ${DIST}
     18 	cp -R <++> ${DIST}
     19 	tar -cf ${DIST}.tar ${DIST}
     20 	gzip ${DIST}.tar
     21 	rm -rf ${DIST}
     22 
     23 install: all
     24 	mkdir -p ${DESTDIR}${PREFIX}/bin ${DESTDIR}${MANPREFIX}/man1
     25 	cp -f ${TARGS} ${DESTDIR}${PREFIX}/bin
     26 	for targ in ${TARGS} ; do \
     27 		sed "s/VERSION/${VERSION}/g" < $${targ}.1 > ${DESTDIR}${MANPREFIX}/man1/$${targ}.1 \
     28 		chmod 755 ${DESTDIR}${PREFIX}/bin/$${targ} ; \
     29 		chmod 644 ${DESTDIR}${MANPREFIX}/man1/$${targ}.1 ; \
     30 	done
     31 
     32 uninstall:
     33 	for targ in ${TARGS} ; do \
     34 		rm -f ${DESTDIR}${PREFIX}/bin/$${targ} ; \
     35 		rm -f ${DESTDIR}${MANPREFIX}/man1/$${targ}.1 ; \
     36 	done
     37 
     38 clean:
     39 	rm -f ${DIST}.tar.gz
     40 
     41 .PHONY: all clean dist install uninstall