File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 4040 - name : Run tests
4141 run : |
4242 make test
43+ - name : Check examples
44+ run : |
45+ make clean-examples
46+ make examples
47+ git diff --exit-code examples
48+
49+
Original file line number Diff line number Diff line change 11include common.mk
22
3+ EXAMPLES := $(patsubst % .in,% .out,$(wildcard examples/* .in) )
4+
35# Check if Go's linkers flags are set in common.mk and add them as extra flags.
46ifneq ($(GOLDFLAGS ) ,)
57 GO_EXTRA_FLAGS += -ldflags $(GOLDFLAGS)
@@ -13,6 +15,15 @@ build:
1315 @$(ECHO ) " $( MAGENTA) *** Building Go code...$( OFF) "
1416 @$(GO ) build -v -o oasis $(GOFLAGS ) $(GO_EXTRA_FLAGS )
1517
18+ examples : build $(EXAMPLES )
19+
20+ examples/% .out : examples/% .in
21+ @rm -f $@
22+ @scripts/gen_example.sh $< $@
23+
24+ clean-examples :
25+ @rm -f examples/* .out
26+
1627# Format code.
1728fmt :
1829 @$(ECHO ) " $( CYAN) *** Running Go formatters...$( OFF) "
6475# List of targets that are not actual files.
6576.PHONY : \
6677 all build \
78+ examples \
79+ clean-examples \
6780 fmt \
6881 $(lint-targets ) lint \
6982 $(test-targets ) test \
You can’t perform that action at this time.
0 commit comments