Hasnain Lakhani | 7ac79ab | 2025-08-25 14:40:43 -0700 | [diff] [blame^] | 1 | # |
| 2 | # Licensed to the Apache Software Foundation (ASF) under one |
| 3 | # or more contributor license agreements. See the NOTICE file |
| 4 | # distributed with this work for additional information |
| 5 | # regarding copyright ownership. The ASF licenses this file |
| 6 | # to you under the Apache License, Version 2.0 (the |
| 7 | # "License"); you may not use this file except in compliance |
| 8 | # with the License. You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, |
| 13 | # software distributed under the License is distributed on an |
| 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | # KIND, either express or implied. See the License for the |
| 16 | # specific language governing permissions and limitations |
| 17 | # under the License. |
| 18 | # |
| 19 | |
| 20 | THRIFT = $(top_builddir)/compiler/cpp/thrift |
| 21 | |
| 22 | # These sed commands are needed to work around the fact that the generator doesn't |
| 23 | # support the arbitrary crate yet. |
| 24 | stubs: $(top_builddir)/test/FuzzTest.thrift $(THRIFT) |
| 25 | $(THRIFT) -out lib/ --gen rs $(top_builddir)/test/FuzzTest.thrift |
| 26 | sed -i 's/thrift::OrderedFloat/ordered_float::OrderedFloat/g' lib/fuzz_test.rs |
| 27 | sed -i 's/derive(/derive(arbitrary::Arbitrary, /g' lib/fuzz_test.rs |
| 28 | |
| 29 | check: stubs |
| 30 | $(CARGO) fmt --all -- --check |
| 31 | $(CARGO) clippy --all -- -D warnings |
| 32 | $(CARGO) build |
| 33 | |
| 34 | clean-local: |
| 35 | $(CARGO) clean |
| 36 | -$(RM) Cargo.lock |
| 37 | -$(RM) -r target/ |
| 38 | -$(RM) -r corpus/ |
| 39 | -$(RM) -r artifacts/ |
| 40 | -$(RM) -r coverage/ |
| 41 | -$(RM) lib/fuzz_test.rs |
| 42 | |
| 43 | distdir: |
| 44 | $(MAKE) $(AM_MAKEFLAGS) distdir-am |
| 45 | |
| 46 | EXTRA_DIST = \ |
| 47 | Cargo.toml \ |
| 48 | lib/mod.rs \ |
| 49 | fuzz_targets/parse_compact.rs \ |
| 50 | fuzz_targets/parse_binary.rs \ |
| 51 | fuzz_targets/roundtrip_binary.rs \ |
| 52 | fuzz_targets/roundtrip_compact.rs \ |
| 53 | fuzz_targets/structured_roundtrip_compact.rs \ |
| 54 | fuzz_targets/structured_roundtrip_binary.rs \ |
| 55 | bin/corpus_generator.rs |