From f1bb77563c221666c88c3a62b2c648293c85a1b9 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Fri, 30 Oct 2020 14:17:08 +0100 Subject: [PATCH] buildsys: use separate makefiles Signed-off-by: Thomas Lamprecht --- Makefile | 15 ++++++++++----- js/Makefile | 23 +++++++---------------- js/mobile/Makefile | 17 +++++++++++++++++ 3 files changed, 34 insertions(+), 21 deletions(-) create mode 100644 js/mobile/Makefile diff --git a/Makefile b/Makefile index 2cf4b71..1f54c32 100644 --- a/Makefile +++ b/Makefile @@ -28,13 +28,13 @@ deb ${DEB}: cd build; dpkg-buildpackage -b -us -uc lintian ${DEB} -.PHONY: js/pmgmanagerlib.js js/pmgmanagerlib-mobile.js +.PHONY: js/pmgmanagerlib.js js/mobile/pmgmanagerlib-mobile.js js/pmgmanagerlib.js: make -C js pmgmanagerlib.js -js/pmgmanagerlib-mobile.js: - make -C js pmgmanagerlib-mobile.js +js/mobile/pmgmanagerlib-mobile.js: + make -C js/mobile pmgmanagerlib-mobile.js -install: pmg-index.html.tt pmg-mobile-index.html.tt js/pmgmanagerlib.js js/pmgmanagerlib-mobile.js ${IMAGES} ${CSSFILES} +install: pmg-index.html.tt pmg-mobile-index.html.tt js/pmgmanagerlib.js js/mobile/pmgmanagerlib-mobile.js ${IMAGES} ${CSSFILES} install -d -m 755 ${WWWBASEDIR} install -d -m 755 ${WWWCSSDIR} install -d -m 755 ${WWWIMAGESDIR} @@ -42,7 +42,7 @@ install: pmg-index.html.tt pmg-mobile-index.html.tt js/pmgmanagerlib.js js/pmgma install -m 0644 pmg-index.html.tt ${WWWBASEDIR} install -m 0644 pmg-mobile-index.html.tt ${WWWBASEDIR} install -m 0644 js/pmgmanagerlib.js ${WWWJSDIR} - install -m 0644 js/pmgmanagerlib-mobile.js ${WWWJSDIR} + install -m 0644 js/mobile/pmgmanagerlib-mobile.js ${WWWJSDIR} for f in ${IMAGES}; do install -m 0644 "$$f" ${WWWIMAGESDIR}; done for f in ${CSSFILES}; do install -m 0644 "$$f" ${WWWCSSDIR}; done @@ -53,6 +53,11 @@ upload: ${DEB} distclean: clean rm -f examples/simple-demo.pem +.PHONY: lint +lint: + $(MAKE) -C js/ lint + #$(MAKE) -C js/mobile lint + clean: make -C js clean rm -rf ./build *.deb *.changes *.buildinfo diff --git a/js/Makefile b/js/Makefile index badf7ab..05268ae 100644 --- a/js/Makefile +++ b/js/Makefile @@ -89,37 +89,28 @@ JSSRC= \ SpamContextMenu.js \ Application.js -# caution: order is important -MOBILESRC= \ - mobile/component.js \ - mobile/loginscreen.js \ - mobile/mailview.js \ - mobile/quarantineview.js \ - mobile/utils.js \ - mobile/app.js \ - OnlineHelpInfo.js: /usr/bin/asciidoc-pmg /usr/bin/asciidoc-pmg scan-extjs ${JSSRC} >$@.tmp mv $@.tmp $@ lint: ${JSSRC} - eslint ${JSSRC} + eslint $? + +lint-all: ${JSSRC} + eslint $^ pmgmanagerlib.js: OnlineHelpInfo.js ${JSSRC} echo "// ${DEB_VERSION_UPSTREAM_REVISION}" > $@.tmp cat OnlineHelpInfo.js ${JSSRC} >> $@.tmp mv $@.tmp $@ -pmgmanagerlib-mobile.js: ${MOBILESRC} - cat ${MOBILESRC} >$@.tmp - mv $@.tmp $@ - -all: pmgmanagerlib.js pmgmanagerlib-mobile.js +all: pmgmanagerlib.js .PHONY: clean clean: + $(MAKE) -C mobile clean find . -name '*~' -exec rm {} ';' - rm -rf pmgmanagerlib.js pmgmanagerlib-mobile.js OnlineHelpInfo.js + rm -rf pmgmanagerlib.js pmgmanagerlib.js.tmp OnlineHelpInfo.js diff --git a/js/mobile/Makefile b/js/mobile/Makefile new file mode 100644 index 0000000..862dffe --- /dev/null +++ b/js/mobile/Makefile @@ -0,0 +1,17 @@ + +# caution: order is important +MOBILESRC= \ + component.js \ + loginscreen.js \ + mailview.js \ + quarantineview.js \ + utils.js \ + app.js \ + +pmgmanagerlib-mobile.js: ${MOBILESRC} + cat $^ >$@.tmp + mv $@.tmp $@ + +.PHONY: clean +clean: + rm -rf pmgmanagerlib-mobile.js pmgmanagerlib-mobile.js.tmp