Repository navigation
Expand file tree
/
Copy pathMakefile.am
More file actions
192 lines (155 loc) · 6.43 KB
/
Copy pathMakefile.am
File metadata and controls
192 lines (155 loc) · 6.43 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
AM_CFLAGS = $(WARN_CFLAGS) -I$(top_srcdir)/src -I$(top_builddir)/src $(JSON_C_CFLAGS)
CLEANFILES = $(man_MANS) src/runtime_spec_stamp src/image_spec_stamp src/image_manifest_stamp src/basic-test_stamp
GITIGNOREFILES = build-aux/ gtk-doc.make config.h.in aclocal.m4
if ENABLE_LIBOCISPEC_INSTALL
lib_LTLIBRARIES = libocispec.la
lib_LIBRARIES = libocispec.a
else
noinst_LTLIBRARIES = libocispec.la
noinst_LIBRARIES = libocispec.a
endif
IMAGE_SPEC_SOURCES = \
src/ocispec/image_spec_schema_config_schema.c \
src/ocispec/image_spec_schema_content_descriptor.c \
src/ocispec/image_spec_schema_defs.c \
src/ocispec/image_spec_schema_defs_descriptor.c \
src/ocispec/image_spec_schema_image_index_schema.c \
src/ocispec/image_spec_schema_image_layout_schema.c \
src/ocispec/image_spec_schema_image_manifest_schema.c
RUNTIME_SPEC_SOURCES = \
src/ocispec/runtime_spec_schema_config_freebsd.c \
src/ocispec/runtime_spec_schema_config_linux.c \
src/ocispec/runtime_spec_schema_config_schema.c \
src/ocispec/runtime_spec_schema_config_solaris.c \
src/ocispec/runtime_spec_schema_config_vm.c \
src/ocispec/runtime_spec_schema_config_windows.c \
src/ocispec/runtime_spec_schema_config_zos.c \
src/ocispec/runtime_spec_schema_defs.c \
src/ocispec/runtime_spec_schema_defs_freebsd.c \
src/ocispec/runtime_spec_schema_defs_linux.c \
src/ocispec/runtime_spec_schema_defs_vm.c \
src/ocispec/runtime_spec_schema_defs_windows.c \
src/ocispec/runtime_spec_schema_defs_zos.c \
src/ocispec/runtime_spec_schema_features_linux.c \
src/ocispec/runtime_spec_schema_features_schema.c \
src/ocispec/runtime_spec_schema_state_schema.c
IMAGE_MANIFEST_SOURCES = \
src/ocispec/image_manifest_items_image_manifest_items_schema.c
BASIC_TEST_SOURCES = \
src/ocispec/basic_test_double_array.c \
src/ocispec/basic_test_double_array_item.c \
src/ocispec/basic_test_int64_values.c \
src/ocispec/basic_test_map_string_string_array.c \
src/ocispec/basic_test_top_array_int.c \
src/ocispec/basic_test_top_array_string.c \
src/ocispec/basic_test_top_double_array_int.c \
src/ocispec/basic_test_top_double_array_obj.c \
src/ocispec/basic_test_top_double_array_refobj.c \
src/ocispec/basic_test_top_double_array_string.c
SOURCE_FILES = $(IMAGE_SPEC_SOURCES) $(RUNTIME_SPEC_SOURCES) \
$(IMAGE_MANIFEST_SOURCES) $(BASIC_TEST_SOURCES)
HEADER_FILES = $(SOURCE_FILES:.c=.h)
if ENABLE_LIBOCISPEC_INSTALL
ocispec_includedir = $(includedir)/ocispec
ocispec_include_HEADERS = $(HEADER_FILES) \
src/ocispec/json_common.h
endif
GENERATOR_FILES = \
src/ocispec/generate.py \
src/ocispec/headers.py \
src/ocispec/helpers.py \
src/ocispec/json_api.py \
src/ocispec/sources.py
STAMP_DEPS = src/ocispec/json_common.h src/ocispec/json_common.c $(GENERATOR_FILES)
src/runtime_spec_stamp: $(STAMP_DEPS)
$(PYTHON) $(srcdir)/src/ocispec/generate.py --gen-ref --root=${srcdir} --out=${builddir}/src/ocispec ${srcdir}/runtime-spec/schema
@touch $@
src/image_spec_stamp: $(STAMP_DEPS)
$(PYTHON) $(srcdir)/src/ocispec/generate.py --gen-ref --root=${srcdir} --out=${builddir}/src/ocispec ${srcdir}/image-spec/schema
@touch $@
src/image_manifest_stamp: $(STAMP_DEPS)
$(PYTHON) $(srcdir)/src/ocispec/generate.py --gen-ref --root=${srcdir}/tests/test-spec --out=${builddir}/src/ocispec ${srcdir}/tests/test-spec/imageManifestItems
@touch $@
src/basic-test_stamp: $(STAMP_DEPS)
$(PYTHON) $(srcdir)/src/ocispec/generate.py --gen-ref --root=${srcdir}/tests/test-spec --out=${builddir}/src/ocispec ${srcdir}/tests/test-spec/basic
@touch $@
# Each group of sources and matching headers comes out of one generator run.
$(IMAGE_SPEC_SOURCES) $(IMAGE_SPEC_SOURCES:.c=.h): src/image_spec_stamp
$(RUNTIME_SPEC_SOURCES) $(RUNTIME_SPEC_SOURCES:.c=.h): src/runtime_spec_stamp
$(IMAGE_MANIFEST_SOURCES) $(IMAGE_MANIFEST_SOURCES:.c=.h): src/image_manifest_stamp
$(BASIC_TEST_SOURCES) $(BASIC_TEST_SOURCES:.c=.h): src/basic-test_stamp
BUILT_SOURCES = $(HEADER_FILES) $(SOURCE_FILES)
libocispec_la_SOURCES = $(BUILT_SOURCES) \
src/ocispec/json_common.c
TMP_H_FILES = $(HEADER_FILES:.h=.h.tmp)
TMP_C_FILES = $(SOURCE_FILES:.c=.c.tmp)
CLEANFILES += $(HEADER_FILES) $(SOURCE_FILES) $(TMP_H_FILES) $(TMP_C_FILES)
# Default for every program built here; no per-program _LDADD needed.
LDADD = libocispec.la $(SELINUX_LIBS) $(JSON_C_LIBS)
libocispec_a_SOURCES =
libocispec.a: libocispec.la $(BUILT_SOURCES) src/runtime_spec_stamp src/image_spec_stamp src/image_manifest_stamp src/basic-test_stamp
$(LIBTOOL) --mode=link $(GCC) libocispec.la -o libocispec.a
if ENABLE_LIBOCISPEC_INSTALL
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = ocispec.pc
endif
TESTS = tests/test-1 \
tests/test-2 \
tests/test-3 \
tests/test-4 \
tests/test-5 \
tests/test-6 \
tests/test-7 \
tests/test-8 \
tests/test-9 \
tests/test-10 \
tests/test-11 \
tests/test-12 \
tests/test-13 \
tests/test-14 \
tests/test-15 \
tests/test-16 \
tests/test-17
noinst_PROGRAMS = src/ocispec/validate $(TESTS)
$(abs_top_builddir)/tests/data: $(abs_top_srcdir)/tests/data
if test $(abs_top_srcdir) != $(abs_top_builddir) && test ! -d $@; then rm -f $@; ln -s $< $@; fi
distcheck check: $(abs_top_builddir)/tests/data
-include $(top_srcdir)/git.mk
EXTRA_DIST = autogen.sh \
tests/data/image_index_config.json \
tests/data/image_layout_config.json \
tests/data/image_config_mapstringobject.json \
tests/data/config.json \
tests/data/image_manifest.json \
tests/data/image_config.json \
tests/data/config.nocwd.json \
tests/data/image_manifest_item.json \
tests/data/residual_image_layout_config.json \
tests/data/null_value_config.json \
tests/data/doublearray.json \
tests/data/top_array_int.json \
tests/data/top_array_string.json \
tests/data/top_double_array_int.json \
tests/data/top_double_array_obj.json \
tests/data/top_double_array_refobj.json \
tests/data/top_double_array_string.json \
tests/data/config-netdevices.json \
tests/data/map-string-string-array.json \
tests/data/int64_values.json \
tests/test-spec \
$(GENERATOR_FILES) \
$(HEADER_FILES) \
runtime-spec \
image-spec \
src/ocispec/json_common.h \
src/ocispec/json_common.c
sync:
(cd image-spec; git pull https://github.com/opencontainers/image-spec)
(cd runtime-spec; git pull https://github.com/opencontainers/runtime-spec)
generate: src/runtime_spec_stamp src/image_spec_stamp src/image_manifest_stamp src/basic-test_stamp
#Needed by phony: generate-rust
install-node-deps:
(npm install @apidevtools/json-schema-ref-parser)
(npm install quicktype-core)
generate-rust:
(node rust-gen.js)