Makefile 1.94 KB
Newer Older
1 2 3
all:

mount:
4
	/sbin/mount_unionfs ${.CURDIR}/src /usr/local
5 6

umount:
7
	/sbin/umount -f "<above>:${.CURDIR}/src"
8 9

install:
10
	# hardcode package meta files to catch mishaps
11
	@cp ${.CURDIR}/pkg/+PRE_DEINSTALL ${DESTDIR}
12 13 14 15
	@cp ${.CURDIR}/pkg/+POST_INSTALL ${DESTDIR}
	@cp ${.CURDIR}/pkg/+MANIFEST ${DESTDIR}
	# move all sources to their destination and...
	@mkdir -p ${DESTDIR}/usr/local
16
	@cp -r ${.CURDIR}/src/* ${DESTDIR}/usr/local
17 18 19 20 21 22
	# bootstrap pkg(8) files that are not in sources
	@mkdir -p ${DESTDIR}/usr/local/etc/pkg/repos
	@cp ${.CURDIR}/pkg/OPNsense.conf ${DESTDIR}/usr/local/etc/pkg/repos
	@echo /usr/local/etc/pkg/repos/OPNsense.conf
	@cp ${.CURDIR}/pkg/pkg.conf ${DESTDIR}/usr/local/etc
	@echo /usr/local/etc/pkg.conf
23
	# ... pretty-print a list of files present
24 25
	@(cd ${.CURDIR}/src; find * -type f) | \
	    xargs -n1 printf "/usr/local/%s\n"
26 27

lint:
28 29 30
	find ${.CURDIR}/src ! -name "*.xml" ! -name "*.eot" \
	    ! -name "*.svg" ! -name "*.woff" ! -name "*.woff2" \
	    ! -name "*.otf" ! -name "*.png" ! -name "*.js" \
31 32
	    ! -name "*.scss" ! -name "*.py" ! -name "*.ttf" \
	    -type f -print0 | xargs -0 -n1 php -l
33 34

sweep:
35
	find ${.CURDIR}/src ! -name "*.min.*" ! -name "*.svg" \
36 37
	    ! -name "*.map" -type f -print0 | \
	    xargs -0 -n1 scripts/cleanfile
38 39
	find ${.CURDIR}/pkg -type f -print0 | \
	    xargs -0 -n1 scripts/cleanfile
40

41
style:
42
	@(phpcs --tab-width=4 --standard=PSR2 ${.CURDIR}/src/opnsense/mvc \
43 44 45 46 47 48 49 50
	    || true) > ${.CURDIR}/.style.out
	@echo -n "Total number of style warnings: "
	@grep '| WARNING' ${.CURDIR}/.style.out | wc -l
	@echo -n "Total number of style errors:   "
	@grep '| ERROR' ${.CURDIR}/.style.out | wc -l
	@cat ${.CURDIR}/.style.out
	@rm ${.CURDIR}/.style.out

51
setup:
52
	${.CURDIR}/src/etc/rc.php_ini_setup
53

54 55 56 57
health:
	# check test script output and advertise a failure...
	[ "`${.CURDIR}/src/etc/rc.php_test_run`" == "FCGI-PASSED PASSED" ]

58 59 60
clean:
	git reset --hard HEAD && git clean -xdqf .

61
.PHONY: mount umount install lint sweep style setup clean