summaryrefslogtreecommitdiff
path: root/build/Makefile
blob: 17f6f786b20b870bd1207c76a2114292094d2e62 (plain)
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
40
41
42
43
44
TARGETS=$(foreach language,$(languages),$(addprefix $(language).,$(architectures)))

.PHONY: $(TARGETS)

all: $(TARGETS)

$(TARGETS): %:
	set -e ; \
	target=$@ ; \
	lang=$${target%.*} ; \
	lang_id="$$(echo $$lang | tr A-Z a-z | sed "s/_/-/")" ; \
	arch=$${target#*.} ; \
	eval arch_destination=$$destination ; \
	echo "Architecture: $$arch" ; \
	if [ -n "$$noarchdir" ]; then \
		destsuffix="$$lang" ; \
	else \
		if [ -n "$$web" ] ; then \
			destsuffix="$$arch" ; \
		else \
			destsuffix="$$lang.$$arch" ; \
		fi ; \
	fi ; \
	export destdir=build.out.$$lang.$$arch ; \
	export tempdir=build.tmp.$$lang.$$arch ; \
	./buildone.sh "$$arch" "$$lang" "$$formats" ; \
	mkdir -p "$$arch_destination/$$destsuffix" ; \
	for format in $$formats; do \
		if [ "$$format" = html ]; then \
			mkdir -p "$$arch_destination/$$destsuffix/images" ; \
			mv ./$$destdir/html/images/* "$$arch_destination/$$destsuffix/images" ; \
			ls -la ./$$destdir/html/images; \
			rmdir ./$$destdir/html/images || true ; \
			mv ./$$destdir/html/* "$$arch_destination/$$destsuffix" ; \
		else \
			# Do not fail because of missing PDF support for some languages \
			if [ -n "$$web" ] ; then \
				mv ./$$destdir/install.$$lang.$$format "$$arch_destination/$$destsuffix/install.$$format.$$lang_id" 2>/dev/null || true ; \
			else \
				mv ./$$destdir/install.$$lang.$$format "$$arch_destination/$$destsuffix" 2>/dev/null || true ; \
			fi ; \
		fi ; \
	done ; \
	./clear.sh