changeset 308:8523fb0c8540

make: add run target
author David Demelier <markand@malikania.fr>
date Fri, 09 Jul 2021 11:29:36 +0200
parents 363024b76da7
children 0858e33a762d
files .hgignore GNUmakefile INSTALL.md
diffstat 3 files changed, 23 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Tue Jun 29 09:49:48 2021 +0200
+++ b/.hgignore	Fri Jul 09 11:29:36 2021 +0200
@@ -8,8 +8,8 @@
 assets/.*\.h$
 ^config\.h$
 
-# fakeroot directory.
-^fakeroot
+# out directory.
+^out
 
 # vim/emacs specific.
 ^tags$
--- a/GNUmakefile	Tue Jun 29 09:49:48 2021 +0200
+++ b/GNUmakefile	Fri Jul 09 11:29:36 2021 +0200
@@ -509,6 +509,18 @@
 
 # }}}
 
+# {{{ run
+
+out: ${LIBMLK_DATA_ASTS} ${TARGETS}
+	mkdir -p out
+	${MAKE} DESTDIR=out install-data install
+	touch out
+
+run: out
+	@./out/${PREFIX}/${BINDIR}/mlk-adventure
+
+# }}}
+
 install:
 	mkdir -p ${DESTDIR}${PREFIX}/${BINDIR}
 	cp ${TOOLS} ${TARGETS} ${DESTDIR}${PREFIX}/${BINDIR}
@@ -540,4 +552,4 @@
 
 # }}}
 
-.PHONY: all clean examples everything install install-data pot tests tools
+.PHONY: all clean examples everything install install-data pot run tests tools
--- a/INSTALL.md	Tue Jun 29 09:49:48 2021 +0200
+++ b/INSTALL.md	Fri Jul 09 11:29:36 2021 +0200
@@ -32,7 +32,7 @@
 - `tools`: build tools (e.g. molko-map).
 - `tests`: build tests and run them.
 - `everything`: build molko, tools and tests without running them.
-- `fakeroot`: create a runnable local directory.
+- `run`: run molko with data installed in the source tree.
 
 Direct use in source tree
 -------------------------
@@ -45,19 +45,15 @@
 do this without root access by using a temporary directory and set the
 `MLK_ROOT` environment variable.
 
-	$ make DESTDIR=datadir install
-	$ MLK_ROOT=datadir ./mlk-adventure/mlk-adventure
-	(or to run examples)
-	$ MLK_ROOT=datadir ./examples/
+The directory `out` is recommended, see below.
 
-Note: you need rsync installed, in contrast to `install` with a `DESTDIR`
-      macro it only copies runtime data and avoid re-copying what didn't
-      change for a faster experience.
+	$ make DESTDIR=out install-data
+	$ MLK_ROOT=out ./mlk-adventure/mlk-adventure
+	(or to run examples:)
+	$ MLK_ROOT=out ./examples/example-action/main
 
-	$ make all examples
-	$ ./fakeroot/bin/mlk-adventure
-	(or)
-	$ ./fakeroot/bin/example-action
+There is a special target `run` that automatically create the diretory `out`
+with all data and binaries installed and runs `mlk-adventure`.
 
 Platform: Windows
 -----------------