1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
|
# This is Bisqwit's generic depfun.mak, included from Makefile.
# The same file is used in many different projects.
#
# depfun.mak version 1.4.0
#
# Required vars:
#
# ${CPP} - C preprocessor name, usually "gcc"
# ${CPPFLAGS} - preprocessor flags (including defs)
#
# ${ARCHFILES} - All file names to include in archive
# .depend, depfun.mak and Makefile are
# automatically included.
# ${ARCHNAME} - Name of program. Example: testprog-0.0.1
#
# Optional vars:
#
# ${ARCHDIR} - Directory for the archives.
# Must end with '/'.
# ${INSTALLPROGS} - Programs to be installed (space delimited)
# ${BINDIR} - Directory for installed programs (without /)
# Example: /usr/local/bin
# ${INSTALL} - Installer program, example: install
#
# ${EXTRA_ARCHFILES} - More files to include in archive,
# but without dependency checking
.depend: ${ARCHFILES}
@echo "Checking dependencies..."
@rm -f $@.tmp && for s in *.c *.cc *.cpp;do if echo "$$s"|grep -vq '^\*';then ${CPP} ${CPPFLAGS} -MM -MG $$s;fi;done >$@.tmp && rm -f $@ && cp -p $@.tmp $@ && sed 's/\.o:/.lo:/' <$@.tmp >>$@ && rm -f $@.tmp
depend dep: .depend
include .depend
archpak: ${ARCHFILES}
@if [ "${ARCHNAME}" = "" ]; then echo ARCHNAME not set\!;false;fi
- mkdir ${ARCHNAME} ${ARCHDIR} 2>/dev/null
cp --parents -lfr ${ARCHFILES} ${EXTRA_ARCHFILES} depfun.mak Makefile ${ARCHNAME}/ 2>&1 >/dev/null | while read line;do cp --parents -fr "`echo "$$line"|sed 's/.*${ARCHNAME}\///;s/'\''.*//'`" ${ARCHNAME}/; done
- if [ -f docmaker.php ]; then php -q docmaker.php ${ARCHNAME} >README.html && ln -f docmaker.php README.html ${ARCHNAME}/;fi
if [ -f makediff.php ]; then ln -f makediff.php ${ARCHNAME}/; fi
#- rm -f ${ARCHDIR}${ARCHNAME}.zip
#- zip -9rq ${ARCHDIR}${ARCHNAME}.zip ${ARCHNAME}/
#- rar a ${ARCHDIR}${ARCHNAME}.rar -mm -m5 -r -s -inul ${ARCHNAME}/
#tar cf ${ARCHDIR}${ARCHNAME}.tar ${ARCHNAME}/
#
find ${ARCHNAME}/ -type d > .paktmp.txt
find ${ARCHNAME}/ -not -type d | rev | sort | rev >> .paktmp.txt
#find ${ARCHNAME}/|/ftp/backup/bsort >.paktmp.txt
tar -c --no-recursion -f ${ARCHDIR}${ARCHNAME}.tar -T.paktmp.txt
rm -f .paktmp.txt
rm -rf ${ARCHNAME}
- if [ "${NOBZIP2ARCHIVES}" = "" ]; then bzip2 -9 >${ARCHDIR}${ARCHNAME}.tar.bz2 < ${ARCHDIR}${ARCHNAME}.tar; fi
if [ "${NOGZIPARCHIVES}" = "" ]; then gzip -f9 ${ARCHDIR}${ARCHNAME}.tar; fi
rm -f ${ARCHDIR}${ARCHNAME}.tar
# Makes the packages of various types...
pak: archpak
if [ -f makediff.php ]; then php -q makediff.php ${ARCHNAME} ${ARCHDIR} 1; fi
# This is Bisqwit's method to install the packages to web-server...
omabin${DEPFUN_OMABIN}: archpak
if [ -f makediff.php ]; then php -q makediff.php ${ARCHNAME} ${ARCHDIR}; fi
#- @rm -f /WWW/src/${ARCHNAME}.{zip,rar,tar.{bz2,gz}}
#- ln -f ${ARCHDIR}${ARCHNAME}.{zip,rar,tar.{bz2,gz}} /WWW/src/
- @rm -f /WWW/src/${ARCHNAME}.tar.{bz2,gz}
- ln -f ${ARCHDIR}${ARCHNAME}.tar.{bz2,gz} /WWW/src/
if [ -f progdesc.php ]; then cp -p --remove-destination progdesc.php /WWW/src/.desc-$(subst /,,$(dir $(subst -,/,$(ARCHNAME)))).php 2>/dev/null || cp -fp progdesc.php /WWW/src/.desc-$(subst /,,$(dir $(subst -,/,$(ARCHNAME)))).php; fi
install${DEPFUN_INSTALL}: ${INSTALLPROGS}
- if [ ! "${BINDIR}" = "" ]; then mkdir --parents $(BINDIR) 2>/dev/null; mkdir $(BINDIR) 2>/dev/null; \
for s in ${INSTALLPROGS} ""; do if [ ! "$$s" = "" ]; then \
${INSTALL} -c -s -o bin -g bin -m 755 "$$s" ${BINDIR}/"$$s";fi;\
done; \
fi; \
if [ ! "${MANDIR}" = "" ]; then mkdir --parents $(MANDIR) 2>/dev/null; mkdir $(MANDIR) 2>/dev/null; \
for s in ${INSTALLMANS} ""; do if [ ! "$$s" = "" ]; then \
${INSTALL} -m 644 "$$s" ${MANDIR}/man"`echo "$$s"|sed 's/.*\.//'`"/"$$s";fi;\
done; \
fi
uninstall${DEPFUN_INSTALL} deinstall${DEPFUN_INSTALL}:
for s in ${INSTALLPROGS}; do rm -f ${BINDIR}/"$$s";done
- for s in ${INSTALLLIBS}; do rm -f ${LIBDIR}/"$$s";done
for s in ${INSTALLMANS} ""; do if [ ! "$$s" = "" ]; then \
rm -f ${MANDIR}/man"`echo "$$s"|sed 's/.*\.//'`"/"$$s";fi;\
done; \
.PHONY: pak dep depend archpak omabin \
install${DEPFUN_INSTALL} \
deinstall${DEPFUN_INSTALL} \
uninstall${DEPFUN_INSTALL}
|