Commit d921f828 authored by Franco Fichtner's avatar Franco Fichtner

make: `bootstrap' glue for translations

parent ee430b5a
...@@ -8,3 +8,4 @@ ...@@ -8,3 +8,4 @@
*.sass-cache *.sass-cache
*.volt.php *.volt.php
*.pyc *.pyc
*.mo
all: all:
mount: force:
mount: force
@${.CURDIR}/scripts/version.sh > \ @${.CURDIR}/scripts/version.sh > \
${.CURDIR}/src/opnsense/version/opnsense ${.CURDIR}/src/opnsense/version/opnsense
/sbin/mount_unionfs ${.CURDIR}/src /usr/local /sbin/mount_unionfs ${.CURDIR}/src /usr/local
umount: umount: force
/sbin/umount -f "<above>:${.CURDIR}/src" /sbin/umount -f "<above>:${.CURDIR}/src"
install: install: force
# invoke pkg(8) bootstraping # invoke pkg(8) bootstraping
@make -C ${.CURDIR}/pkg install @make -C ${.CURDIR}/pkg install
# move all sources to their destination # move all sources to their destination
...@@ -21,21 +23,21 @@ install: ...@@ -21,21 +23,21 @@ install:
@(cd ${.CURDIR}/src; find * -type f) | \ @(cd ${.CURDIR}/src; find * -type f) | \
xargs -n1 printf "/usr/local/%s\n" xargs -n1 printf "/usr/local/%s\n"
lint: lint: force
find ${.CURDIR}/src ! -name "*.xml" ! -name "*.eot" \ find ${.CURDIR}/src ! -name "*.xml" ! -name "*.eot" \
! -name "*.svg" ! -name "*.woff" ! -name "*.woff2" \ ! -name "*.svg" ! -name "*.woff" ! -name "*.woff2" \
! -name "*.otf" ! -name "*.png" ! -name "*.js" \ ! -name "*.otf" ! -name "*.png" ! -name "*.js" \
! -name "*.scss" ! -name "*.py" ! -name "*.ttf" \ ! -name "*.scss" ! -name "*.py" ! -name "*.ttf" \
! -name "*.tgz" -type f -print0 | xargs -0 -n1 php -l ! -name "*.tgz" -type f -print0 | xargs -0 -n1 php -l
sweep: sweep: force
find ${.CURDIR}/src ! -name "*.min.*" ! -name "*.svg" \ find ${.CURDIR}/src ! -name "*.min.*" ! -name "*.svg" \
! -name "*.map" -type f -print0 | \ ! -name "*.map" -type f -print0 | \
xargs -0 -n1 scripts/cleanfile xargs -0 -n1 scripts/cleanfile
find ${.CURDIR}/pkg -type f -print0 | \ find ${.CURDIR}/pkg -type f -print0 | \
xargs -0 -n1 scripts/cleanfile xargs -0 -n1 scripts/cleanfile
style: style: force
@(phpcs --tab-width=4 --standard=PSR2 ${.CURDIR}/src/opnsense/mvc \ @(phpcs --tab-width=4 --standard=PSR2 ${.CURDIR}/src/opnsense/mvc \
|| true) > ${.CURDIR}/.style.out || true) > ${.CURDIR}/.style.out
@echo -n "Total number of style warnings: " @echo -n "Total number of style warnings: "
...@@ -45,21 +47,36 @@ style: ...@@ -45,21 +47,36 @@ style:
@cat ${.CURDIR}/.style.out @cat ${.CURDIR}/.style.out
@rm ${.CURDIR}/.style.out @rm ${.CURDIR}/.style.out
setup: setup: force
${.CURDIR}/src/etc/rc.php_ini_setup ${.CURDIR}/src/etc/rc.php_ini_setup
health: health: force
# check test script output and advertise a failure... # check test script output and advertise a failure...
[ "`${.CURDIR}/src/etc/rc.php_test_run`" == "FCGI-PASSED PASSED" ] [ "`${.CURDIR}/src/etc/rc.php_test_run`" == "FCGI-PASSED PASSED" ]
OPNSENSE_POT= src/share/locale/en_US/LC_MESSAGES/OPNsense.pot # translation glue
XGETTEXT= xgettext -L PHP --from-code=UTF-8 -F --strict --debug
MSGFMT= msgfmt --strict
LOCALEDIR= ${.CURDIR}/src/share/locale
POT= ${LOCALEDIR}/en_US/LC_MESSAGES/OPNsense.pot
LANGS= ja
. for LANG in ${LANGS}
MO+= ${LOCALEDIR}/${LANG}/LC_MESSAGES/OPNsense.mo
. endfor
.SUFFIXES: .po .mo
.po.mo: force
@${MSGFMT} -o ${.TARGET} ${.IMPSRC}
@echo ${.TARGET:S/${LOCALEDIR}/\/usr\/local\/share\/locale/}
bootstrap: ${MO}
translate: translate: force
@: > ${.CURDIR}/${OPNSENSE_POT} @: > ${POT}
find src | xargs xgettext -j -L PHP --from-code=UTF-8 -F \ find src | xargs ${XGETTEXT} -j -o ${POT}
--strict --debug -o ${.CURDIR}/${OPNSENSE_POT}
clean: clean:
git reset --hard HEAD && git clean -xdqf . git reset --hard HEAD && git clean -xdqf .
.PHONY: mount umount install lint sweep style setup health clean .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