summaryrefslogtreecommitdiff
path: root/examples/hello_superfs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/hello_superfs')
-rw-r--r--examples/hello_superfs/Makefile3
-rw-r--r--examples/hello_superfs/Makefile.inc15
-rw-r--r--examples/hello_superfs/expect.out12
-rw-r--r--examples/hello_superfs/test.mk21
4 files changed, 50 insertions, 1 deletions
diff --git a/examples/hello_superfs/Makefile b/examples/hello_superfs/Makefile
index 81442e4..57a1655 100644
--- a/examples/hello_superfs/Makefile
+++ b/examples/hello_superfs/Makefile
@@ -4,5 +4,8 @@ SUBPRJ_DFLT = mkfs_superfs fsck_superfs docs
# "tools" is a virtual subproject, there is no subdirectory for it
+TMPPREFIX = ${.OBJDIR}/tmp
+.export TMPPREFIX
+
.include "test.mk"
.include <mkc.subprj.mk>
diff --git a/examples/hello_superfs/Makefile.inc b/examples/hello_superfs/Makefile.inc
index d29359b..57c8208 100644
--- a/examples/hello_superfs/Makefile.inc
+++ b/examples/hello_superfs/Makefile.inc
@@ -1 +1,14 @@
-BINDIR?= ${SBINDIR}
+BINDIR ?= ${SBINDIR}
+
+.ifdef MICHAEL_MODE
+# If MICHAEL_MODE environment variabe is set, everything
+# is installed to temporary directory after build and
+# uninstalled before cleaning.
+# This feature may be useful for development
+# and was proposed by Michael Crogan.
+PREFIX = ${TMPPREFIX}
+INSTALL = mkc_install
+COPY = -l # symlinks instead of copying/moving
+post_all: install
+pre_clean: uninstall
+.endif
diff --git a/examples/hello_superfs/expect.out b/examples/hello_superfs/expect.out
index 45af717..3e0ab3e 100644
--- a/examples/hello_superfs/expect.out
+++ b/examples/hello_superfs/expect.out
@@ -147,3 +147,15 @@
/objdir/mkfs_superfs/mkfs_superfs.cat8
/objdir/mkfs_superfs/mkfs_superfs.o
/objdir/test.mk
+=========== Michael mode: all ============
+/objdir/tmp/man/cat8/fsck_superfs.0
+/objdir/tmp/man/cat8/mkfs_superfs.0
+/objdir/tmp/man/man8/fsck_superfs.8
+/objdir/tmp/man/man8/mkfs_superfs.8
+/objdir/tmp/sbin/fsck_superfs
+/objdir/tmp/sbin/mkfs_superfs
+/objdir/tmp/share/doc/dict/LICENSE
+/objdir/tmp/share/doc/dict/NEWS
+/objdir/tmp/share/doc/dict/README
+=========== Michael mode: clean ============
+=========== Michael mode: cleandir ============
diff --git a/examples/hello_superfs/test.mk b/examples/hello_superfs/test.mk
index 90f220d..d7b0b98 100644
--- a/examples/hello_superfs/test.mk
+++ b/examples/hello_superfs/test.mk
@@ -1,3 +1,5 @@
+next_level != expr ${.MAKE.LEVEL} + 1
+
.PHONY : test_output
test_output:
@set -e; \
@@ -45,9 +47,28 @@ test_output:
${MAKE} ${MAKEFLAGS} all installdirs install -j3 DESTDIR=${.OBJDIR} \
> /dev/null; \
find ${.OBJDIR} -type f -o -type l | \
+ mkc_test_helper "${PREFIX}" "${.OBJDIR}"; unset MKINSTALL; \
+ \
+ echo =========== Michael mode: all ============; \
+ MICHAEL_MODE=1; export MICHAEL_MODE; \
+ env init_make_level=${next_level} ${MAKE} ${MAKEFLAGS} all > /dev/null 2>&1; \
+ find ${TMPPREFIX} -type l | \
+ mkc_test_helper "${PREFIX}" "${.OBJDIR}"; \
+ \
+ echo =========== Michael mode: clean ============; \
+ env init_make_level=${next_level} ${MAKE} ${MAKEFLAGS} clean > /dev/null 2>&1; \
+ find ${TMPPREFIX} -type f -o -type l | \
+ mkc_test_helper "${PREFIX}" "${.OBJDIR}"; \
+ \
+ echo =========== Michael mode: cleandir ============; \
+ env init_make_level=${next_level} ${MAKE} ${MAKEFLAGS} all > /dev/null 2>&1; \
+ env init_make_level=${next_level} ${MAKE} ${MAKEFLAGS} cleandir > /dev/null 2>&1; \
+ find ${TMPPREFIX} -type f -o -type l | \
mkc_test_helper "${PREFIX}" "${.OBJDIR}"; \
\
true ======= distclean ==========; \
${MAKE} ${MAKEFLAGS} distclean DESTDIR=${.OBJDIR} > /dev/null
+CLEANDIRS += ${TMPPREFIX}
+
.include <mkc.minitest.mk>