-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
126 lines (99 loc) · 3.57 KB
/
Makefile
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
SLM_STANZA ?= jstanza
STANZA := $(SLM_STANZA)
CWD := $(shell pwd)
SLM ?= slm
# execute all lines of a target in one shell
.ONESHELL:
TEST_DIR := $(CWD)/tests
JSL_TESTS := \
jsl/tests/landpatterns/numbering \
jsl/tests/landpatterns/packages \
jsl/tests/landpatterns/pad-planner \
jsl/tests/landpatterns/SOIC \
jsl/tests/landpatterns/SON \
jsl/tests/landpatterns/IPC \
jsl/tests/landpatterns/BGA \
jsl/tests/landpatterns/protrusions \
jsl/tests/landpatterns/two-pin/SMT \
jsl/tests/landpatterns/two-pin/radial \
jsl/tests/landpatterns/two-pin/axial \
jsl/tests/landpatterns/courtyard \
jsl/tests/landpatterns/VirtualLP \
jsl/tests/geometry \
jsl/tests/landpatterns/QFN \
jsl/tests/symbols/SymbolNode \
jsl/tests/symbols/box-symbol \
jsl/tests/bundles \
jsl/tests/pin-assignment \
jsl/tests/layerstack \
jsl/tests/ensure \
jsl/tests/via-structures \
jsl/tests/si/Microstrip \
jsl/tests/si/couplers \
jsl/tests/si/signal-ends \
jsl/tests/design/introspection \
jsl/tests/design/E-Series \
jsl/tests/circuits/Network \
jsl/tests/math
TABGEN=./tabgen/tabgen
$(TABGEN):
(cd tabgen && make)
.PHONY: tabgen
tabgen: $(TABGEN)
TWO_PIN_STZ=src/landpatterns/two-pin/SMT-table.stanza
TWO_PIN_CSV=$(TWO_PIN_STZ:stanza=csv)
TWO_PIN_NAME="jsl/landpatterns/two-pin/SMT-table"
$(TWO_PIN_STZ): $(TWO_PIN_CSV) tabgen
$(TABGEN) generate $(TWO_PIN_CSV) -f $@ -pkg-name $(TWO_PIN_NAME) -force
FILLETS=src/landpatterns/leads/lead-fillets-table.stanza
FILLETS_CSV=$(FILLETS:stanza=csv)
FILLETS_NAME=jsl/landpatterns/leads/lead-fillets-table
$(FILLETS): $(FILLETS_CSV) tabgen
$(TABGEN) generate $(FILLETS_CSV) -f $@ -pkg-name $(FILLETS_NAME) -force
fetch-deps:
# This forces SLM to fetch the dependencies
# it will fail - but we don't care as longs as the
# deps get fetched.
-$(SLM) build fetch-deps
.PHONY: tests
tests: fetch-deps
$(STANZA) run-test $(JSL_TESTS)
.PHONY: test-%
test-%: fetch-deps
$(STANZA) run-test $(JSL_TESTS) -tagged $(@:test-%=%) | grep -v "SKIP" | awk NF
DOCS_DIR=./docs_build
DOCGEN=$(DOCS_DIR)/.slm/deps/docgen/bin/docgen
DEFS_DB=$(DOCS_DIR)/jsl_defs_db.dat
build-docgen: fetch-deps
cd $(DOCS_DIR)
$(SLM) build
cd ..
test -f $(DOCGEN)
DOC_PKGS_FILE := $(DOCS_DIR)/pkgs.txt
PKGS := $(shell cat ${DOC_PKGS_FILE} | xargs)
JITX_PKGS_FILE := $(DOCS_DIR)/jitx_pkgs.txt
JITX_PKGS := $(shell cat ${JITX_PKGS_FILE} | xargs)
# I'm trying to cover my bases here because
# our build, ci, and production environments
# are all so different. It is frankly amazing
# that anything works.
$(info STANZA: $(STANZA))
$(info STANZA_CONFIG: $(STANZA_CONFIG))
ifeq (${JITX_ROOT},)
$(info Overriding JITX_ROOT with: ${STANZA_CONFIG})
JITX_ROOT := ${STANZA_CONFIG}
else
ifeq (${STANZA_CONFIG},)
$(info Overriding STANZA_CONFIG with: ${JITX_ROOT})
STANZA_CONFIG := ${JITX_ROOT}
endif
endif
test-docs: build-docgen
$(STANZA) definitions-database $(JITX_ROOT)/stanza.proj -o $(DOCS_DIR)/jitx_runtime_db.dat
$(STANZA) definitions-database ./stanza.proj -merge-with $(DOCS_DIR)/jitx_runtime_db.dat -o $(DEFS_DB)
$(DOCGEN) generate $(DEFS_DB) -type mkdocs -pkgs $(PKGS) $(JITX_PKGS) -standalone $(DOCS_DIR)/src -o $(DOCS_DIR)/docs
.PHONY: clean
clean:
$(STANZA) clean
rm -f $(CWD)/pkgs/*
rm -f $(CWD)/test-pkgs/*