This commit tries to remove the necessity to call projects.py from $(TOPDIR) to speed up recursive builds over all projects yet again. This is a major undertaking. There are two variables which are filled py projects.py in $(TOPDIR): PREREQ and PREREQ_DIRS. Sadly, the latter is a path relative to $(TOPDIR)/make, so this is kind of pointless. Unless the cache is maintained in $(TOPDIR), a thing I tried to avoid. So this commit is only able to cache $(PREREQ), not $(PREREQ_DIRS), which still is a hassle. Introduced defs-dirs.mk for that, to make it accessible to make.mk, and modified all the other parts of the machinery, too.
This commit sees several improvements to the build performance:
- Introduce cache.mk, which creates makefiles caching often used variables, per tree and per project. - Define more variables with := enclosed in condistions, instead of defining them with ?=, because the RHS of ?= is expanded deferredly. - Add more definitions for executables. - Move some more specialized definitions out into specialized makefiles, notably htdocs.mk and tmpl.mk
C++ definitions are numerous, and they shouldn't pollute variable space and performance outside of directories containing C++ files. This commit pushes them into a defs-cpp.mk file.
Many external commands are called unnecessarily often, because either there's a GNU Make internal alternative, or because they are invoked from within a recursively defined variable. This patch adresses that and lessens make invocation time per directory by factor 3.
Order is now: $(LOCAL_CFLAGS) $(PROJECT_CFLAGS) $(COMPLILER_CFLAGS) which resulted in header files specified in $(LOCAL_CFLAGS) found after those of $(PROJECT_CFLAGS).
Still not optimal, as this way other general flags, e.g. optimization flags, override more specialized ones. Maybe use INCLUDES instead.
Add support for GNUmakefile, where originally only Makefile was supported. Not done everywhere, as some of the code involving makefiles is dead anyway.
This used to point to $(PREFIX). Changing it broke the build, as it expected the VERSION file below PREFIX. This should work now, as /usr/share/doc/packages was added to the search path of the VERSION file.
pkg.sh install-log now supports a -N option, meaning no-log-directories. This installs directories, but doesn't log then in the install log, effectively excluding them from being packaged. This is necessary for directories provided by other packages. -N can be activated by adding LOG_INSTALL_EXTRA_OPTS += -N to a Makefile, see changes in defs.mk.
pgk.sh install-log now also omits addition of %attr tags to symbolic links.
- Make LOCAL_HTML and INSTALL_HTMLDIR pre-definable via ?=
- Add *.cgi to LOCAL_HTML by default Don't know if that's a good move. Will be treated as regular HTML, and, hence installed without execute permission bit set.