aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2016-01-08 10:56:05 +0100
committerLoïc Hoguin <[email protected]>2016-01-08 10:56:05 +0100
commiteb4e97dc9f6bd5f568204172c347199f68b50460 (patch)
treefead353eb5e883e610865760659713233a5364f7
downloadefene.mk-eb4e97dc9f6bd5f568204172c347199f68b50460.tar.gz
efene.mk-eb4e97dc9f6bd5f568204172c347199f68b50460.tar.bz2
efene.mk-eb4e97dc9f6bd5f568204172c347199f68b50460.zip
Initial commit
-rw-r--r--LICENSE13
-rw-r--r--README.asciidoc17
-rw-r--r--plugins.mk52
3 files changed, 82 insertions, 0 deletions
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..5623bed
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,13 @@
+Copyright (c) 2016, Loïc Hoguin <[email protected]>
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/README.asciidoc b/README.asciidoc
new file mode 100644
index 0000000..f2185d2
--- /dev/null
+++ b/README.asciidoc
@@ -0,0 +1,17 @@
+= Efene.mk
+
+http://efene.org/[Efene] plugin for http://erlang.mk/[Erlang.mk]
+
+[source,make]
+----
+BUILD_DEPS = efene
+
+BUILD_DEPS = efene.mk
+dep_efene.mk = git https://github.com/ninenines/efene.mk master
+DEP_PLUGINS = efene.mk
+
+include erlang.mk
+----
+
+The command `make` will compile all Efene files in the 'src/'
+directory.
diff --git a/plugins.mk b/plugins.mk
new file mode 100644
index 0000000..7239f3f
--- /dev/null
+++ b/plugins.mk
@@ -0,0 +1,52 @@
+# Copyright (c) 2016, Loïc Hoguin <[email protected]>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+# Verbosity.
+
+efene_verbose_0 = @echo " FN " $(filter %.fn,$(?F));
+efene_verbose = $(efene_verbose_$(V))
+
+# Core targets.
+
+FN_FILES = $(sort $(call core_find,src/,*.fn))
+
+ifneq ($(FN_FILES),)
+
+BEAM_FILES += $(addprefix ebin/,$(patsubst %.fn,%.beam,$(notdir $(FN_FILES))))
+
+# Rebuild Efene modules when the Makefile changes.
+$(FN_FILES): $(MAKEFILE_LIST)
+ @touch $@
+
+define efene_compile.erl
+ [begin
+ case efene:compile(F, "ebin/", $2) of
+ E = {error, _} ->
+ efene:print_errors([E], "errors");
+ {error, Errors, Warnings} ->
+ efene:print_errors(Errors, "errors"),
+ efene:print_errors(Warnings, "warnings");
+ {ok, CompileInfo} ->
+ efene:print_errors(proplists:get_value(warnings, CompileInfo, []), "warnings")
+ end
+ end || F <- string:tokens("$1", " ")],
+ halt().
+endef
+
+ebin/$(PROJECT).app:: $(FN_FILES) | ebin/
+ $(if $(strip $?),$(efene_verbose) $(call erlang,\
+ $(call efene_compile.erl,$?,$(call compat_erlc_opts_to_list,$(ERLC_OPTS))),\
+ -pa $(DEPS_DIR)/efene/ebin))
+
+endif