-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (24 loc) · 800 Bytes
/
Makefile
File metadata and controls
31 lines (24 loc) · 800 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
31
# Compiler and flags
CC = emcc
CFLAGS = -O2 -Wall -Wextra
EMFLAGS = -s USE_SDL=2 -s ALLOW_MEMORY_GROWTH=1 \
-s EXPORTED_FUNCTIONS='["_main", "_js_pan", "_js_zoom", "_js_get_min_speed", "_js_get_max_speed", "_js_set_speed", "_js_toggle_pause", "_js_get_paused", "_js_get_generations"]' \
-s EXPORTED_RUNTIME_METHODS='["ccall", "cwrap"]' \
--shell-file web/shell.html
# Paths
SRC = casdl.c
BUILD_DIR = build
OUTPUT = $(BUILD_DIR)/index.html
# Default target
all: $(OUTPUT)
$(OUTPUT): $(SRC) config.h web/shell.html | $(BUILD_DIR)
$(CC) $(SRC) -o $(OUTPUT) $(CFLAGS) $(EMFLAGS)
cp web/styles.css $(BUILD_DIR)/
cp web/controls.js $(BUILD_DIR)/
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
clean:
rm -rf $(BUILD_DIR)
serve: all
cd $(BUILD_DIR) && python3 -m http.server 8000
.PHONY: all clean serve