2002-07-02 10:12:06 +00:00
|
|
|
# generic utility modules
|
|
|
|
|
# (c) 2001 jannet it services
|
|
|
|
|
# contact@jannet.de
|
|
|
|
|
# $Id$
|
|
|
|
|
|
2019-06-29 21:34:18 +00:00
|
|
|
include $(JWBDIR)/make/defs.mk
|
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-22 14:12:58 +01:00
|
|
|
include $(JWBDIR)/make/ldlibpath.mk
|
2019-06-29 21:34:18 +00:00
|
|
|
include $(JWBDIR)/make/defs-dirs.mk
|
|
|
|
|
include $(JWBDIR)/make/dev-utils.mk
|
2016-02-01 22:59:23 +00:00
|
|
|
|
2019-03-03 18:12:28 +00:00
|
|
|
CACHED_FILES ?= $(VERSION_FILE) $(wildcard $(TOPDIR)/make/project.conf)
|
2019-07-01 15:48:28 +00:00
|
|
|
CACHED_VARS ?= PROJECT PREREQ VERSION HEX_VERSION FULL_NAME \
|
|
|
|
|
WHICH PYTHON ECHO TEST BROWSER SED RM PWD ID CUT TR \
|
|
|
|
|
AWK GETENT XARGS FIND PRINTF HOST_TUPLE OS_NAME_VERSION \
|
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-22 14:12:58 +01:00
|
|
|
OS_NAME CAT BIN_INSTALL SUDO \
|
|
|
|
|
JW_PKG_LD_LIBRARY_PATH JW_PKG_EXE_PATH JW_PKG_PYTHON_PATH
|
2019-02-28 13:22:12 +00:00
|
|
|
|
2019-06-29 21:34:18 +00:00
|
|
|
include $(JWBDIR)/make/cache.mk
|
2019-02-28 13:22:12 +00:00
|
|
|
|
2016-02-01 22:59:23 +00:00
|
|
|
ifneq ($(CREATE_DEVEL),false)
|
2019-03-19 07:07:00 +00:00
|
|
|
MKFILES += $(wildcard project.conf)
|
2019-06-03 09:06:41 +00:00
|
|
|
DEVEL_TARGETS += install_MAKE $(INSTALLED_PKG_MK)
|
|
|
|
|
ifeq ($(CREATE_PKG_CONFIG),true)
|
|
|
|
|
DEVEL_TARGETS += install_PKG_CONFIG
|
|
|
|
|
endif
|
2016-02-01 22:59:23 +00:00
|
|
|
endif
|
|
|
|
|
|
2019-06-29 21:34:18 +00:00
|
|
|
include $(JWBDIR)/make/rules.mk
|
2007-08-21 18:34:31 +00:00
|
|
|
|
2019-06-29 21:34:18 +00:00
|
|
|
INSTALL_PCKG_DEPS_DIR = $(ENV_PREFIX)$(JWBDIR)/make/deps.d
|
2009-07-11 14:00:39 +00:00
|
|
|
ifneq ($(wildcard pckg-deps.mk),)
|
2019-03-19 07:07:00 +00:00
|
|
|
INSTALLED_PKG_MK += $(INSTALL_PCKG_DEPS_DIR)/$(PROJECT).mk
|
2009-07-11 14:00:39 +00:00
|
|
|
endif
|
|
|
|
|
|
2019-06-29 21:34:18 +00:00
|
|
|
INSTALL_PCKG_DEFS_DIR = $(JWBDIR)/make/defs.d
|
2009-07-11 14:00:39 +00:00
|
|
|
ifneq ($(wildcard pckg-defs.mk),)
|
2019-03-19 07:07:00 +00:00
|
|
|
INSTALLED_PKG_MK += $(INSTALL_PCKG_DEFS_DIR)/$(PROJECT).mk
|
2009-07-11 14:00:39 +00:00
|
|
|
endif
|
|
|
|
|
|
2019-06-03 09:06:41 +00:00
|
|
|
ifeq ($(CREATE_PKG_CONFIG),true)
|
2016-01-27 12:58:49 +00:00
|
|
|
all: build_PKG_CONFIG
|
2019-03-02 17:21:48 +00:00
|
|
|
endif
|
2016-02-01 22:59:23 +00:00
|
|
|
install: $(DEVEL_TARGETS)
|
2016-01-22 17:35:16 +00:00
|
|
|
clean: textclean localclean doneclean clean.pkg-config
|
2010-12-03 18:03:00 +00:00
|
|
|
test:
|
2009-07-11 14:00:39 +00:00
|
|
|
|
|
|
|
|
$(INSTALL_PCKG_DEPS_DIR)/$(PROJECT).mk: pckg-deps.mk
|
2009-07-14 00:39:56 +00:00
|
|
|
mkdir -p $(dir $@)
|
2017-08-31 19:40:39 +00:00
|
|
|
$(INSTALL) -p -m $(MAKEMODE) -o $(MAKEOWNER) -g $(MAKEGROUP) $< $@
|
2009-07-14 00:39:56 +00:00
|
|
|
|
|
|
|
|
$(INSTALL_PCKG_DEFS_DIR)/$(PROJECT).mk: pckg-defs.mk
|
|
|
|
|
mkdir -p $(dir $@)
|
2017-08-31 19:40:39 +00:00
|
|
|
$(INSTALL) -p -m $(MAKEMODE) -o $(MAKEOWNER) -g $(MAKEGROUP) $< $@
|
2007-08-21 18:34:31 +00:00
|
|
|
|
2011-02-20 14:15:22 +00:00
|
|
|
install-links:
|
|
|
|
|
DEVELOPMENT=false make do-install-links
|
|
|
|
|
|
|
|
|
|
do-install-links:
|
2026-01-25 17:34:53 +01:00
|
|
|
$(Q)$(call install_links,MAKE)
|
2011-02-20 14:15:22 +00:00
|
|
|
|
2019-06-03 09:06:41 +00:00
|
|
|
ifeq ($(CREATE_PKG_CONFIG),true)
|
|
|
|
|
|
|
|
|
|
ifeq ($(EXPORT_PROJECT_LIB),true)
|
|
|
|
|
CREATE_PKG_CONFIG_OPTS += -c "-I$(PROJECT_DIRPATH)/include"
|
|
|
|
|
CREATE_PKG_CONFIG_OPTS += -l "-L$(PROJECT_DIRPATH)/lib -l$(PROJECT)"
|
|
|
|
|
endif
|
2016-01-24 16:05:55 +00:00
|
|
|
|
2025-11-16 17:31:16 +01:00
|
|
|
$(LOCAL_PKG_CONFIG): $(PROJECT_DESCR_FILE) $(JWBDIR)/make/make.mk
|
|
|
|
|
$(proj_query_cmd) create-pkg-config \
|
2016-01-22 17:57:37 +00:00
|
|
|
-F $< \
|
2016-01-24 16:05:55 +00:00
|
|
|
-n $(PROJECT) \
|
|
|
|
|
-v $(DIST_VERSION) \
|
|
|
|
|
-p $(PROJECT_DIRPATH) \
|
|
|
|
|
-V $(shell echo $(PROJECT) | tr a-z- A-Z_)_DIR=$(PROJECT_DIRPATH) \
|
2016-01-26 14:43:53 +00:00
|
|
|
-r "$(RPM_REQUIRES_RUN)" \
|
|
|
|
|
-R "$(RPM_REQUIRES_DEVEL)" \
|
2016-02-23 21:33:10 +00:00
|
|
|
-l "-L$(PROJECT_DIRPATH)/lib -l$(LIBNAME)" \
|
2016-01-24 16:05:55 +00:00
|
|
|
$(CREATE_PKG_CONFIG_OPTS) \
|
2016-01-22 17:57:37 +00:00
|
|
|
> $@.tmp
|
2016-01-22 17:35:16 +00:00
|
|
|
mv $@.tmp $@
|
|
|
|
|
|
2016-01-27 12:58:49 +00:00
|
|
|
$(BUILD_PKG_CONFIG): $(LOCAL_PKG_CONFIG)
|
2019-03-06 12:38:20 +00:00
|
|
|
|
2019-06-03 09:06:41 +00:00
|
|
|
endif # ifeq ($(CREATE_PKG_CONFIG),true)
|
|
|
|
|
|
2016-01-22 17:35:16 +00:00
|
|
|
clean.pkg-config:
|
2017-09-02 19:26:52 +00:00
|
|
|
$(RM) -f *.pc $(BUILD_PKG_CONFIG)
|