-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
31 lines (22 loc) · 787 Bytes
/
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
# SPDX-FileCopyrightText: © 2022 Uri Shaked <[email protected]>
# SPDX-License-Identifier: MIT
SOURCES = src/main.c
TARGET = dist/chip.wasm
testFileName = logic
testFolderName = test
.PHONY: all
all: $(TARGET) dist/chip.json ; \
.PHONY: clean
clean:
rm -rf dist ; \
rm -rf $(testFolderName) ; \
dist:
mkdir -p dist
$(TARGET): dist $(SOURCES) src/wokwi-api.h
clang --target=wasm32-unknown-wasi --sysroot /opt/wasi-libc -nostartfiles -Wl,--import-memory -Wl,--export-table -Wl,--no-entry -Werror -o $(TARGET) $(SOURCES)
dist/chip.json: dist chip.json
cp chip.json dist
.PHONY: test
test:
mkdir -p $(testFolderName) ; \
cd test && arduino-cli sketch new $(testFileName) && arduino-cli compile -e -b arduino:avr:uno $(testFileName) ; \