summaryrefslogtreecommitdiff
path: root/GNUmakefile.in
diff options
context:
space:
mode:
authorPaweł Forysiuk <tuxator@o2.pl>2013-10-10 15:03:06 +0200
committerPaweł Forysiuk <tuxator@o2.pl>2013-10-10 15:03:06 +0200
commit107bce21a9bb760da42bd2d167484dd92b04234c (patch)
tree8b70fb207490a076b1e0a4d2acb173869ce7a6a9 /GNUmakefile.in
parent4a2b8a1a3085801f68b274a933fc0776f95940de (diff)
downloadmidori-git-107bce21a9bb760da42bd2d167484dd92b04234c.tar.gz
Add dummy makefile to emulate autotools workflow
Diffstat (limited to 'GNUmakefile.in')
-rw-r--r--GNUmakefile.in27
1 files changed, 27 insertions, 0 deletions
diff --git a/GNUmakefile.in b/GNUmakefile.in
new file mode 100644
index 00000000..b1459a56
--- /dev/null
+++ b/GNUmakefile.in
@@ -0,0 +1,27 @@
+# Based on "http://iany.me/wiki/Makefile/" by "Ian Yang" licensed under "CC by 3.0"
+
+BUILD_FOLDER := _build
+
+CUSTOM_TARGETS := cmake
+
+# Do not try to use custom target when invoking external makefile
+EXTERNAL_TARGETS := $(filter-out $(CUSTOM_TARGETS), $(MAKECMDGOALS))
+
+# Call all targets using `Makefile` in build directory in one `make` command.
+$(or $(lastword $(EXTERNAL_TARGETS)),all):
+ $(MAKE) -C $(BUILD_FOLDER) $(EXTERNAL_TARGETS)
+
+# If no targets are specified, use the dummy `all` target
+.PHONY: $(EXTERNAL_TARGETS) all
+
+# Do nothing for all targets but last. Also quiet the message "Noting to be done on xxx"
+$(filter-out $(lastword $(EXTERNAL_TARGETS)), $(EXTERNAL_TARGETS)):
+ @cd .
+
+cmake: $(BUILD_FOLDER)
+ cd $(BUILD_FOLDER) && cmake ..
+
+$(BUILD_FOLDER):
+ mkdir $(BUILD_FOLDER)
+
+.PHONY: cmake