-
Notifications
You must be signed in to change notification settings - Fork 30
/
Makefile.am
275 lines (226 loc) · 9.66 KB
/
Makefile.am
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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
DIST_SUBDIRS = yajl
SUBDIRS = yajl
AM_CFLAGS = $(WARN_CFLAGS) -I$(top_srcdir)/src -I$(top_builddir)/src
if HAVE_EMBEDDED_YAJL
AM_CFLAGS += -I$(top_srcdir)/yajl/src/headers
endif HAVE_EMBEDDED_YAJL
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
SOURCE_FILES = \
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 \
src/ocispec/runtime_spec_schema_config_linux.c \
src/ocispec/runtime_spec_schema_config_zos.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_defs.c \
src/ocispec/runtime_spec_schema_defs_linux.c \
src/ocispec/runtime_spec_schema_defs_zos.c \
src/ocispec/runtime_spec_schema_defs_vm.c \
src/ocispec/runtime_spec_schema_defs_windows.c \
src/ocispec/runtime_spec_schema_state_schema.c \
src/ocispec/runtime_spec_schema_features_linux.c \
src/ocispec/runtime_spec_schema_features_schema.c \
src/ocispec/image_manifest_items_image_manifest_items_schema.c \
src/ocispec/basic_test_double_array_item.c \
src/ocispec/basic_test_double_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
HEADER_FILES = $(SOURCE_FILES:.c=.h)
if ENABLE_LIBOCISPEC_INSTALL
ocispec_includedir = $(includedir)/ocispec
ocispec_include_HEADERS = $(HEADER_FILES) \
src/ocispec/json_common.h \
src/ocispec/read-file.h
endif
src/runtime_spec_stamp: src/ocispec/json_common.h src/ocispec/json_common.c
$(PYTHON) $(srcdir)/src/ocispec/generate.py --gen-ref --root=${srcdir} --out=${builddir}/src/ocispec ${srcdir}/runtime-spec/schema
@touch $@
src/image_spec_stamp: src/ocispec/json_common.h src/ocispec/json_common.c
$(PYTHON) $(srcdir)/src/ocispec/generate.py --gen-ref --root=${srcdir} --out=${builddir}/src/ocispec ${srcdir}/image-spec/schema
@touch $@
src/image_manifest_stamp: src/ocispec/json_common.h src/ocispec/json_common.c
$(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: src/ocispec/json_common.h src/ocispec/json_common.c
$(PYTHON) $(srcdir)/src/ocispec/generate.py --gen-ref --root=${srcdir}/tests/test-spec --out=${builddir}/src/ocispec ${srcdir}/tests/test-spec/basic
@touch $@
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 \
src/ocispec/image_spec_schema_config_schema.h \
src/ocispec/image_spec_schema_content_descriptor.h \
src/ocispec/image_spec_schema_defs.h \
src/ocispec/image_spec_schema_defs_descriptor.h \
src/ocispec/image_spec_schema_image_index_schema.h \
src/ocispec/image_spec_schema_image_layout_schema.h \
src/ocispec/image_spec_schema_image_manifest_schema.h: src/image_spec_stamp
src/ocispec/runtime_spec_schema_config_linux.h \
src/ocispec/runtime_spec_schema_config_schema.h \
src/ocispec/runtime_spec_schema_config_solaris.h \
src/ocispec/runtime_spec_schema_config_vm.h \
src/ocispec/runtime_spec_schema_config_windows.h \
src/ocispec/runtime_spec_schema_defs.h \
src/ocispec/runtime_spec_schema_defs_linux.h \
src/ocispec/runtime_spec_schema_defs_zos.h \
src/ocispec/runtime_spec_schema_features_linux.h \
src/ocispec/runtime_spec_schema_features_schema.h \
src/ocispec/runtime_spec_schema_features_linux.c \
src/ocispec/runtime_spec_schema_features_schema.c \
src/ocispec/runtime_spec_schema_defs_vm.h \
src/ocispec/runtime_spec_schema_defs_windows.h \
src/ocispec/runtime_spec_schema_state_schema.h \
src/ocispec/runtime_spec_schema_config_linux.c \
src/ocispec/runtime_spec_schema_config_zos.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_defs.c \
src/ocispec/runtime_spec_schema_defs_linux.c \
src/ocispec/runtime_spec_schema_defs_vm.c \
src/ocispec/runtime_spec_schema_defs_zos.c \
src/ocispec/runtime_spec_schema_defs_windows.c \
src/ocispec/runtime_spec_schema_state_schema.c: src/runtime_spec_stamp
src/ocispec/image_manifest_items_image_manifest_items_schema.h \
src/ocispec/image_manifest_items_image_manifest_items_schema.c: src/image_manifest_stamp
src/ocispec/basic_test_double_array_item.h \
src/ocispec/basic_test_double_array.h \
src/ocispec/basic_test_top_array_int.h \
src/ocispec/basic_test_top_array_string.h \
src/ocispec/basic_test_top_double_array_int.h \
src/ocispec/basic_test_top_double_array_obj.h \
src/ocispec/basic_test_top_double_array_refobj.h \
src/ocispec/basic_test_top_double_array_string.h \
src/ocispec/basic_test_double_array_item.c \
src/ocispec/basic_test_double_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: src/basic-test_stamp
$(HEADER_FILES): %.h: %.c src/ocispec/generate.py
BUILT_SOURCES = $(HEADER_FILES) $(SOURCE_FILES)
libocispec_la_SOURCES = $(BUILT_SOURCES) \
src/ocispec/read-file.c \
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)
TESTS_LDADD = libocispec.la $(SELINUX_LIBS)
if HAVE_EMBEDDED_YAJL
TESTS_LDADD += yajl/libyajl.la
else
TESTS_LDADD += $(YAJL_LIBS)
endif
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_test_1_SOURCES = tests/test-1.c
tests_test_1_LDADD = $(TESTS_LDADD)
tests_test_2_SOURCES = tests/test-2.c
tests_test_2_LDADD = $(TESTS_LDADD)
tests_test_3_SOURCES = tests/test-3.c
tests_test_3_LDADD = $(TESTS_LDADD)
tests_test_4_SOURCES = tests/test-4.c
tests_test_4_LDADD = $(TESTS_LDADD)
tests_test_5_SOURCES = tests/test-5.c
tests_test_5_LDADD = $(TESTS_LDADD)
tests_test_6_SOURCES = tests/test-6.c
tests_test_6_LDADD = $(TESTS_LDADD)
tests_test_7_SOURCES = tests/test-7.c
tests_test_7_LDADD = $(TESTS_LDADD)
tests_test_8_SOURCES = tests/test-8.c
tests_test_8_LDADD = $(TESTS_LDADD)
tests_test_9_SOURCES = tests/test-9.c
tests_test_9_LDADD = $(TESTS_LDADD)
tests_test_10_SOURCES = tests/test-10.c
tests_test_10_LDADD = $(TESTS_LDADD)
tests_test_11_SOURCES = tests/test-11.c
tests_test_11_LDADD = $(TESTS_LDADD)
src_ocispec_validate_SOURCES = src/ocispec/validate.c
src_ocispec_validate_LDADD = $(TESTS_LDADD)
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
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/test-spec \
src/ocispec/generate.py \
src/ocispec/headers.py \
src/ocispec/helpers.py \
src/ocispec/sources.py \
$(HEADER_FILES) \
src/ocispec/read-file.h \
runtime-spec \
image-spec \
src/ocispec/json_common.h \
src/ocispec/json_common.c \
src/yajl
sync:
(cd image-spec; git pull https://github.com/opencontainers/image-spec)
(cd runtime-spec; git pull https://github.com/opencontainers/runtime-spec)
(cd yajl; git pull https://github.com/containers/yajl main)
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)