@@ -19,7 +19,7 @@ SBP_STAGING := $(shell git describe --match 'libsbp-staging*' --always --tags |
19
19
20
20
CHANGELOG_MAX_ISSUES := 100
21
21
22
- .PHONY : help test release dist clean all docs pdf html c deps-c gen-c test-c python deps-python gen-python test-python javascript deps-javascript gen-javascript test-javascript java deps-java gen-java test-java haskell deps-haskell gen-haskell test-haskell haskell deps-protobuf gen-protobuf test-protobuf verify-prereq-generator verify-prereq-c verify-prereq-javascript verify-prereq-python verify-prereq-java verify-prereq-haskell verify-prereq-protobuf mapping rust deps-rust gen-rust test-rust deps-jsonschema gen-jsonschema test-jsonschema verify-prereq-jsonschema deps-quicktype-typescript gen-quicktype-typescript test-quicktype-typescript verify-prereq-quicktype-typescript deps-quicktype-javascript gen-quicktype-javascript test-quicktype-javascript verify-prereq-quicktype-javascript deps-quicktype-elm gen-quicktype-elm test-quicktype-elm verify-prereq-quicktype-elm
22
+ .PHONY : help test release dist clean all docs pdf html c deps-c gen-c test-c python deps-python gen-python test-python javascript deps-javascript gen-javascript test-javascript java deps-java gen-java test-java haskell deps-haskell gen-haskell test-haskell haskell deps-protobuf gen-protobuf test-protobuf deps-kaitai gen-kaitai test-kaitai verify-prereq-generator verify-prereq-c verify-prereq-javascript verify-prereq-python verify-prereq-java verify-prereq-haskell verify-prereq-protobuf verify-prereq-kaitai mapping rust deps-rust gen-rust test-rust deps-jsonschema gen-jsonschema test-jsonschema verify-prereq-jsonschema deps-quicktype-typescript gen-quicktype-typescript test-quicktype-typescript verify-prereq-quicktype-typescript deps-quicktype-javascript gen-quicktype-javascript test-quicktype-javascript verify-prereq-quicktype-javascript deps-quicktype-elm gen-quicktype-elm test-quicktype-elm verify-prereq-quicktype-elm
23
23
24
24
# Functions
25
25
define announce-begin
55
55
@echo " java to make Java bindings"
56
56
@echo " rust to make Rust bindings"
57
57
@echo " protobuf to make Protocol Buffer bindings"
58
+ @echo " kaitai to make Kaitai Struct format descriptions"
58
59
@echo " jsonschema to make JSON Schema definitions"
59
60
@echo " release to handle some release tasks"
60
61
@echo " test to run all tests"
67
68
68
69
packaged-languages : c python haskell rust javascript
69
70
70
- non-packaged-languages : java protobuf jsonschema quicktype
71
+ non-packaged-languages : java protobuf kaitai jsonschema quicktype
71
72
72
73
all : packaged-languages docs non-packaged-languages
73
74
@@ -87,6 +88,7 @@ java: deps-java gen-java test-java java-examples
87
88
haskell : deps-haskell gen-haskell test-haskell
88
89
rust : deps-rust gen-rust test-rust
89
90
protobuf : deps-protobuf gen-protobuf test-protobuf
91
+ kaitai : deps-kaitai gen-kaitai test-kaitai
90
92
jsonschema : deps-jsonschema gen-jsonschema test-jsonschema
91
93
92
94
quicktype-typescript : deps-quicktype-typescript gen-quicktype-typescript test-quicktype-typescript
@@ -136,6 +138,9 @@ verify-prereq-rust:
136
138
137
139
verify-prereq-protobuf : ;
138
140
141
+ verify-prereq-kaitai :
142
+ @command -v kaitai-struct-compiler 1> /dev/null 2> /dev/null || { echo >&2 -e " I require \` kaitai-struct-compiler\` but it's not installed. Aborting.\n" ; exit 1; }
143
+
139
144
verify-prereq-jsonschema : ;
140
145
141
146
verify-prereq-quicktype :
@@ -169,6 +174,8 @@ deps-rust: verify-prereq-rust
169
174
170
175
deps-protobuf : verify-prereq-protobuf
171
176
177
+ deps-kaitai : verify-prereq-kaitai
178
+
172
179
deps-jsonschema : verify-prereq-jsonschema
173
180
174
181
deps-quicktype-typescript : verify-prereq-quicktype
@@ -179,7 +186,7 @@ deps-quicktype-elm: verify-prereq-quicktype
179
186
180
187
# Generators
181
188
182
- gen : gen-c gen-python gen-javascript gen-java gen-haskell gen-rust gen-protobuf gen-jsonschema gen-quicktype
189
+ gen : gen-c gen-python gen-javascript gen-java gen-haskell gen-rust gen-protobuf gen-kaitai gen- jsonschema gen-quicktype
183
190
gen-quicktype : gen-quicktype-typescript gen-quicktype-elm
184
191
185
192
gen-c_args = -i $(SBP_SPEC_DIR ) \
@@ -298,8 +305,6 @@ gen-rust:
298
305
299
306
$(call announce-end,"Finished formatting Rust code")
300
307
301
- $(call announce-end,"Finished generating Rust bindings")
302
-
303
308
gen-protobuf :
304
309
$(call announce-begin,"Generating Protocol Buffers bindings")
305
310
cd $(SWIFTNAV_ROOT ) /generator; \
@@ -309,6 +314,31 @@ gen-protobuf:
309
314
--protobuf
310
315
$(call announce-begin,"Finished generating Protocol Buffers bindings")
311
316
317
+ gen-kaitai :
318
+ $(call announce-begin,"Generating Kaitai Struct Format Description")
319
+ cd $(SWIFTNAV_ROOT ) /generator; \
320
+ $(SBP_GEN_BIN ) -i $(SBP_SPEC_DIR ) \
321
+ -o $(SWIFTNAV_ROOT ) /kaitai/ \
322
+ -r $(SBP_VERSION ) \
323
+ --kaitai
324
+ $(call announce-begin,"Finished generating Kaitai Struct Format Description")
325
+
326
+ $(call announce-begin,"Generating Kaitai Struct Python tests")
327
+ cd $(SWIFTNAV_ROOT)/generator; \
328
+ $(SBP_GEN_BIN) -i $(SBP_TESTS_SPEC_DIR) \
329
+ -o $(SWIFTNAV_ROOT)/kaitai/python/kaitai_sbp/tests/ \
330
+ -r $(SBP_VERSION) \
331
+ --test-kaitai-python
332
+ $(call announce-end,"Finished generating Kaitai Struct Python tests")
333
+
334
+ $(call announce-begin,"Generating Kaitai Struct Perl tests")
335
+ cd $(SWIFTNAV_ROOT)/generator; \
336
+ $(SBP_GEN_BIN) -i $(SBP_TESTS_SPEC_DIR) \
337
+ -o $(SWIFTNAV_ROOT)/kaitai/perl/KaitaiSbp/t/ \
338
+ -r $(SBP_VERSION) \
339
+ --test-kaitai-perl
340
+ $(call announce-end,"Finished generating Kaitai Struct Perl tests")
341
+
312
342
gen-jsonschema :
313
343
$(call announce-begin,"Generating JSON Schema definitions")
314
344
cd $(SWIFTNAV_ROOT ) /generator; \
@@ -335,7 +365,7 @@ gen-quicktype-elm:
335
365
336
366
# Testers
337
367
338
- test : test-all-begin test-c test-c-v4 test-java test-python test-haskell test-javascript test-rust test-all-end
368
+ test : test-all-begin test-c test-c-v4 test-java test-python test-haskell test-javascript test-rust test-kaitai test- all-end
339
369
340
370
test-all-begin :
341
371
$(call announce-begin,"Running all tests")
@@ -395,6 +425,15 @@ test-protobuf:
395
425
$(call announce-begin,"Running Protocol Buffer tests")
396
426
$(call announce-end,"Finished running Protocol Buffer tests")
397
427
428
+ test-kaitai :
429
+ $(call announce-begin,"Running Kaitai Struct Python tests")
430
+ cd $(SWIFTNAV_ROOT ) && tox -c kaitai/python/kaitai_sbp/tests/tox.ini kaitai/python/kaitai_sbp/tests/test_* .py
431
+ $(call announce-end,"Finished running Kaitai Struct Python tests")
432
+
433
+ $(call announce-begin,"Running Kaitai Struct Perl tests")
434
+ cd $(SWIFTNAV_ROOT) && perl -MExtUtils::Command::MM -MTest::Harness -e test_harness kaitai/perl/KaitaiSbp/t/*.t
435
+ $(call announce-end,"Finished running Kaitai Struct Perl tests")
436
+
398
437
test-jsonschema :
399
438
$(call announce-begin,"Running JSON Schema tests")
400
439
$(call announce-end,"Finished running JSON Schema tests")
0 commit comments