]>
git.argeo.org Git - cc0/argeo-build.git/blob - repackage.mk
3e3a96b346c76fcb1319ee02a1a88f901a34cee4
1 ARGEO_BUILD_BASE
:= $(dir $(lastword
$(MAKEFILE_LIST
)))
2 include $(ARGEO_BUILD_BASE
)common.mk
4 # Common repackage routines to be included in Makefiles
6 # The following variables are found in the sdk.mk file which is generated by the configure script:
7 # SDK_SRC_BASE the base of the source code, typically the root of the cloned git repository
8 # SDK_BUILD_BASE the base of the output
9 # JAVA_HOME the base of the JDK used to build
10 A2_OUTPUT
= $(SDK_BUILD_BASE
)/a2
11 JVM ?
= $(JAVA_HOME
)/bin
/java
13 # The following variables should be declared in the including Makefile:
14 # CATEGORIES the space-separated list of categories to repackage
16 # The following variables have default values which can be overriden
17 # A2_BASE the space-separated directories where already built a2 categories can be found
18 A2_BASE ?
=/usr
/share
/a2
/usr
/local
/share
/a2
$(A2_OUTPUT
)
20 # Third-party libraries
21 LOGGER_JAR ?
= $(lastword
$(foreach base
, $(A2_BASE
), $(wildcard $(base
)/org.argeo.tp
/org.argeo.tp.syslogger.
$(SYSLOGGER_BRANCH
).jar
)))
22 BNDLIB_JAR ?
= $(lastword
$(foreach base
, $(A2_BASE
), $(wildcard $(base
)/org.argeo.tp.sdk
/biz.aQute.bndlib.
$(BNDLIB_BRANCH
).jar
)))
25 ARGEO_REPACKAGE
= $(JVM
) -cp
$(LOGGER_JAR
):$(BNDLIB_JAR
) $(ARGEO_BUILD_BASE
)src
/org
/argeo
/build
/Repackage.java
26 TODOS_REPACKAGE
= $(foreach category
, $(CATEGORIES
),$(BUILD_BASE
)/$(category
)/to-repackage
)
27 BUILD_BASE
= $(SDK_BUILD_BASE
)/$(shell basename $(SDK_SRC_BASE
))
29 all: $(BUILD_BASE
)/repackaged
32 # We use .SECONDEXPANSION and CATEGORIES_TO_REPACKAGE instead of directly CATEGORIES
33 # so that we don't repackage a category if it hasn't changed
34 $(BUILD_BASE
)/repackaged
: CATEGORIES_TO_REPACKAGE
= $(subst $(abspath
$(BUILD_BASE
))/,, $(subst to-repackage
,, $?
))
35 $(BUILD_BASE
)/repackaged
: $(TODOS_REPACKAGE
)
36 $(ARGEO_REPACKAGE
) $(A2_OUTPUT
) $(CATEGORIES_TO_REPACKAGE
)
37 touch
$(BUILD_BASE
)/repackaged
39 $(BUILD_BASE
)/%/to-repackage
: $$(shell find
% -type f
)
45 $(foreach category
, $(CATEGORIES
), rm -rf
$(A2_OUTPUT
)/$(category
))
46 $(foreach category
, $(CATEGORIES
), rm -rf
$(BUILD_BASE
)/$(category
))
47 rm -f
$(BUILD_BASE
)/repackaged