From da19c68bf5383724f54234db2d46bcc43b7520b5 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 16 Jul 2015 13:05:47 +0200 Subject: [PATCH] make: split `install' and `plist' targets While there, make install provide output as well and mop up a few minor issues with the previous code. --- Makefile | 14 +++++++------- contrib/Makefile | 13 ++++++------- lang/Makefile | 16 ++++++++++++---- pkg/Makefile | 19 +++++++++---------- 4 files changed, 34 insertions(+), 28 deletions(-) diff --git a/Makefile b/Makefile index ce74b3d80..93a6a974b 100644 --- a/Makefile +++ b/Makefile @@ -14,16 +14,16 @@ umount: force /sbin/umount -f ":${.CURDIR}/src" install: force - # move all sources to their destination - @mkdir -p ${DESTDIR}/usr/local - @cp -r ${.CURDIR}/src/* ${DESTDIR}/usr/local - # invoke pkg(8) bootstraping @make -C ${.CURDIR}/pkg install - # invoke translation glue @make -C ${.CURDIR}/lang install - # invoke third-party tools @make -C ${.CURDIR}/contrib install - # finally pretty-print a list of files present + @mkdir -p ${DESTDIR}/usr/local + @cp -vr ${.CURDIR}/src/* ${DESTDIR}/usr/local + +plist: force + @make -C ${.CURDIR}/pkg plist + @make -C ${.CURDIR}/lang plist + @make -C ${.CURDIR}/contrib plist @(cd ${.CURDIR}/src; find * -type f) | while read FILE; do \ if [ $${FILE%%.sample} != $${FILE} ]; then \ echo "@sample /usr/local/$${FILE}"; \ diff --git a/contrib/Makefile b/contrib/Makefile index 57a5f3da6..0db5ba2f2 100644 --- a/contrib/Makefile +++ b/contrib/Makefile @@ -1,17 +1,16 @@ all: install: - # bootstrap needed root directories @mkdir -p ${DESTDIR}/usr/local/share - # openvpn client exporter files - @cp -r ${.CURDIR}/openvpn ${DESTDIR}/usr/local/share/ + @cp -vr ${.CURDIR}/openvpn ${DESTDIR}/usr/local/share/ + @cp -vr ${.CURDIR}/mobile-broadband-provider-info \ + ${DESTDIR}/usr/local/share/ + +plist: @(cd ${.CURDIR}/openvpn; find * -type f) | \ xargs -n1 printf "/usr/local/share/openvpn/%s\n" - # mobile broadband provider database - @cp -r ${.CURDIR}/mobile-broadband-provider-info \ - ${DESTDIR}/usr/local/share/ @(cd ${.CURDIR}/mobile-broadband-provider-info; find * -type f) | \ xargs -n1 printf \ "/usr/local/share/mobile-broadband-provider-info/%s\n" -.PHONY: install +.PHONY: install plist diff --git a/lang/Makefile b/lang/Makefile index dd04faf7e..e7f72d4ed 100644 --- a/lang/Makefile +++ b/lang/Makefile @@ -7,13 +7,20 @@ LOCALEDIR= /usr/local/share/locale/%%LANG%%/LC_MESSAGES LANGUAGES= de_DE es_CO ja_JP zh_CN TEMPLATE= en_US +INSTALL= +PLIST= .for LANG in ${LANGUAGES} ${LANG}DIR= ${LOCALEDIR:S/%%LANG%%/${LANG}/g} -${LANG}: +install-${LANG}: @mkdir -p ${DESTDIR}${${LANG}DIR} - @${MSGFMT} -o ${DESTDIR}${${LANG}DIR}/OPNsense.mo ${LANG}.po + ${MSGFMT} -o ${DESTDIR}${${LANG}DIR}/OPNsense.mo ${LANG}.po + +plist-${LANG}: @echo ${${LANG}DIR}/OPNsense.mo + +INSTALL+= install-${LANG} +PLIST+= plist-${LANG} .endfor ${TEMPLATE}: @@ -21,10 +28,11 @@ ${TEMPLATE}: cd ${.CURDIR}/.. && find src lang/dynamic/helpers | \ xargs ${XGETTEXT} -j -o ${.CURDIR}/${TEMPLATE}.pot -install: ${LANGUAGES} template: ${TEMPLATE} +install: ${INSTALL} +plist: ${PLIST} dynamic: @${.CURDIR}/dynamic/collect.py ${.CURDIR}/.. -.PHONY: ${LANGUAGES} ${TEMPLATE} dynamic +.PHONY: ${INSTALL} ${PLIST} ${TEMPLATE} dynamic diff --git a/pkg/Makefile b/pkg/Makefile index ecd2185f4..315d21578 100644 --- a/pkg/Makefile +++ b/pkg/Makefile @@ -1,19 +1,18 @@ all: install: - # main pkg(8) glue - @cp ${.CURDIR}/+PRE_DEINSTALL ${DESTDIR} - @cp ${.CURDIR}/+POST_INSTALL ${DESTDIR} - @cp ${.CURDIR}/+MANIFEST ${DESTDIR} - # create needed root direction + @mkdir -p ${DESTDIR} + @cp -v ${.CURDIR}/+PRE_DEINSTALL ${DESTDIR} + @cp -v ${.CURDIR}/+POST_INSTALL ${DESTDIR} + @cp -v ${.CURDIR}/+MANIFEST ${DESTDIR} @mkdir -p ${DESTDIR}/usr/local/etc/pkg - # available repository configurations - @cp -r ${.CURDIR}/repos ${DESTDIR}/usr/local/etc/pkg/ + @cp -vr ${.CURDIR}/repos ${DESTDIR}/usr/local/etc/pkg/ + @cp -vr ${.CURDIR}/fingerprints ${DESTDIR}/usr/local/etc/pkg/ + +plist: @(cd ${.CURDIR}/repos; find * -type f) | \ xargs -n1 printf "/usr/local/etc/pkg/repos/%s\n" - # available vendor fingerprints - @cp -r ${.CURDIR}/fingerprints ${DESTDIR}/usr/local/etc/pkg/ @(cd ${.CURDIR}/fingerprints; find * -type f) | \ xargs -n1 printf "/usr/local/etc/pkg/fingerprints/%s\n" -.PHONY: install +.PHONY: install plist