]> git.argeo.org Git - cc0/argeo-build.git/blob - common.mk
Close directory stream
[cc0/argeo-build.git] / common.mk
1 build-major=2
2 build-minor=3
3
4 # Required third party libraries
5 ECJ_MAJOR=3
6 BNDLIB_BRANCH=5.3
7 SYSLOGGER_BRANCH=$(build-major).$(build-minor)
8
9 # The following variables are found in the sdk.mk file which is generated by the configure script:
10 # SDK_SRC_BASE the base of the source code, typically the root of the cloned git repository
11 # SDK_BUILD_BASE the base of the output
12 # JAVA_HOME the base of the JDK used to build
13 A2_OUTPUT = $(SDK_BUILD_BASE)/a2
14 JVM ?= $(JAVA_HOME)/bin/java
15 JAVADOC ?= $(JAVA_HOME)/bin/javadoc
16
17 # GNU defaults
18 prefix ?= /usr/local
19 datarootdir ?= $(prefix)/share
20 exec_prefix ?= $(prefix)
21 libdir ?= $(exec_prefix)/lib
22
23 A2_INSTALL_TARGET ?= $(DESTDIR)$(datarootdir)/a2
24 A2_NATIVE_INSTALL_TARGET ?= $(DESTDIR)$(libdir)/a2
25
26 # The following variables have default values which can be overriden
27 # A2_BASE the space-separated directories where already built a2 categories can be found
28 A2_BASE ?=$(A2_OUTPUT) $(A2_INSTALL_TARGET) $(A2_NATIVE_INSTALL_TARGET) /usr/local/share/a2 /usr/local/lib/a2 /usr/share/a2 /usr/lib/a2
29
30 # OS-speciific
31 KNOWN_ARCHS ?= x86_64 aarch64
32 TARGET_OS ?= linux
33 TARGET_ARCH ?= $(shell uname -m)
34
35 TARGET_OS_CATEGORY_PREFIX=lib/$(TARGET_OS)
36 TARGET_ARCH_CATEGORY_PREFIX=$(TARGET_OS_CATEGORY_PREFIX)/$(TARGET_ARCH)
37 PORTABLE_CATEGORIES=$(filter-out lib/%, $(CATEGORIES))
38 ARCH_CATEGORIES=$(filter $(TARGET_ARCH_CATEGORY_PREFIX)/%, $(CATEGORIES))
39 OS_CATEGORIES=$(filter-out $(foreach arch, $(KNOWN_ARCHS), $(TARGET_OS_CATEGORY_PREFIX)/$(arch)/%), $(filter $(TARGET_OS_CATEGORY_PREFIX)/%, $(CATEGORIES)))
40
41 ## Utilities
42 # Install to a target directory without executable bit
43 INSTALL=install -m644 -D --target-directory
44 # Always try copy-on-write
45 COPY=--reflink=auto
46 # Recursively delete directories
47 RMDIR=$(RM) -r
48
49 # Make variables used to replace spaces by a separator, typically in order to generate classpaths
50 # for example: CLASSPATH = $(subst $(space),$(pathsep),$(strip $(JARS)))
51 null :=
52 space := $(null) #
53 pathsep := :
54 define LF
55
56 $(null)
57 endef