-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (22 loc) · 680 Bytes
/
Makefile
File metadata and controls
30 lines (22 loc) · 680 Bytes
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
CC = clang
TARGET = clayterm.wasm
SRC = src/module.c
CFLAGS = --target=wasm32 -nostdlib -O2 \
-DCLAY_IMPLEMENTATION -DCLAY_WASM \
-Isrc -I.
LDFLAGS = -Wl,--no-entry \
-Wl,--import-memory \
-Wl,--stack-first \
-Wl,--export-all \
-Wl,--undefined=Clay__MeasureText \
-Wl,--undefined=Clay__QueryScrollOffset
all: $(TARGET) wasm.ts
@echo "Built $(TARGET) ($$(wc -c < $(TARGET)) bytes)"
DEPS = $(wildcard src/*.c src/*.h)
$(TARGET): $(DEPS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(SRC)
wasm.ts: $(TARGET)
deno run --allow-read --allow-write tasks/bundle-wasm.ts
clean:
rm -f $(TARGET) wasm.ts
.PHONY: all clean