summaryrefslogtreecommitdiff
path: root/Makefile
blob: bba0d460ea85a107dc7f3c5525804eb3889b02aa (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
topdir = .
include config.mk

################################################################################

# these are the resulting packages
packages=doc libretools libretools-mips64el librelib gitget xbs
# and which directories they contain
doc=doc
libretools=\
	src \
	src/abslibre-tools \
	src/chroot-tools \
	src/devtools \
	src/fullpkg \
	src/librefetch \
	src/toru
libretools-mips64el=src/mips64el-tools
librelib=src/lib
gitget=src/gitget
xbs=\
	src/xbs \
	src/xbs-abs \
	src/xbs-abslibre

################################################################################

all: PHONY build
copy:    PHONY $(addprefix copy-,   $(packages))
build:   PHONY $(addprefix build-,  $(packages))
install: PHONY $(addprefix install-,$(packages))
clean:   PHONY $(addprefix clean-,  $(packages))
	rm -f po/*.pot
pot:     PHONY $(addprefix pot-,    $(filter-out doc,$(packages)))
check:
	@cd test && ./testenv $(TESTENVFLAGS) roundup

%/build: PHONY %
	$(MAKE) -C $*
%/install: PHONY %
	$(MAKE) -C $* install
%/clean: PHONY %
	$(MAKE) -C $* clean
%/pot: PHONY %
	$(MAKE) -C $* pot
%/everything.pot: FORCE %
	$(MAKE) -C $* everything.pot

.SECONDEXPANSION:
$(addprefix copy-,   $(packages)): copy-%:    PHONY $$(addsuffix /copy,   $$($$*))
$(addprefix build-,  $(packages)): build-%:   PHONY $$(addsuffix /build,  $$($$*))
$(addprefix install-,$(packages)): install-%: PHONY $$(addsuffix /install,$$($$*))
$(addprefix clean-,  $(packages)): clean-%:   PHONY $$(addsuffix /clean,  $$($$*))
$(addprefix pot-,    $(packages)): pot-%:     PHONY po/%.pot
$(addprefix pot-,    $(packages)): pot-%:     PHONY po/%.pot
$(foreach p,$(packages),po/$p.pot): po/%.pot: $$(addsuffix /everything.pot,$$($$*))
	cat $^ | msguniq -Fi --to-code=UTF-8 > '$@' || rm -f '$@'

################################################################################

FORCE: PHONY
PHONY:
.PHONY: PHONY