From f5dcdf55fba21d7fa0aa92f76aeb365c680e5fdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Thu, 14 May 2015 23:32:13 +0300 Subject: Add ASN.1 compilation support --- core/erlc.mk | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'core/erlc.mk') 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 -- cgit v1.2.3