summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile43
-rwxr-xr-xtest/testenv2
2 files changed, 25 insertions, 20 deletions
diff --git a/Makefile b/Makefile
index 0403498..75d1771 100644
--- a/Makefile
+++ b/Makefile
@@ -4,35 +4,40 @@ include config.mk
################################################################################
# these are the resulting packages
-packages=libretools libretools-mips64el librelib
+packages=doc libretools libretools-mips64el librelib
# and which directories they contain
-libretools=abslibre-tools chroot-tools devtools fullpkg librefetch misc toru
-libretools-mips64el=mips64el-tools
-librelib=lib
+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
################################################################################
all: PHONY build
-build: PHONY build-libretools build-doc
-install: PHONY install-libretools install-doc
+copy: PHONY $(addprefix copy-, $(packages))
+build: PHONY $(addprefix build-, $(packages))
+install: PHONY $(addprefix install-,$(packages))
check:
@cd test && ./testenv $(TESTENVFLAGS) roundup
-%-doc: PHONY doc
- $(MAKE) -C doc $*
-%-misc: PHONY src
- $(MAKE) -C src $*
-
-copy-%: PHONY src/%
- $(MAKE) -C src/$* copy
-build-%: PHONY src/%
- $(MAKE) -C src/$*
-install-%: PHONY src/%
- $(MAKE) -C src/$* install
+%/copy: PHONY %
+ $(MAKE) -C $* copy
+%/build: PHONY %
+ $(MAKE) -C $*
+%/install: PHONY %
+ $(MAKE) -C $* install
.SECONDEXPANSION:
-$(addprefix build-, $(packages)): build-%: PHONY $$(addprefix build-, $$($$*))
-$(addprefix install-,$(packages)): install-%: PHONY $$(addprefix install-,$$($$*))
+$(addprefix copy-, $(packages)): copy-%: PHONY $$(addsuffix /copy, $$($$*))
+$(addprefix build-, $(packages)): build-%: PHONY $$(addsuffix /build, $$($$*))
+$(addprefix install-,$(packages)): install-%: PHONY $$(addsuffix /install,$$($$*))
################################################################################
diff --git a/test/testenv b/test/testenv
index 423eda5..0448e33 100755
--- a/test/testenv
+++ b/test/testenv
@@ -18,7 +18,7 @@ export TMPDIR="$(mktemp --tmpdir -d libretools-test.XXXXXXXXXX)"
trap "rm -rf '$TMPDIR'" EXIT
# Set up the install to work with
destdir=$TMPDIR/destdir
-make -C .. install-librelib install DESTDIR=$destdir &>/dev/null || {
+make -C .. install DESTDIR=$destdir &>/dev/null || {
echo 'error creating local install, cannot run tests'
exit 1
}