Commit graph

44 commits

Author SHA1 Message Date
c893584e5e make: Replace RPM -> PKG
jw-pkg supports more than RPM-based package managers, but for
historic reasons, lots of its Makefile variables still have "RPM" in
their names. This is misleading. Replace "RPM" in variable names by
the more generic "PKG" where appropriate.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-16 14:57:50 +01:00
3457daa0fb platform.mk: Add HOST_DISTRO_INFO
HOST_TUPLE is bastardized to contain more info that just the GNU
Triplet. Add HOST_DISTRO_INFO to do the caching job, and leave
HOST_TUPLE alone.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-03 05:32:47 +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
31537a0bd6 build.cmds.CmdCreatePkgConfig: Add module
Implement the functionality of create-pkg-config.sh in a Python
module CmdCreatePkgConfig.py. This allows to remove
create-pkg-config.sh and jw-build-functions.sh.

Note that the translation was done pretty literally to play it safe.
More code can and should be removed by taking advantage of the fact
that jw-projects.py knows more about the project than the shell
scripts.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-16 17:31:16 +01:00
6c2fa903c7 Fix: Don't set CC, LD, CXX via ?=
CC, LD and CXX are builtin, and they also override ?=, so ?= is pointless.

This solution disallows specifying a compiler from the environment. There
should be some solution with $(origin CC), but this seems too clunky for now.

Signed-off-by: Jan Lindemann <jan@janware.com>
2019-07-01 15:48:28 +00:00
bdd66dbc26 Everywhere: Rename MOD_SCRIPT_DIR -> JWB_SCRIPT_DIR
Follow name change of MODDIR -> JWBDIR.

Signed-off-by: Jan Lindemann <jan@janware.com>
2019-06-29 21:45:24 +00: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
c480eeaaca defs.mk, make.mk: Add CREATE_PKG_CONFIG variable
It was possible for DEVEL_TARGETS to contain install_PKG_CONFIG without a
package config file being built, fixed that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2019-06-03 09:06:41 +00:00
58ab619f0b make: Rename CFLAGS, CXXFLAGS and CPPFLAGS variables
Rename CFLAGS and friends to follow the conventions of the implicit rules
defined by GNU Make:

 - $(CPPFLAGS) is passed to both C++ and C compiler
 - $(CXXFLAGS) is passed to C++ compiler only
 - $(CFLAGS) is passed to C compiler only
 - C++ compiler is in $(CXX)

Signed-off-by: Jan Lindemann <jan@janware.com>
2019-03-19 07:07:00 +00:00
dcba7d68bd make.mk: Minor code beautification
Signed-off-by: Jan Lindemann <jan@janware.com>
2019-03-18 19:14:55 +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
e3142c9624 dev-utils.mk: Add target indent-makefiles
Signed-off-by: Jan Lindemann <jan@janware.com>
2019-03-03 16:13:24 +00:00
f9d398d219 make: Fix MinGW build machinery machinery
This commit makes it possible to successfully run "make all" against ytools'
again, with TARGET_TUPLE set to i686-ms-w64-mingw. Lots of minor and major
tweaks here and there.

The biggest diff is a move of the architecture-related definitions into
platform.mk. The are needed pretty early on, so that seems reasonable.

Making this work again is part of the larger effort to support cross
buildchains in a more concise way, i.e. without so many if ($(TARGET),mingw))
all over the place. TARGET's relevance should dwindle, until it's finally taken
over by the TARGET_XXX variables extracted from TARGET_TUPLE or TARGET_TRIPLET.

Signed-off-by: Jan Lindemann <jan@janware.com>
2019-03-02 17:21:48 +00:00
8bb94c6f57 defs.mk / defs-cpp.mk: Some reordering of variables
Reordered some variables in defs.mk and defs-cpp.mk for clarity. Most notably
FULL_NAME was moved back into defs.mk, which amounts to a bugfix.

Signed-off-by: Jan Lindemann <jan@janware.com>
2019-03-01 11:03:23 +00:00
f40356cf59 make/*.mk: More performance tweaks
Signed-off-by: Jan Lindemann <jan@janware.com>
2019-02-28 16:12:58 +00:00
3dd55cf067 Further improve build time: Try to avoid calling projects.py
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.

Signed-off-by: Jan Lindemann <jan@janware.com>
2019-02-28 14:48:57 +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
f5c43f706a make: Replace some executables by absolute paths to improve performance
Signed-off-by: Jan Lindemann <jan@janware.com>
2017-09-02 19:26:52 +00:00
92040c66e7 make, scripts: Preserve modification time on installation
Implemented -p switch on pkg.sh log-install and used it on standard
installation rules.

Signed-off-by: Jan Lindemann <jan@janware.com>
2017-08-31 19:40:39 +00:00
a8bf726a17 projs-dir.mk: Make targets "all" and "install" work
Signed-off-by: Jan Lindemann <jan@janware.com>
2016-02-23 21:33:10 +00:00
651cbaf511 defs.mk, make.mk, rpmdist.mk: Fix various package build errors
Signed-off-by: Jan Lindemann <jan@janware.com>
2016-02-01 22:59:23 +00:00
37130aa077 defs.mk, make.mk: Fix many package build errors
Signed-off-by: Jan Lindemann <jan@janware.com>
2016-02-01 15:05:22 +00:00
cb76384cf4 make.mk: Install make/project.conf during project installation
Signed-off-by: Jan Lindemann <jan@janware.com>
2016-01-29 12:22:37 +00:00
b4cd247e79 make.mk: Add -l\$(LIBNAME) to package-config file
Signed-off-by: Jan Lindemann <jan@janware.com>
2016-01-28 12:38:34 +00:00
8597e3b87d defs.mk, make.mk: Fix package config installation from installed ytools
Signed-off-by: Jan Lindemann <jan@janware.com>
2016-01-27 12:58:49 +00:00
118c01e1ba defs-dist.mk, defs.mk, make.mk: Some more fixes to build system
Signed-off-by: Jan Lindemann <jan@janware.com>
2016-01-26 14:43:53 +00:00
6398de69b4 defs.mk, make.mk, create-pkg-config.sh: Add requires to pkg-config creation
Signed-off-by: Jan Lindemann <jan@janware.com>
2016-01-24 16:36:11 +00:00
342ec62622 defs.mk, make.mk, create-pkg-config.sh: Some additions to package-config creation
Signed-off-by: Jan Lindemann <jan@janware.com>
2016-01-24 16:19:02 +00:00
38712ed260 make, scripts: Some additions to package-config creation
Signed-off-by: Jan Lindemann <jan@janware.com>
2016-01-24 16:05:55 +00:00
e26fbeb0f7 make, scripts: Integrate pkg-config into build
First attempt on integrating pkg-config in package build process.

Signed-off-by: Jan Lindemann <jan@janware.com>
2016-01-23 11:19:43 +00:00
720db284d3 make.mk: Fix build breakage while creating pkg-config
Fix modules build after adding creation of pkg-config files.

Signed-off-by: Jan Lindemann <jan@janware.com>
2016-01-22 17:57:37 +00:00
8b18b21fca make.mk: Create stub package-config files
Signed-off-by: Jan Lindemann <jan@janware.com>
2016-01-22 17:35:16 +00:00
Jan Lindemann
dd01b3a470 make.mk: Remove disfunctinal install_PKG_CONFIG and build_PKG_CONFIG
build_PKG_CONFIG kills rpmbuild:

    mkdir -p /opt/ytools/pkgconfig
    mkdir: can't create directory /opt/ytools/pkgconfig: Permission denied
    make[5]: *** [../dir_build_PKG_CONFIG.done] Error 1
    make[5]: Leaving directory `/usr/src/packages/BUILD/wt-jannet-0.0.1-16/make'

Remove install_PKG_CONFIG and build_PKG_CONFIG to fix that.
2012-04-30 08:02:32 +00:00
Jan Lindemann
05be1d8ead make: Add support for installation file type PKG_CONFIG 2012-04-28 16:01:18 +00:00
Jan Lindemann
2939f8e3a8 Everywhere: Merge V_1_1_29_40_POST_ACCEPTANCE 2011-02-20 14:15:22 +00:00
Jan Lindemann
c6b77990c7 bin.mk, make.mk, scripts-targets.mk: O added target test 2010-12-03 18:03:00 +00:00
Jan Lindemann
8ab2d6dcc8 make.mk: Fix deps.d and defs.d support
- Create directories leading up to deps.d/<project>.mk
  - Add missing rule for defs.d
2009-07-14 00:39:56 +00:00
Jan Lindemann
10d567d0e2 make.mk: Prepended forgotten ENV_PREFIX to INSTALL_PCKG_DEPS_DIR 2009-07-12 18:50:59 +00:00
Jan Lindemann
58c9cd7199 make.mk: Fix INSTALL_PCKG_DE[F|P]S_DIR 2009-07-12 11:49:29 +00:00
Jan Lindemann
2a4a953097 make.mk: Add support for installing pckg-deps.mk and pckg-defs.mk 2009-07-11 14:00:39 +00:00
Jan Lindemann
02c521128e make.mk: Standardized 2007-08-21 18:34:31 +00:00
Jan Lindemann
fbaa3fbd20 make: Add support for make.mk 2002-07-02 10:12:06 +00:00