Commit graph jw-pkg/make/Makefile
Author SHA1 Message Date
d90c0ebf18
cache.mk: Include from topdir.mk, not make.mk
During a topdir "make all", caching variables is currently not the
first thing that happens. Instead, variables are cached as soon as a
project recurses into the make subdirectory. That was necessary,
because some makefiles were regenerated in the make subdirectory by
autoconf, potentially contributing variables that needed to be
cached.

As of now, autoconf is long gone and this is no longer true. And for
some variables, the two step process becomes involved, notably for
PYTHONPATH, which coding agents would like to look at from the topdir
very early on.

This commit moves the .project-cache.mk creation to topdir.mk, and
.projects-cache.mk creation to jw-pkg/Makefile to address that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-22 14:38:24 +02:00
3833fb0988
cache-projects.mk: Remove unused ifndef / endif
make/Makefile is responsible to generate $(TOPDIR)/cache-projects.mk.
The variables are taken from .cache-project.mk, with some variables
intentionally omitted, but their ifndef / endif blocks remain in
place. Not harmful but ugly. Make sed range-delete the left-over
blocks entirely.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-17 20:16:12 +02:00
741a3b6db2 make: Install cache-projects.mk
.cache-projects.mk is not installed / packaged, which makes builds
against an installed jw-pkg considerably slower. Change that, at the
risk of making the installed jw-pkg-devel less versatile. This commit
installs a cache file cache-projects.mk, renamed from
.cache-projects.mk, because there's no justification for hiding an
installed makefile. At least I can't think of one.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-01 09:50:52 +01:00
f869b5aaca defs.mk: Define Q and use it in *.mk
Define Q ?= @, and replace @<command> in recipes by $(Q)<command>.
Meant to be overridden from the environment for debugging as in

  Q= make

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:58:23 +01:00
f05e1ee0e3 make/[Makefile|*.mk): Improve variable caching
This commit aims at improving speed by using better caching.

  - Makefile, cache.mk: Split .cache.mk up

    To allow caching of runtime path variables which are
    project-specific, split .cache.mk up in .cache-project.mk and
    .cache-projects.mk

  - ldlibpath.mk: Cache ldlibpath, exepath and pythonpath

    Place the output of $(call proj_query ldlibpath), $(call
    proj_query, exepath) and $(call proj_query pythonpath) in
    JW_PKG_LD_LIBRARY_PATH, JW_PKG_EXE_PATH, and JW_PKG_PYTHON_PATH
    respectively, and cache the variables in make/.project-cache.mk.

  - cache.mk: Use = instead of :=

    Recursively expanded variables are nearly as fast as := variables
    if the assigned value is a fixed string. And sometimes it's not,
    rightly so, because variables get assigned below, as with
    JW_PKG_XXX for instance.

  - cache.mk: Use $(TOPDIR) as variable values

    Replace absolute references to project's topdir by $(TOPDIR) with
    sed. As soon as the project queries produce absolute paths, they
    will be transformed into relative paths which allow the code base
    to be moved to a different location and still remain functional
    without a rebuild.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:17:23 +01:00
19d0397b34 make/Makefile: Remove cruft + CACHED_VARS
Remove unused code, and code which actually does something:
CACHED_VARS looks as if it's sufficently and more centrally defined
in make.mk, don't override that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:17:23 +01:00
b2d6e6f554 Everywhere: Rename MODDIR -> JWBDIR
Rename the omnipresent MODDIR variable to JWBDIR, since that's more to the
point.

Signed-off-by: Jan Lindemann <jan@janware.com>
2019-06-29 21:34:18 +00:00
e0486a936e make/Makefile, list-files.mk: Code beautification
Signed-off-by: Jan Lindemann <jan@janware.com>
2019-06-24 12:45:27 +00:00
aa85417a17 Everywhere: Purge spaces in text files
Signed-off-by: Jan Lindemann <jan@janware.com>
2019-03-06 12:38:20 +00:00
0eaef0c326 conf/jcs, make, tmpl/doxygen: Align equal signs in makefiles to column 30
Signed-off-by: Jan Lindemann <jan@janware.com>
2019-03-03 18:12:28 +00:00
857c7d2c6c make/Makefile, defs-dev.mk: Futher reduced calls to shell from Makefiles
Signed-off-by: Jan Lindemann <jan@janware.com>
2019-03-03 14:50:44 +00:00
bf9bb79246 make/Makefile, defs-cpp.mk, platform.mk: Generalize MinGW build machinery (a bit)
This commit takes the MinGW cross compilation further into the direction of
being a more general framework for cross compilation. Changed some variable
names that are too specialized, notably MinGW tool chain directories,
compilers, utilities.

Signed-off-by: Jan Lindemann <jan@janware.com>
2019-03-03 10:45:08 +00:00
9e245c986e make: Further improve build time
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

Signed-off-by: Jan Lindemann <jan@janware.com>
2019-02-28 13:22:12 +00:00
d684f198b2 make: Add dev-utils.mk for convenience targets
dev-utils.mk is meant to provide targets like install-to-system,
which will be invoked during development

Signed-off-by: Jan Lindemann <jan@janware.com>
2018-11-27 15:10:18 +00:00
01d16a397a make/Makefile: Replace echo-vars by grep-vars
echo-vars is already defined in defs.mk and uses make -p

Signed-off-by: Jan Lindemann <jan@janware.com>
2018-11-13 13:53:00 +00:00
c2acba3ed8 make/Makefile: Add target echo-vars
Signed-off-by: Jan Lindemann <jan@janware.com>
2018-10-23 17:39:30 +00:00
8cb94ae82d make: Remove deps.d and defs.d
Signed-off-by: Jan Lindemann <jan@janware.com>
2017-12-15 12:50:37 +00:00
Jan Lindemann
2939f8e3a8 Everywhere: Merge V_1_1_29_40_POST_ACCEPTANCE 2011-02-20 14:15:22 +00:00
Jan Lindemann
bc13615ac4 make/Makefile: Add installation of winres.rc.tmpl 2009-08-10 08:47:10 +00:00
Jan Lindemann
c38c60c67d make/Makefile: Add dirs.mk and SUBDIRS = deps.mk defs.mk 2009-07-11 14:00:35 +00:00
Jan Lindemann
2f2c60f614 Everywhere: Streamline TOPDIR
Make definition and usage of TOPDIR consistent with other projects
2006-08-16 14:53:49 +00:00
Jan Lindemann
4fd6a6d677 Everywhere: Rename ytools.mk to proj.mk
Replace ytools.mk by proj.mk for consistency reasons:
$(TOPDIR)/make/proj.mk should be the project-wide but project-private
makefile for projects.
2006-07-31 14:12:38 +00:00
Jan Lindemann
81de57cbd9 make: Clean up library dependencies
Clean up dependencies of version.ldscript, libdir.done in defs.mk and
rules.mk.
2005-05-07 16:44:31 +00:00
Jan Lindemann
d5da27eb91 $(TOPDIR), make: Make make_scm.sh work 2002-07-25 10:39:55 +00:00
Jan Lindemann
2c52cef605 bin, make, scripts, tmpl/tex: Add include $(MODDIR)/make/ytools.mk 2002-07-20 17:16:40 +00:00
Jan Lindemann
fbaa3fbd20 make: Add support for make.mk 2002-07-02 10:12:06 +00:00
Jan Lindemann
e343db7e83 $(TOPDIR), make, tmpl/tex: Kick out TOPDIR definition 2002-05-15 18:43:55 +00:00
Jan Lindemann
cd2c306260 make, scripts, tmpl/tex: Add "TOPDIR" entry 2001-07-26 13:32:08 +00:00
Jan Lindemann
46c67d77fc $(TOPDIR), make: Initial commit
After making most modules independent from the Hamlet tree, place
Makefiles in a central location for more centralized control over the
build process.
2001-07-06 13:12:14 +00:00