summaryrefslogtreecommitdiff
path: root/Makefile
blob: 92017f3fdc1f7825dfc1513e26dba1ffcad8cd18 (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
# Configuration
DESTDIR=

#prefix=/usr/local
prefix=/usr
exec_prefix=$(prefix)
datarootdir=$(prefix)/share

bindir=$(exec_prefix)/bin
sbindir=$(exec_prefix)/sbin
#sysconfdir=$(prefix)/etc
sysconfdir=/etc
datadir=$(datarootdir)
docdir=$(datarootdir)/doc

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

# these are directories
pseudo-packages=abslibre-tools chroot-tools fullpkg lib mips64el-tools toru

# these are the resulting packages
packages=libretools libretools-pr libretools-mips64el
# and which directories they contains
libretools=abslibre-tools lib chroot-tools fullpkg toru misc
libretools-mips64el=mips64el-tools

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

all: PHONY build
build: PHONY build-libretools build-doc
install: PHONY install-libretools install-doc

%-doc: PHONY doc
	$(MAKE) -C doc $*
%-misc: PHONY src
	$(MAKE) -C src $*

build-%: PHONY src/%
	$(MAKE) -C src/$* build
install-%: PHONY src/%
	$(MAKE) -C src/$* install

.SECONDEXPANSION:
$(addprefix build-,  $(packages)): build-%:   PHONY $$(addprefix build-,  $$($$*))
$(addprefix install-,$(packages)): install-%: PHONY $$(addprefix install-,$$($$*))

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

FORCE: PHONY
PHONY:
.PHONY: FORCE PHONY