Skip to content

Commit e812686

Browse files
author
Ned Smith
authored
Merge pull request #50 from TrustedComputingGroup/corim-releses-part2
import corim from cddl-releases
2 parents 3e4ce45 + 2a9438e commit e812686

File tree

12 files changed

+44
-1340
lines changed

12 files changed

+44
-1340
lines changed

Makefile

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ CE_DIR := ./
99
include tools.mk
1010
include funcs.mk
1111

12-
#
13-
# manually link newly built corim dependencies to imports/corim-import.cddl
14-
#
15-
CORIM_IMPORT := $(addprefix $(IMPORTS_DIR), corim-import.cddl )
12+
# Get imports frags - no dependencies
13+
include $(IMPORTS_DIR)import-frags.mk
14+
IMPORT_DEPS := $(addprefix $(IMPORTS_DIR), $(IMPORT_FRAGS))
1615

1716
check:: check-cose check-cose-examples
1817
check:: check-eat check-eat-examples
@@ -24,51 +23,57 @@ check:: exp-ce
2423
include $(CE_DIR)ce-frags.mk
2524
CE_DEPS := $(addprefix $(CE_DIR), $(CE_FRAGS))
2625

26+
SPDM_START := spdm-toc
2727
SPDM_FRAGS += $(CE_DEPS)
28-
SPDM_FRAGS += $(CORIM_IMPORT)
28+
SPDM_FRAGS += $(IMPORT_DEPS)
2929

3030
SPDM_EXAMPLES := $(wildcard examples/spdm-*.diag) # spdm toc example filenames have 'spdm-' prefix
3131

32-
$(eval $(call cddl_check_template,spdm,$(SPDM_FRAGS),$(SPDM_EXAMPLES)))
32+
$(eval $(call cddl_check_template,spdm,$(SPDM_FRAGS),$(SPDM_EXAMPLES),$(SPDM_START)))
3333

34-
EV_FRAGS := ce-start.cddl
34+
EV_START := tagged-concise-evidence
3535
EV_FRAGS += $(CE_DEPS)
36-
EV_FRAGS += $(CORIM_IMPORT)
36+
EV_FRAGS += $(IMPORT_DEPS)
3737

3838
EV_EXAMPLES := $(wildcard examples/ce-*.diag) # concise-evidence example filenames have 'ce-' prefix
3939

40-
$(eval $(call cddl_check_template,ce,$(EV_FRAGS),$(EV_EXAMPLES)))
40+
$(eval $(call cddl_check_template,ce,$(EV_FRAGS),$(EV_EXAMPLES),$(EV_START)))
4141

42-
COMID_X_FRAGS := comid-x-start.cddl
42+
COMID_X_START := concise-mid-tag
4343
COMID_X_FRAGS += $(CE_DEPS)
44-
COMID_X_FRAGS += $(CORIM_IMPORT)
44+
COMID_X_FRAGS += $(IMPORT_DEPS)
4545

4646
COMID_X_EXAMPLES := $(wildcard examples/comid-*.diag) # concise-mid-tag example filenames have 'comid-' prefix
4747

48-
$(eval $(call cddl_check_template,comidx,$(COMID_X_FRAGS),$(COMID_X_EXAMPLES)))
48+
$(eval $(call cddl_check_template,comidx,$(COMID_X_FRAGS),$(COMID_X_EXAMPLES),$(COMID_X_START)))
4949

50-
EAT_FRAGS := eat-start.cddl
50+
EAT_START := cwt-eat
5151
EAT_FRAGS += $(CE_DEPS)
52-
EAT_FRAGS += $(CORIM_IMPORT)
52+
EAT_FRAGS += $(IMPORT_DEPS)
5353
EAT_FRAGS += cwt-eat.cddl
5454

5555
EAT_EXAMPLES := $(wildcard examples/eat-*.diag) # eat example filenames have 'eat-' prefix
5656

57-
$(eval $(call cddl_check_template,eat,$(EAT_FRAGS),$(EAT_EXAMPLES)))
57+
$(eval $(call cddl_check_template,eat,$(EAT_FRAGS),$(EAT_EXAMPLES),$(EAT_START)))
5858

59-
COSE_FRAGS := cose-start.cddl
59+
COSE_START := signed-cwt
6060
COSE_FRAGS += $(CE_DEPS)
61-
COSE_FRAGS += $(CORIM_IMPORT)
61+
COSE_FRAGS += $(IMPORT_DEPS)
6262
COSE_FRAGS += cwt-eat.cddl
6363

6464
COSE_EXAMPLES := $(wildcard examples/cose-*.diag) # signed cwt example filenames have 'cose-' prefix
6565

66-
$(eval $(call cddl_check_template,cose,$(COSE_FRAGS),$(COSE_EXAMPLES)))
66+
$(eval $(call cddl_check_template,cose,$(COSE_FRAGS),$(COSE_EXAMPLES),$(COSE_START)))
67+
68+
$(IMPORT_DEPS): check-imports
69+
70+
check-imports:
71+
$(MAKE) -C $(IMPORTS_DIR)
6772

6873
# Make ce.cddl export file
6974
$(eval $(call cddl_exp_template,ce,$(CE_DEPS)))
7075

71-
clean: ; rm -f $(CLEANFILES)
76+
clean: ; rm -f $(CLEANFILES); $(MAKE) -C $(IMPORTS_DIR) clean
7277

7378
exce: ce-autogen.cddl
7479
@echo -n "copying ce.cddl to exports"

ce-start.cddl

Lines changed: 0 additions & 1 deletion
This file was deleted.

comid-x-start.cddl

Lines changed: 0 additions & 1 deletion
This file was deleted.

cose-start.cddl

Lines changed: 0 additions & 1 deletion
This file was deleted.

eat-start.cddl

Lines changed: 0 additions & 1 deletion
This file was deleted.

funcs.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# $1: label
44
# $2: cddl fragments
55
# $3: diag test files
6+
# $4: start string
67
define cddl_check_template
78

89
check-$(1): $(1)-autogen.cddl
@@ -11,7 +12,7 @@ check-$(1): $(1)-autogen.cddl
1112
.PHONY: check-$(1)
1213

1314
$(1)-autogen.cddl: $(2)
14-
for f in $$^ ; do ( grep -v '^;' $$$$f ; echo ) ; done > $$@
15+
$(cddlc) -2tcddl $$^ --start=$(4) > $$@
1516

1617
CLEANFILES += $(1)-autogen.cddl
1718

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
1+
.DEFAULT_GOAL := check
2+
3+
SHELL := /bin/bash
4+
15
include ../tools.mk
6+
include ../funcs.mk
27

3-
github := https://github.com/ietf/
8+
check:: corim-autogen.cddl
9+
10+
# Get corim-autogen.cddl
11+
github := https://github.com/ietf-rats-wg/
412
corim_rel_dl := draft-ietf-rats-corim/releases/download/
5-
corim_tag := cddl-tbd
13+
corim_tag := cddl-8c267cd
614
corim_url := $(join $(github), $(join $(corim_rel_dl), $(corim_tag)))
715

816
corim-autogen.cddl: ; $(curl) -LO $(corim_url)/$@
917

1018
CLEANFILES += corim-autogen.cddl
19+
20+
clean: ; rm $(CLEANFILES)

0 commit comments

Comments
 (0)