generated from martinthomson/internet-draft-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
32 lines (24 loc) · 839 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
LIBDIR := lib
include $(LIBDIR)/main.mk
$(LIBDIR)/main.mk:
ifneq (,$(shell grep "path *= *$(LIBDIR)" .gitmodules 2>/dev/null))
git submodule sync
git submodule update --init
else
ifneq (,$(wildcard $(ID_TEMPLATE_HOME)))
ln -s "$(ID_TEMPLATE_HOME)" $(LIBDIR)
else
git clone -q --depth 10 -b main \
https://github.com/martinthomson/i-d-template $(LIBDIR)
endif
endif
include cddl/ear-json-frags.mk
include cddl/ear-cbor-frags.mk
define cddl_targets
$(drafts_xml):: cddl/$(1)-autogen.cddl
cddl/$(1)-autogen.cddl: $(addprefix cddl/,$(2)) $(addprefix cddl/examples/,$(3))
$(MAKE) -C cddl check-$(1) check-$(1)-examples
endef # cddl_targets
$(eval $(call cddl_targets,ear-json,$(EAR_JSON_FRAGS),$(EAR_JSON_EXAMPLES)))
$(eval $(call cddl_targets,ear-cbor,$(EAR_CBOR_FRAGS),$(EAR_CBOR_EXAMPLES)))
clean:: ; $(MAKE) -C cddl clean