22
33SHELL := /bin/bash
44
5- IMPORTS_DIR := imports/
6- export EXPORTS_DIR := exports/
75CE_DIR := ./
6+ IMPORTS_DIR := $(CE_DIR ) imports/
7+ EXPORTS_DIR := $(CE_DIR ) exports/
88
99include tools.mk
1010include funcs.mk
1111
1212# Get imports frags - no dependencies
1313include $(IMPORTS_DIR ) import-frags.mk
1414IMPORT_DEPS := $(addprefix $(IMPORTS_DIR ) , $(IMPORT_FRAGS ) )
15-
16- check :: check-cose check-cose-examples
17- check :: check-eat check-eat-examples
18- check :: check-comidx check-comidx-examples
19- check :: check-spdm check-spdm-examples
20- check :: check-ce check-ce-examples
21- check :: exp-coev
15+ COSE: =cose
16+ SPDM: =spdm
17+ CE: =ce
18+ COMIDX: =comidx
19+ EAT: =eat
20+ check :: check-$(COSE ) check-$(COSE ) -examples
21+ check :: check-$(EAT ) check-$(EAT ) -examples
22+ check :: check-$(COMIDX ) check-$(COMIDX ) -examples
23+ check :: check-$(SPDM ) check-$(SPDM ) -examples
24+ check :: check-$(CE ) check-$(CE ) -examples
25+ check :: export-all
2226
2327include $(CE_DIR ) ce-frags.mk
2428CE_DEPS := $(addprefix $(CE_DIR ) , $(CE_FRAGS ) )
@@ -29,23 +33,23 @@ SPDM_FRAGS += $(IMPORT_DEPS)
2933
3034SPDM_EXAMPLES := $(wildcard examples/spdm-* .diag) # spdm toc example filenames have 'spdm-' prefix
3135
32- $(eval $(call cddl_check_template,spdm ,$(SPDM_FRAGS),$(SPDM_EXAMPLES),$(SPDM_START)))
36+ $(eval $(call cddl_check_template,$(SPDM) ,$(SPDM_FRAGS),$(SPDM_EXAMPLES),$(SPDM_START)))
3337
3438EV_START := tagged-concise-evidence
3539EV_FRAGS += $(CE_DEPS )
3640EV_FRAGS += $(IMPORT_DEPS )
3741
3842EV_EXAMPLES := $(wildcard examples/ce-* .diag) # concise-evidence example filenames have 'ce-' prefix
3943
40- $(eval $(call cddl_check_template,ce ,$(EV_FRAGS),$(EV_EXAMPLES),$(EV_START)))
44+ $(eval $(call cddl_check_template,$(CE) ,$(EV_FRAGS),$(EV_EXAMPLES),$(EV_START)))
4145
4246COMID_X_START := concise-mid-tag
4347COMID_X_FRAGS += $(CE_DEPS )
4448COMID_X_FRAGS += $(IMPORT_DEPS )
4549
4650COMID_X_EXAMPLES := $(wildcard examples/comid-* .diag) # concise-mid-tag example filenames have 'comid-' prefix
4751
48- $(eval $(call cddl_check_template,comidx ,$(COMID_X_FRAGS),$(COMID_X_EXAMPLES),$(COMID_X_START)))
52+ $(eval $(call cddl_check_template,$(COMIDX) ,$(COMID_X_FRAGS),$(COMID_X_EXAMPLES),$(COMID_X_START)))
4953
5054EAT_START := cwt-eat
5155EAT_FRAGS += $(CE_DEPS )
@@ -54,7 +58,7 @@ EAT_FRAGS += cwt-eat.cddl
5458
5559EAT_EXAMPLES := $(wildcard examples/eat-* .diag) # eat example filenames have 'eat-' prefix
5660
57- $(eval $(call cddl_check_template,eat ,$(EAT_FRAGS),$(EAT_EXAMPLES),$(EAT_START)))
61+ $(eval $(call cddl_check_template,$(EAT) ,$(EAT_FRAGS),$(EAT_EXAMPLES),$(EAT_START)))
5862
5963COSE_START := signed-cwt
6064COSE_FRAGS += $(CE_DEPS )
@@ -63,14 +67,29 @@ COSE_FRAGS += cwt-eat.cddl
6367
6468COSE_EXAMPLES := $(wildcard examples/cose-* .diag) # signed cwt example filenames have 'cose-' prefix
6569
66- $(eval $(call cddl_check_template,cose ,$(COSE_FRAGS),$(COSE_EXAMPLES),$(COSE_START)))
70+ $(eval $(call cddl_check_template,$(COSE) ,$(COSE_FRAGS),$(COSE_EXAMPLES),$(COSE_START)))
6771
6872$(IMPORT_DEPS ) : check-imports
6973
7074check-imports :
7175 $(MAKE ) -C $(IMPORTS_DIR )
7276
73- # Make coev.cddl export file - used by cddl-releases
77+ # Make exports - used by cddl-releases
7478$(eval $(call cddl_exp_template,coev,$(CE_DEPS),$(EXPORTS_DIR),$(IMPORT_FRAGS)))
79+ AUTOGEN_FRAGS := $(addprefix $(CE_DIR ) , $(COSE ) -autogen.cddl)
80+ AUTOGEN_FRAGS += $(addprefix $(CE_DIR ) , $(SPDM ) -autogen.cddl)
81+ AUTOGEN_FRAGS += $(addprefix $(CE_DIR ) , $(CE ) -autogen.cddl)
82+ AUTOGEN_FRAGS += $(addprefix $(CE_DIR ) , $(COMIDX ) -autogen.cddl)
83+ AUTOGEN_FRAGS += $(addprefix $(CE_DIR ) , $(EAT ) -autogen.cddl)
84+
85+ AUTOGEN_EXPORTS := $(addprefix $(EXPORTS_DIR ) , $(COSE ) -autogen.cddl)
86+ AUTOGEN_EXPORTS += $(addprefix $(EXPORTS_DIR ) , $(SPDM ) -autogen.cddl)
87+ AUTOGEN_EXPORTS += $(addprefix $(EXPORTS_DIR ) , $(CE ) -autogen.cddl)
88+ AUTOGEN_EXPORTS += $(addprefix $(EXPORTS_DIR ) , $(COMIDX ) -autogen.cddl)
89+ AUTOGEN_EXPORTS += $(addprefix $(EXPORTS_DIR ) , $(EAT ) -autogen.cddl)
90+
91+ export-all : exp-coev check-$(COSE ) check-$(COMIDX ) check-$(SPDM ) check-$(CE ) check-$(EAT )
92+ cp $(AUTOGEN_FRAGS ) $(EXPORTS_DIR )
93+ CLEANFILES += $(AUTOGEN_EXPORTS )
7594
7695clean : ; rm -f $(CLEANFILES ) ; $(MAKE ) -C $(IMPORTS_DIR ) clean
0 commit comments