Commit f321cab7 authored by Franco Fichtner's avatar Franco Fichtner

Mk: refactor for EXTRA plist/install targets

Guess what's coming soon...  :)

(cherry picked from commit d4d6db27)
parent fceb84ca
all: all:
install: TREES_=${TREES}
.for TREE in ${TREES} ROOT_=${ROOT}
@mkdir -p ${DESTDIR}${ROOT}
@cp -vr ${TREE} ${DESTDIR}${ROOT} .for TARGET in _ ${EXTRA:C/.*/_&/g}
install${TARGET}: force
.for TREE in ${TREES${TARGET}}
@mkdir -p ${DESTDIR}${ROOT${TARGET}}
REALTARGET=/$$(dirname ${TREE}); \
cp -vr ${TREE} ${DESTDIR}${ROOT${TARGET}}$${REALTARGET}
@(cd ${TREE}; find * -type f) | while read FILE; do \ @(cd ${TREE}; find * -type f) | while read FILE; do \
if [ $${FILE%%.in} != $${FILE} ]; then \ if [ $${FILE%%.in} != $${FILE} ]; then \
sed -i '' \ sed -i '' \
-e "s=%%CORE_PACKAGESITE%%=${CORE_PACKAGESITE}=g" \ -e "s=%%CORE_PACKAGESITE%%=${CORE_PACKAGESITE}=g" \
-e "s=%%CORE_REPOSITORY%%=${CORE_REPOSITORY}=g" \ -e "s=%%CORE_REPOSITORY%%=${CORE_REPOSITORY}=g" \
${DESTDIR}${ROOT}/${TREE}/$${FILE}; \ ${DESTDIR}${ROOT${TARGET}}/${TREE}/$${FILE}; \
mv -v ${DESTDIR}${ROOT}/${TREE}/$${FILE} \ mv -v ${DESTDIR}${ROOT${TARGET}}/${TREE}/$${FILE} \
${DESTDIR}${ROOT}/${TREE}/$${FILE%%.in}; \ ${DESTDIR}${ROOT${TARGET}}/${TREE}/$${FILE%%.in}; \
fi \ fi \
done done
.endfor .endfor
plist: plist${TARGET}: force
.for TREE in ${TREES} .for TREE in ${TREES${TARGET}}
@(cd ${TREE}; find * -type f) | while read FILE; do \ @(cd ${TREE}; find * -type f) | while read FILE; do \
FILE="$${FILE%%.in}"; PREFIX=""; \ FILE="$${FILE%%.in}"; PREFIX=""; \
if [ $${FILE%%.sample} != $${FILE} ]; then \ if [ $${FILE%%.sample} != $${FILE} ]; then \
PREFIX="@sample "; \ PREFIX="@sample "; \
fi; \ fi; \
echo "$${PREFIX}${ROOT}/${TREE}/$${FILE}"; \ echo "$${PREFIX}${ROOT${TARGET}}/${TREE}/$${FILE}"; \
done done
.endfor .endfor
.PHONY: install plist .endfor
install: install_
plist: plist_
force:
.PHONY: force
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment