From 89739a6c910461a3cac3abc1bf2ff162c7c5bc82 Mon Sep 17 00:00:00 2001 From: Petr Spacek Date: Nov 29 2016 14:28:24 +0000 Subject: Build: properly integrate loader.js into build system AC_CONFIG_FILES in configure.ac works well only with Makefiles. Other files have to be handled by Makefile.am so depedencies are tracked properly. https://fedorahosted.org/freeipa/ticket/6498 Reviewed-By: Martin Basti --- diff --git a/Makefile.am b/Makefile.am index c2826ae..ad0ccd3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -158,11 +158,15 @@ pylint: PYTHONPATH=$(top_srcdir) $(PYLINT) \ --rcfile=$(top_srcdir)/pylintrc $${FILES} -.PHONY: jslint jslint-ui jslint-ui-test jslint-html +.PHONY: jslint jslint-ui jslint-ui-test jslint-html \ + $(top_builddir)/install/ui/src/libs/loader.js jslint: jslint-ui jslint-ui-test jslint-html +$(top_builddir)/install/ui/src/libs/loader.js: + (cd $(top_builddir)/install/ui/src/libs && make loader.js) + # create temporary symlinks to allow jslint to find libs/loader.js -jslint-ui: +jslint-ui: $(top_builddir)/install/ui/src/libs/loader.js cd $(top_srcdir)/install/ui; \ $(MKDIR_P) js; \ rm -f js/libs; \ diff --git a/configure.ac b/configure.ac index 9666997..2712452 100644 --- a/configure.ac +++ b/configure.ac @@ -525,7 +525,6 @@ AC_CONFIG_FILES([ install/ui/css/Makefile install/ui/src/Makefile install/ui/src/libs/Makefile - install/ui/src/libs/loader.js install/ui/images/Makefile install/ui/build/Makefile install/ui/build/dojo/Makefile diff --git a/install/ui/src/libs/Makefile.am b/install/ui/src/libs/Makefile.am index f5a9e0e..1ee201b 100644 --- a/install/ui/src/libs/Makefile.am +++ b/install/ui/src/libs/Makefile.am @@ -16,6 +16,15 @@ app_DATA = \ nodist_app_DATA = \ loader.js +dist_noinst_DATA = \ + loader.js.in + EXTRA_DIST = \ $(app_DATA) \ $(NULL) + +loader.js: loader.js.in $(top_builddir)/$(CONFIG_STATUS) + $(AM_V_GEN)sed \ + -e 's|@API_VERSION[@]|$(API_VERSION)|g' \ + -e 's|@NUM_VERSION[@]|$(NUM_VERSION)|g' \ + $< > $@