build(striker-ui): break down build process to enable proper cleaning

main
Tsu-ba-me 4 years ago
parent 281e9f850d
commit 16e6fdfdd0
  1. 30
      striker-ui/Makefile.am

@ -18,9 +18,18 @@ EXTRA_DIST = $(nextoutdir)
# This target is for maintainers only; do not execute during CI/CD. # This target is for maintainers only; do not execute during CI/CD.
# #
out: $(nodemodulesdir):
-@echo "Install node modules (dependencies) prior to building." -@echo "Install node modules (dependencies) prior to building."
npm install --no-package-lock --ignore-scripts npm install --no-package-lock --ignore-scripts
# This target is for maintainers only; do not execute during CI/CD.
#
# Note: this target must **not** be renamed to the same name as the build
# output directory because it will trigger a build during the `make` implicit
# call.
#
.PHONY: build
build: clean $(nodemodulesdir)
-@echo "Build web UI." -@echo "Build web UI."
npm run build npm run build
-@echo "Stage only the build output directory." -@echo "Stage only the build output directory."
@ -28,6 +37,15 @@ out:
-@echo "Commit the build output." -@echo "Commit the build output."
git commit -m "chore: rebuild web UI" git commit -m "chore: rebuild web UI"
# This target is for maintainers only; do not execute during CI/CD.
#
# Note: this target is strictly used in case of rebuilding; use
# maintainer-clean instead to restore the repo to a clean state.
.PHONY: clean
clean:
-@echo "Clean up build output files to prepare for rebuild."
rm -rf $(nextoutdir) $(nextbuilddir)
install-data-hook: install-data-hook:
-@echo "Place build output files." -@echo "Place build output files."
cp -r $(nextoutdir)/$(outindexfile) $(nextoutdir)/$(outjsmodulesdir) $(DESTDIR)/$(htmldir)/ cp -r $(nextoutdir)/$(outindexfile) $(nextoutdir)/$(outjsmodulesdir) $(DESTDIR)/$(htmldir)/
@ -38,12 +56,8 @@ uninstall-hook:
-@echo "Remove all installed files of the current module." -@echo "Remove all installed files of the current module."
(cd $(DESTDIR)/$(htmldir); rm -rf $(outindexfile) $(outjsmodulesdir) $(outimagesdir)) (cd $(DESTDIR)/$(htmldir); rm -rf $(outindexfile) $(outjsmodulesdir) $(outimagesdir))
clean-local: maintainer-clean-local: clean
-@echo "Clean up build output files."
rm -rf $(nextoutdir) $(nextbuilddir)
distclean-local: clean-local
maintainer-clean-local: clean-local
-@echo "Clean up node modules." -@echo "Clean up node modules."
rm -rf $(nodemodulesdir) rm -rf $(nodemodulesdir)
-@echo "Since the build output directory is removed, restore it to keep local repo clean."
git restore $(nextoutdir)

Loading…
Cancel
Save