Skip to content

Commit ad9229a

Browse files
committed
#dae207a Add more informations into import.mk
1 parent 7be9bbd commit ad9229a

24 files changed

+384
-40
lines changed

_charm/src/dae207a7538ff30aec99037cec6b2c0ad6857a50d0e0df70aaf0d165eaae5024.cr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
<links>
88
<link name="parent">7bc74cc796c455a46d699ad91f6aca5b7c790f56a6a0968b4ecbce33efce9d25</link>
99
</links>
10-
<cf v="fred322 2025-04-16T10:20:12+02:00"/>
10+
<cf v="fred322 2025-04-25T10:34:50+02:00"/>
1111
</cr>

core/app-dist.mk

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,32 @@ $(DIST_FLATTEN_DIR)/obj/compiled:
4242
@$(ABS_PRINT_info) "Compilation of the project finished !"
4343
@touch $@
4444

45+
$(DIST_FLATTEN_DIR)/obj/%/distinfo.mk: $(DIST_FLATTEN_DIR)/obj/compiled
46+
@:
47+
48+
ifneq ($(filter dist distinstall pubdist pubinstall cachedist kdistinstall,$(MAKECMDGOALS)),)
49+
# include distinfo.mk needed for import.mk generation
50+
include $(patsubst %,$(DIST_FLATTEN_DIR)/obj/%/distinfo.mk,$(DIST_MODS))
51+
endif
52+
4553
EXPMOD_INCLUDES_DIR=$(wildcard $(patsubst %,%/include,$(EXPMOD)))
46-
$(DIST_FLATTEN_DIR)/import.mk: $(DIST_FLATTEN_DIR)/obj/compiled
54+
$(DIST_FLATTEN_DIR)/import.mk: $(DIST_FLATTEN_DIR)/obj/compiled $(DIST_FLATTEN_DIR)/obj/%/distinfo.mk
4755
@$(if $(EXPMOD_INCLUDES_DIR),cp -r $(EXPMOD_INCLUDES_DIR) $(@D))
4856
@test -f export.mk && m4 -D__app__=$(APPNAME) -D__version__=$(VERSION) export.mk -D__uselib__="$(sort $(USELIB))" > $@.tmp || true
4957
@echo "# generated: ABS-$(__ABS_VERSION__) $(USER)@"`hostname`" "`$(TRACE_DATE_CMD)` >> $@.tmp
5058
@test -f export.mk || printf '_app_$(APPNAME)_dir:=$$(dir $$(lastword $$(MAKEFILE_LIST)))\n\n' >> $@.tmp
5159
@test -f export.mk || printf '_app_$(APPNAME)_version:=$(VERSION)\n' >> $@.tmp
52-
@test -f export.mk || printf '_app_$(APPNAME)_uselib:=$(sort $(USELIB))\n\n' >> $@.tmp
60+
@test -f export.mk || printf '_app_$(APPNAME)_uselib:=$(sort $(USELIB))\n' >> $@.tmp
61+
@test -f export.mk || printf '_app_$(APPNAME)_modules:=$(sort $(DIST_MODS))\n' >> $@.tmp
62+
@test -f export.mk || printf '$(foreach mod,$(sort $(DIST_MODS)),$(if $(_module_$(APPNAME)_$(mod)_uselib),\n_module_$(APPNAME)_$(mod)_uselib:=$(_module_$(APPNAME)_$(mod)_uselib)))\n' >> $@.tmp
63+
@test -f export.mk || printf '$(foreach mod,$(sort $(DIST_MODS)),$(if $(_module_$(APPNAME)_$(mod)_depends),\n_module_$(APPNAME)_$(mod)_depends:=$(_module_$(APPNAME)_$(mod)_depends)))\n' >> $@.tmp
64+
@test -f export.mk || printf '$(foreach mod,$(sort $(DIST_MODS)) _extra,\n_module_$(APPNAME)_$(mod)_dir:=$$(_app_$(APPNAME)_dir))\n' >> $@.tmp
65+
@test -f export.mk || printf '_app_$(APPNAME)_alluselib:=$$(sort $$(_app_$(APPNAME)_uselib) $(foreach mod,$(sort $(DIST_MODS)),$(if $(_module_$(APPNAME)_$(mod)_uselib),$$(_module_$(APPNAME)_$(mod)_uselib))))\n\n' >> $@.tmp
5366
@test -f export.mk || echo '-include $$(wildcard $$(_app_$(APPNAME)_dir)/.abs/index_*.mk)' >> $@.tmp
54-
@test -f export.mk || printf '$$(eval $$(call extlib_import_template,$(APPNAME),$$(_app_$(APPNAME)_version),$$(_app_$(APPNAME)_uselib)))\n' >> $@.tmp
55-
@test -f export.mk || printf '$(foreach mod,$(sort $(DIST_MODS)),\n_module_$(APPNAME)_$(mod)_depends:=$(_module_$(APPNAME)_$(mod)_depends))\n' >> $@.tmp
56-
@test -f export.mk || printf '$(subst $(_space_),\n,$(foreach mod,$(sort $(DIST_MODS)) _extra,_module_$(APPNAME)_$(mod)_dir:=$$(_app_$(APPNAME)_dir)))\n\n' >> $@.tmp
67+
@test -f export.mk || printf '$$(eval $$(call extlib_import_template,$(APPNAME),$$(_app_$(APPNAME)_version),$$(_app_$(APPNAME)_alluselib)))\n\n' >> $@.tmp
5768
@test -f export.mk || printf '$(_extra_import_defs_)\n' >> $@.tmp
69+
@# remove spaces at the end of each lines (due to foreach executions).
70+
@test -f export.mk || sed -i -E 's/ *$$//g' $@.tmp
5871
@touch $(@D)/obj/extraFiles.ts
5972
@if [ -x extradist.sh ]; then VERSION=$(VERSION) APP=$(APPNAME) APPNAME=$(APPNAME) ./extradist.sh `dirname $@`; fi
6073
@find $(@D) -type f -cnewer $(@D)/obj/extraFiles.ts | grep -v $(@D)/obj | sed 's~$(@D)/~~g' | grep -E -v "$(subst *,.*,$(subst $(_space_),|,$(DIST_EXCLUDE)))" > $(@D)/.abs/content/$(APPNAME)__extra.filelist || true
@@ -75,6 +88,7 @@ ifeq ($(MAKECMDGOALS),__installextlibs)
7588
# needed external modules and libs retreiving
7689
DIST_PROJ_MODS=$(patsubst %,$(APPNAME)_%,$(DIST_MODS))
7790
include $(patsubst %,$(DIST_FLATTEN_DIR)/obj/%/moddeps.mk,$(DIST_MODS))
91+
include $(patsubst %,$(DIST_FLATTEN_DIR)/obj/%/distinfo.mk,$(DIST_MODS))
7892

7993
# INCLUDE_INSTALL_MODS additionnals external mods to include in the installation.
8094
NEEDED_MODS=$(filter-out $(DIST_PROJ_MODS),$(call getDependenciesByTransitivity,$(INCLUDE_INSTALL_MODS) $(DIST_PROJ_MODS)))
@@ -88,8 +102,8 @@ INCLUDE_EXT_LIBS_TO_INSTALL=$(patsubst %,installExtLib.%,$(INCLUDE_EXT_LIBS))
88102
installExt.%:
89103
@$(ABS_PRINT_info) " Processing external module $* ..."
90104
@$(call writeToBuildLogs,Processing external module $*)
91-
@modPath=$(_module_$*_dir) && test -z "$$modPath" || test ! -d $$modPath || test ! -f $(_module_$*_dir)/.abs/content/$*.filelist || (\
92-
cat $(_module_$*_dir)/.abs/content/$*.filelist | tar -C $$modPath/ -cf - -T - | tar -C $(INSTALL_TMP_DIR)/ -xf -)
105+
@modPath=$(_module_$*_dir) && test -z "$$modPath" || test ! -d $$modPath || test ! -f $$modPath/.abs/content/$*.filelist || (\
106+
cat $$modPath/.abs/content/$*.filelist | tar -C $$modPath/ -cf - -T - | tar -C $(INSTALL_TMP_DIR)/ -xf -)
93107

94108
installExtLib.%:
95109
@$(ABS_PRINT_info) " Processing external library $* ..."

core/module-depends.mk

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ PROJECT_INC_MODS:=$(patsubst $(PRJROOT)/%/module.cfg,$(APPNAME)_%,$(wildcard $(P
1616
# INCLUDE_MODS permit to add dependency between mods but without doing link between generated libraries.
1717
NEEDED_PROJ_MODS=$(sort $(USEMOD) $(TESTUSEMOD) $(patsubst $(APPNAME)_%,%,$(filter $(PROJECT_INC_MODS),$(INCLUDE_MODS))))
1818

19-
# DISABLE_USELIB_PROPAGATION permit to not propagate USELIB or NDUSELIB defined in the module.cfg
20-
ifneq ($(DISABLE_USELIB_PROPAGATION),true)
21-
PROPAGATE_USELIB=true
22-
endif
23-
2419
# add dependencies between modules to avoid compile module at the same time.
2520
# .done must depends of other .done to propagate the multithread dependency.
2621
# the variable _depends will contains libs needed by the module. If the archive name is same than .so, the name lib$(dep) will be used instead of $(dep)
@@ -36,8 +31,6 @@ $(PRJOBJDIR)/$(MODNAME)/moddeps.mk:
3631
'_module_$(APPNAME)_$(MODNAME)_dir=$$(TRDIR)\n'\
3732
'_module_$(APPNAME)_$(MODNAME)_depends=$$(sort $$(call getLibrariesNameFromLinklib,$(LINKLIB)) $(INCLUDE_MODS) $(patsubst %,$(APPNAME)_%,$(USEMOD)))\n\n'\
3833
'_module_$(APPNAME)_$(MODNAME)_done_depends=$$(patsubst %%,$$(PRJOBJDIR)/%%/.done,$(NEEDED_PROJ_MODS))\n\n'\
39-
'USELIB+=$(if $(PROPAGATE_USELIB),$(filter-out $(DEFAULT_USELIB),$(USELIB)))\n'\
40-
'NDUSELIB+=$(if $(PROPAGATE_USELIB),$(filter-out $(DEFAULT_NDUSELIB),$(NDUSELIB)))\n\n'\
4134
'$$(PRJOBJDIR)/$(MODNAME)/.depready: $$(_module_$(APPNAME)_$(MODNAME)_done_depends)\n\n'\
4235
'$$(PRJOBJDIR)/$(MODNAME)/.done: $$(wildcard $$(foreach toLook,etc src include module.cfg local.cfg,$$(call find,$$(PRJROOT)/$(MODNAME)/$$(toLook),*)))\n\n'\
4336
'$$(PRJOBJDIR)/$(MODNAME)/.done: $$(_module_$(APPNAME)_$(MODNAME)_done_depends)\n\n'\

core/module.mk

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ EXTSRCFILES:=
7575
TTARGETDIR?=$(TRDIR)/test
7676
TEST_REPORT_PATH:=$(TTARGETDIR)/$(APPNAME)_$(MODNAME).xml
7777

78+
DISTINFO_FILE=$(OBJDIR)/distinfo.mk
79+
TARGETFILES+=$(DISTINFO_FILE)
80+
7881
ifeq ($(REVISION),)
7982
REVISION:=undef
8083
ifeq ($(ABS_SCM_TYPE),svn)
@@ -104,6 +107,9 @@ endif
104107
OBJDIR?=$(PRJOBJDIR)/$(MODNAME)
105108
EXT_MODSRC_DIR=$(OBJDIR)/extsrc
106109

110+
# INCLUDE_MODS permit to add dependency between mods but without doing link between generated libraries.
111+
NEEDED_PROJ_MODS=$(sort $(USEMOD) $(patsubst $(APPNAME)_%,%,$(filter $(PROJECT_INC_MODS),$(INCLUDE_MODS))))
112+
107113
##
108114
## Common make targets:
109115
##
@@ -247,6 +253,22 @@ endif
247253

248254
endif
249255

256+
# DISABLE_USELIB_PROPAGATION permit to not propagate USELIB or NDUSELIB defined in the module.cfg
257+
ifneq ($(DISABLE_USELIB_PROPAGATION),true)
258+
PROPAGATE_USELIB=true
259+
endif
260+
261+
# generation of the distinfo.mk to have all uselib even if brought by an abs extension.
262+
$(DISTINFO_FILE): $(DEFAULT_EXTLIBMAKES)
263+
@mkdir -p $(@D)
264+
@printf 'ifeq ($$(_DIST_INFO_$(MODNAME)_loaded_),)\n'\
265+
'_DIST_INFO_$(MODNAME)_loaded_=true\n'\
266+
'include $$(patsubst %%,$$(DIST_FLATTEN_DIR)/obj/%%/distinfo.mk,$(NEEDED_PROJ_MODS))\n'\
267+
'_module_$(APPNAME)_$(MODNAME)_alluselib=$(if $(PROPAGATE_USELIB),$(USELIB))\n'\
268+
'_module_$(APPNAME)_$(MODNAME)_uselib=$$(filter-out $$(USELIB),$$(_module_$(APPNAME)_$(MODNAME)_alluselib))\n'\
269+
'_module_$(APPNAME)_$(MODNAME)_depends=$(sort $(call getLibrariesNameFromLinklib,$(LINKLIB)) $(INCLUDE_MODS) $(patsubst %,$(APPNAME)_%,$(USEMOD)))\n\n'\
270+
'endif' > $@
271+
250272
$(PRJOBJDIR)/%/.done: $(DEFAULT_EXTLIBMAKES)
251273
@$(ABS_PRINT_info) "==============="
252274
@$(ABS_PRINT_info) "$(MODNAME): Build of dependency: $*"
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# ---------------------------------------------------------------------
2+
# AcrobatomaticBuildSystem bootstrap make file.
3+
# (c) 2006-2019 Sebastien Devaux
4+
# (c) 2017-2019 ArianeGroup
5+
#
6+
# To use ABS to build your project, just copy this file as 'Makefile' into
7+
# your project's root directory and each already existing module directories.
8+
# As soon your project's layout is complient to the ABS layout and contains
9+
# the expected configuration files (app.cfg at top level, and module.cfg in
10+
# each module directory), you can invoke make command to build it.
11+
# ---------------------------------------------------------------------
12+
# Prerequisites: a quite regular shell including GNU make, tar, wget and
13+
# few other widely available commands.
14+
# Any GNU environment (GNU/Linux, cygwin, mingw, may be GNU/hurd) should
15+
# be able to run this makefile.
16+
# ---------------------------------------------------------------------
17+
# See ABS documentation (ref #170983b) for more details.
18+
# https://www.eduvax.net/gitweb
19+
# https://github.com/seeduvax/AcrobatomaticBuildSystem
20+
# ---------------------------------------------------------------------
21+
22+
ifneq ($(wildcard app.cfg),)
23+
PRJROOT:=$(CURDIR)
24+
endif
25+
ifneq ($(wildcard module.cfg),)
26+
PRJROOT:=$(dir $(CURDIR))
27+
endif
28+
ifeq ($(HOME),)
29+
ABSWS:=$(PRJROOT)/../abs
30+
else
31+
ABSWS:=$(HOME)/.abs
32+
endif
33+
34+
include $(PRJROOT)/app.cfg
35+
-include $(ABSWS)/local.cfg
36+
-include $(PRJROOT)/local.cfg
37+
ifneq ($(wildcard module.cfg),)
38+
-include $(CURDIR)/local.cfg
39+
endif
40+
ABSROOT:=$(ABSWS)/abs-$(VABS)
41+
ABS_CACHE:=$(ABSWS)/cache
42+
include $(ABSROOT)/core/main.mk
43+
44+
# Default and minimal rule download files from repository
45+
# May be overloaded by dependencies download rules for more features
46+
ifeq ($(ABS_DEPDOWNLOAD_RULE_OVERLOADED),)
47+
ABS_REPO_1ST=$(word 1,$(ABS_REPO))
48+
$(ABS_CACHE)/%:
49+
@mkdir -p $(@D)
50+
ifeq ($(findstring file://,$(ABS_REPO_1ST)),file://)
51+
@test -r $(patsubst file://%,%,$(patsubst $(ABS_CACHE)/%,$(ABS_REPO_1ST)/%,$@)) || exit 1
52+
@echo "Linking $(@F) from $(ABS_REPO_1ST)"
53+
@ln -sf $(patsubst file://%,%,$(patsubst $(ABS_CACHE)/%,$(ABS_REPO_1ST)/%,$@)) $@
54+
else
55+
@echo "Fetching $(@F) from $(ABS_REPO_1ST)"
56+
@wget -q $(WGETFLAGS) $(patsubst $(ABS_CACHE)/%,$(ABS_REPO_1ST)/%,$@) -O $@
57+
endif
58+
endif
59+
60+
$(ABSROOT)/%/main.mk: $(ABS_CACHE)/noarch/abs.%-$(VABS).tar.gz
61+
@mkdir -p $(ABSROOT)
62+
@tar xzf $^ -C $(ABSROOT) --strip-components=1
63+
@touch $@
64+
65+
$(PRJROOT)/local.cfg:
66+
@:
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
APPNAME=clang
2+
VERSION=13
3+
COMPANY=eduvax
4+
VABS:=99.99.99
5+
ABS_REPO:=file://$(PRJROOT)/../repository http://www.eduvax.net/dist file:///home/httpd/www/dist
6+
DISTREPO:=file://$(PRJROOT)/../repository
7+
ABSWS:=$(PRJROOT)/../absws
8+
9+
WORKSPACE_IS_TAG:=true
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# ---------------------------------------------------------------------
2+
# AcrobatomaticBuildSystem bootstrap make file.
3+
# (c) 2006-2019 Sebastien Devaux
4+
# (c) 2017-2019 ArianeGroup
5+
#
6+
# To use ABS to build your project, just copy this file as 'Makefile' into
7+
# your project's root directory and each already existing module directories.
8+
# As soon your project's layout is complient to the ABS layout and contains
9+
# the expected configuration files (app.cfg at top level, and module.cfg in
10+
# each module directory), you can invoke make command to build it.
11+
# ---------------------------------------------------------------------
12+
# Prerequisites: a quite regular shell including GNU make, tar, wget and
13+
# few other widely available commands.
14+
# Any GNU environment (GNU/Linux, cygwin, mingw, may be GNU/hurd) should
15+
# be able to run this makefile.
16+
# ---------------------------------------------------------------------
17+
# See ABS documentation (ref #170983b) for more details.
18+
# https://www.eduvax.net/gitweb
19+
# https://github.com/seeduvax/AcrobatomaticBuildSystem
20+
# ---------------------------------------------------------------------
21+
22+
ifneq ($(wildcard app.cfg),)
23+
PRJROOT:=$(CURDIR)
24+
endif
25+
ifneq ($(wildcard module.cfg),)
26+
PRJROOT:=$(dir $(CURDIR))
27+
endif
28+
ifeq ($(HOME),)
29+
ABSWS:=$(PRJROOT)/../abs
30+
else
31+
ABSWS:=$(HOME)/.abs
32+
endif
33+
34+
include $(PRJROOT)/app.cfg
35+
-include $(ABSWS)/local.cfg
36+
-include $(PRJROOT)/local.cfg
37+
ifneq ($(wildcard module.cfg),)
38+
-include $(CURDIR)/local.cfg
39+
endif
40+
ABSROOT:=$(ABSWS)/abs-$(VABS)
41+
ABS_CACHE:=$(ABSWS)/cache
42+
include $(ABSROOT)/core/main.mk
43+
44+
# Default and minimal rule download files from repository
45+
# May be overloaded by dependencies download rules for more features
46+
ifeq ($(ABS_DEPDOWNLOAD_RULE_OVERLOADED),)
47+
ABS_REPO_1ST=$(word 1,$(ABS_REPO))
48+
$(ABS_CACHE)/%:
49+
@mkdir -p $(@D)
50+
ifeq ($(findstring file://,$(ABS_REPO_1ST)),file://)
51+
@test -r $(patsubst file://%,%,$(patsubst $(ABS_CACHE)/%,$(ABS_REPO_1ST)/%,$@)) || exit 1
52+
@echo "Linking $(@F) from $(ABS_REPO_1ST)"
53+
@ln -sf $(patsubst file://%,%,$(patsubst $(ABS_CACHE)/%,$(ABS_REPO_1ST)/%,$@)) $@
54+
else
55+
@echo "Fetching $(@F) from $(ABS_REPO_1ST)"
56+
@wget -q $(WGETFLAGS) $(patsubst $(ABS_CACHE)/%,$(ABS_REPO_1ST)/%,$@) -O $@
57+
endif
58+
endif
59+
60+
$(ABSROOT)/%/main.mk: $(ABS_CACHE)/noarch/abs.%-$(VABS).tar.gz
61+
@mkdir -p $(ABSROOT)
62+
@tar xzf $^ -C $(ABSROOT) --strip-components=1
63+
@touch $@
64+
65+
$(PRJROOT)/local.cfg:
66+
@:
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
MODNAME=clang
2+
MODTYPE=library
3+
4+
TARGET_NO_APPNAME=true

sampleprj/T_abs/test/resources/expected/import2.mk

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@ _app_projC_dir:=$(dir $(lastword $(MAKEFILE_LIST)))
22

33
_app_projC_version:=2.4.3d
44
_app_projC_uselib:=libtest-2.0.0 projB-2.4.2d projD-2.4.4d
5+
_app_projC_modules:=cpplib
56

6-
-include $(wildcard $(_app_projC_dir)/.abs/index_*.mk)
7-
$(eval $(call extlib_import_template,projC,$(_app_projC_version),$(_app_projC_uselib)))
87

98
_module_projC_cpplib_depends:=projB_cpplib projB_cpplib2 projD_cpplib projD_fileset
9+
1010
_module_projC_cpplib_dir:=$(_app_projC_dir)
1111
_module_projC__extra_dir:=$(_app_projC_dir)
12+
_app_projC_alluselib:=$(sort $(_app_projC_uselib) )
13+
14+
-include $(wildcard $(_app_projC_dir)/.abs/index_*.mk)
15+
$(eval $(call extlib_import_template,projC,$(_app_projC_version),$(_app_projC_alluselib)))
1216

1317

sampleprj/T_abs/test/resources/expected/projA_import2.mk

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@ _app_projA_dir:=$(dir $(lastword $(MAKEFILE_LIST)))
22

33
_app_projA_version:=1.4.2d
44
_app_projA_uselib:=
5+
_app_projA_modules:=cppexe cpplib fileset
56

6-
-include $(wildcard $(_app_projA_dir)/.abs/index_*.mk)
7-
$(eval $(call extlib_import_template,projA,$(_app_projA_version),$(_app_projA_uselib)))
87

9-
_module_projA_cppexe_depends:=projA_cpplib
10-
_module_projA_cpplib_depends:=
11-
_module_projA_fileset_depends:=
8+
_module_projA_cppexe_depends:=projA_cpplib
9+
1210
_module_projA_cppexe_dir:=$(_app_projA_dir)
1311
_module_projA_cpplib_dir:=$(_app_projA_dir)
1412
_module_projA_fileset_dir:=$(_app_projA_dir)
1513
_module_projA__extra_dir:=$(_app_projA_dir)
14+
_app_projA_alluselib:=$(sort $(_app_projA_uselib) )
15+
16+
-include $(wildcard $(_app_projA_dir)/.abs/index_*.mk)
17+
$(eval $(call extlib_import_template,projA,$(_app_projA_version),$(_app_projA_alluselib)))
1618

1719

0 commit comments

Comments
 (0)