aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-05-14 23:32:13 +0300
committerLoïc Hoguin <[email protected]>2015-05-14 23:32:13 +0300
commitf5dcdf55fba21d7fa0aa92f76aeb365c680e5fdf (patch)
treeb5a6152386f507847e16d135a1999431d4b751cc /core
parent91f35af32d0f4acaf3f52bbe52abd239ce103b95 (diff)
downloaderlang.mk-f5dcdf55fba21d7fa0aa92f76aeb365c680e5fdf.tar.gz
erlang.mk-f5dcdf55fba21d7fa0aa92f76aeb365c680e5fdf.tar.bz2
erlang.mk-f5dcdf55fba21d7fa0aa92f76aeb365c680e5fdf.zip
Add ASN.1 compilation support
Diffstat (limited to 'core')
-rw-r--r--core/erlc.mk16
1 files changed, 16 insertions, 0 deletions
diff --git a/core/erlc.mk b/core/erlc.mk
index dc488a5..18e8814 100644
--- a/core/erlc.mk
+++ b/core/erlc.mk
@@ -28,6 +28,9 @@ erlc_verbose = $(erlc_verbose_$(V))
xyrl_verbose_0 = @echo " XYRL " $(filter %.xrl %.yrl,$(?F));
xyrl_verbose = $(xyrl_verbose_$(V))
+asn1_verbose_0 = @echo " ASN1 " $(filter %.asn1,$(?F));
+asn1_verbose = $(asn1_verbose_$(V))
+
mib_verbose_0 = @echo " MIB " $(filter %.bin %.mib,$(?F));
mib_verbose = $(mib_verbose_$(V))
@@ -69,6 +72,13 @@ define compile_xyrl
@rm ebin/*.erl
endef
+define compile_asn1
+ $(asn1_verbose) erlc -v -I include/ -o ebin/ $(1)
+ @mv ebin/*.hrl include/
+ @mv ebin/*.asn1db include/
+ @rm ebin/*.erl
+endef
+
define compile_mib
$(mib_verbose) erlc -v $(ERLC_MIB_OPTS) -o priv/mibs/ \
-I priv/mibs/ $(COMPILE_MIB_FIRST_PATHS) $(1)
@@ -79,6 +89,12 @@ ifneq ($(wildcard src/),)
ebin/$(PROJECT).app::
@mkdir -p ebin/
+ifneq ($(wildcard asn1/),)
+ebin/$(PROJECT).app:: $(shell find asn1 -type f -name \*.asn1)
+ @mkdir -p include
+ $(if $(strip $?),$(call compile_asn1,$?))
+endif
+
ifneq ($(wildcard mibs/),)
ebin/$(PROJECT).app:: $(shell find mibs -type f -name \*.mib)
@mkdir -p priv/mibs/ include