Fix repackage uninstall
[cc0/argeo-build.git] / common.mk
index 025ac54ae8a96d19d057fa3c005d9136d7ff0c0b..c30d011faa8fc4750b69e07e29c33ce68cf83f68 100644 (file)
--- a/common.mk
+++ b/common.mk
@@ -7,15 +7,15 @@ BNDLIB_BRANCH=5.3
 SYSLOGGER_BRANCH=$(build-major).$(build-minor)
 
 # The following variables are found in the sdk.mk file which is generated by the configure script:
-# SDK_SRC_BASE         the base of the source code, typically the root of the cloned git repository
-# SDK_BUILD_BASE       the base of the output
-# JAVA_HOME                    the base of the JDK used to build
+# SDK_SRC_BASE      the base of the source code, typically the root of the cloned git repository
+# SDK_BUILD_BASE    the base of the output
+# JAVA_HOME         the base of the JDK used to build
 A2_OUTPUT = $(SDK_BUILD_BASE)/a2
 JVM ?= $(JAVA_HOME)/bin/java
 JAVADOC ?= $(JAVA_HOME)/bin/javadoc
 
 # The following variables have default values which can be overriden
-# A2_BASE                      the space-separated directories where already built a2 categories can be found
+# A2_BASE           the space-separated directories where already built a2 categories can be found
 A2_BASE ?=$(A2_OUTPUT) /usr/local/share/a2 /usr/share/a2
 
 # GNU defaults
@@ -32,8 +32,21 @@ KNOWN_ARCHS ?= x86_64 aarch64
 TARGET_OS ?= linux
 TARGET_ARCH ?= $(shell uname -m)
 
-TARGET_OS_CATEGORY_PREFIX=lib/linux
+TARGET_OS_CATEGORY_PREFIX=lib/$(TARGET_OS)
 TARGET_ARCH_CATEGORY_PREFIX=$(TARGET_OS_CATEGORY_PREFIX)/$(TARGET_ARCH)
 PORTABLE_CATEGORIES=$(filter-out lib/%, $(CATEGORIES))
 ARCH_CATEGORIES=$(filter $(TARGET_ARCH_CATEGORY_PREFIX)/%, $(CATEGORIES))
 OS_CATEGORIES=$(filter-out $(foreach arch, $(KNOWN_ARCHS), $(TARGET_OS_CATEGORY_PREFIX)/$(arch)/%), $(filter $(TARGET_OS_CATEGORY_PREFIX)/%, $(CATEGORIES)))
+
+# Utilities
+INSTALL=install -m644 -D --target-directory
+
+# Make variables used to replace spaces by a separator, typically in order to generate classpaths
+# for example: CLASSPATH = $(subst $(space),$(pathsep),$(strip $(JARS)))
+null  :=
+space := $(null) #
+pathsep := :
+define LF
+
+$(null)
+endef