Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion funcs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,23 @@ $(3)$(1).cddl: $(2)

CLEANFILES += $(3)$(1).cddl

endef # cddl_exp_template
endef # cddl_exp_template

# $(1) - imported cddl file name without .cddl
# $(2) - github url
# $(3) - download location
# $(4) - cddl-xxxx tag name
define get_cddl_release

get-$(1): $(1).cddl
echo "Fetched cddl-release: " $$^

$(1).cddl:
@{ \
$$(curl) -LO $$(join $(2), $$(join $(3), $$(join $(4)/, $$@))); \
sed -i.bak 's/^@\.start\.@//' $$@; \
}

.PHONY: get-$(1)
CLEANFILES += $(1).cddl.bak
endef # get_cddl_release
12 changes: 6 additions & 6 deletions imports/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ SHELL := /bin/bash
include ../tools.mk
include ../funcs.mk

check:: corim-autogen.cddl
check:: get-corim-autogen

# Get corim-autogen.cddl
github := https://github.com/ietf-rats-wg/
corim_rel_dl := draft-ietf-rats-corim/releases/download/
corim_tag := cddl-8c267cd
corim_url := $(join $(github), $(join $(corim_rel_dl), $(corim_tag)))
CORIM := corim-autogen
CORIM_REPO := https://github.com/ietf-rats-wg/
CORIM_DL := draft-ietf-rats-corim/releases/download/
CORIM_TAG := cddl-8c267cd
$(eval $(call get_cddl_release,$(CORIM),$(CORIM_REPO),$(CORIM_DL),$(CORIM_TAG)))

corim-autogen.cddl: ; $(curl) -LO $(corim_url)/$@ ; grep -v '^@\.start\.@' $@ > $@.tmp ; mv $@.tmp $@

CLEANFILES += corim-autogen.cddl

Expand Down