-
Notifications
You must be signed in to change notification settings - Fork 32
/
Makefile
40 lines (28 loc) · 1.52 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Generic Makefile which calls make on every sub-directory
TOPTARGETS := all clean
SUBDIRS := $(wildcard */.)
$(TOPTARGETS): $(SUBDIRS)
# Invoke 'make' on every subfolder that contains a Makefile (and is not called 'target')
$(SUBDIRS):
@if [ -f "$@/Makefile" ] && [ "$@" != 'target/.' ]; then $(MAKE) -C "$@" $(MAKECMDGOALS) ; fi
.PHONY: $(TOPTARGETS) $(SUBDIRS)
.ONESHELL:
all: .env ## Recursively prepare all resources (using builds and downloads) needed to build the docker images
clean: ## Remove all files under 'target'
rm -rf target
target:
mkdir -p target
target/linkedgeodata.deb: components/lgd-tools-parent/pom.xml | target ## Build the LGD debian package used by the sync containers from this lgd's java code
mvn -f components/lgd-tools-parent/pom.xml -Pdeb clean install
file=`find components/lgd-tools-parent/lgd-tools-pkg-parent/lgd-tools-pkg-deb-cli -name 'linkedgeodata_*.deb'`
mkdir -p target
cp "$$file" target/linkedgeodata.deb # use ln -s ?
# Ugliness: We should not depend on the existence of the target folder in the rule below:
# We should touch a file if the artifact already is in the local m2 repo
components/lgd-thirdparty/nominatim/lgd-pkg-nominatim-4.0.1/target: ## Bundle nominatim up as a jar and cache it in the local m2 repo
cd components/lgd-thirdparty/nominatim/lgd-pkg-nominatim-4.0.1
mvn clean install
.env: env.dist
cp -n env.dist .env
help: ## Show these help instructions
@sed -rn 's/^([a-zA-Z0-9_./| -]+):.*?## (.*)$$/"\1" "\2"/p' < $(MAKEFILE_LIST) | xargs printf "make %-30s # %s\n"