From eb4e97dc9f6bd5f568204172c347199f68b50460 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Fri, 8 Jan 2016 10:56:05 +0100 Subject: Initial commit --- LICENSE | 13 +++++++++++++ README.asciidoc | 17 +++++++++++++++++ plugins.mk | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 LICENSE create mode 100644 README.asciidoc create mode 100644 plugins.mk 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 + +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 +# +# 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 -- cgit v1.2.3