]> andersk Git - libyaml.git/commitdiff
Add a `.makefile` for immediate make targets
authorIngy döt Net <ingy@ingy.net>
Mon, 2 Jan 2017 00:49:18 +0000 (16:49 -0800)
committerIngy döt Net <ingy@ingy.net>
Mon, 2 Jan 2017 18:29:32 +0000 (10:29 -0800)
We can add various development activities to this alternate Makefile.

If you do this first:
```
ln {.,GNU}makefile
```

then you can use the new targets and the old ones without specifying the
`.makefile` in make commands and without worrying about bootstrap.

ie Before this, to use Makefile targets, you needed to run `./bootstrap`
and `./configure` first. This file will proxy all common Makefile
targets, first making sure that the Makefile exists.

.gitignore
.makefile [new file with mode: 0644]

index f1a0b64e8a78778846a9fcac2671feadbaec41e5..5eb86f5ce6bb18bea0ed081ca79265065e8d57e4 100644 (file)
@@ -9,6 +9,7 @@
 /CMakeCache.txt
 /CMakeFiles/
 /CTestTestfile.cmake
+/GNUmakefile
 /Makefile
 Makefile.in
 /Testing/
diff --git a/.makefile b/.makefile
new file mode 100644 (file)
index 0000000..af4625b
--- /dev/null
+++ b/.makefile
@@ -0,0 +1,57 @@
+# This file is used for common development targets that can be done with
+# needing the cumbersome bootstrapping process.
+#
+# You can use it like this:
+#
+#   make -f .makefile indent
+#
+# If you copy or link this file to `GNUmakefile` then you can just do:
+#
+#   make indent
+#
+# When copied to `GNUmakefile`, this file is can also be used for bootstrapping
+# Makefile targets. Since GNUmakefile is loaded before Makefile, we do the
+# bootstrapping tasks need to get a Makefile first, then we use the Makefile to
+# make our target.
+
+MAKE_TARGETS := \
+       all \
+       all-am \
+       all-recursive \
+       install \
+       test \
+       test-all \
+       test-suite \
+
+# SOURCE_FILES := $(shell find . | grep '\.c$$')
+SOURCE_FILES := $(shell find tests/run-test-suite | grep '\.c$$')
+ifneq ($(shell which gindent),)
+INDENT := gindent
+else
+INDENT := indent
+endif
+
+#
+# Proxy make targets:
+#
+default: all
+
+# Proxy these targets to the real Makefile, after bootstrapping is necessary.
+$(MAKE_TARGETS): Makefile
+       @make -f $< $@
+
+Makefile: Makefile.in
+       ./configure
+
+Makefile.in:
+       ./bootstrap
+
+#
+# Development make targets:
+#
+indent:
+       $(INDENT) $(SOURCE_FILES)
+
+distclean purge:
+       rm -fr tests/run-test-suite/data
+       git clean -dxf -e GNUmakefile
This page took 0.068326 seconds and 5 git commands to generate.