-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinterface.mk
62 lines (49 loc) · 1.31 KB
/
interface.mk
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
# interface.mak
#
# common rules for building smithy models
# Some of these may depend on GNUMakefile >= 4.0
#
html_target ?= html
project_dir ?= $(abspath $(shell pwd))
codegen_config ?= $(project_dir)/codegen.toml
top_targets ?= all build clean lint validate test
WASH ?= wash
platform_id = $$( uname -s )
platform = $$( \
case $(platform_id) in \
( Linux | Darwin | FreeBSD ) echo $(platform_id) ;; \
( * ) echo Unrecognized Platform;; \
esac )
# traverse subdirs
.ONESHELL:
ifneq ($(subdirs),)
$(top_targets)::
for dir in $(subdirs); do \
$(MAKE) -C $$dir $@; \
done
endif
all::
clean::
rm -rf $(html_target)/*.html
ifneq ($(wildcard $(codegen_config)),)
# Run smithy model lint or validation checks
lint validate::
$(WASH) $@ --config $(codegen_config)
endif
ifeq ($(wildcard rust),rust)
# some rules for building rust subdirs
all::
cd rust && cargo build
test clean clippy::
cd rust && cargo $@
endif
# for debugging - show variables make is using
make-vars:
@echo "WASH: : $(WASH)"
@echo "codegen_config : $(codegen_config)"
@echo "platform_id : $(platform_id)"
@echo "platform : $(platform)"
@echo "project_dir : $(project_dir)"
@echo "subdirs : $(subdirs)"
@echo "top_targets : $(top_targets)"
.PHONY: all build release clean lint validate test