-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (26 loc) · 722 Bytes
/
Makefile
File metadata and controls
37 lines (26 loc) · 722 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
32
33
34
35
36
37
# C Flags
CFLAGS += -g
CFLAGS += -Wall
CFLAGS += -std=c17
CFLAGS += -lm
CFLAGS += -D$(DEMO_NAME)
INCLUDE_FLAGS += -I/opt/homebrew/include
INCLUDE_FLAGS += -L/opt/homebrew/lib
# SDL flags
SDLFLAGS += -lSDL2
# Emscripten flags
EMCCFLAGS += -sUSE_SDL=2
EMCCFLAGS += -sALLOW_MEMORY_GROWTH
EMCCFLAGS += --preload-file ./assets
EMCCFLAGS += --shell-file template.html
EXAMPLES += geometry-example
EXAMPLES += shadow-map-example
EXAMPLES += physics2d-example
build:
gcc $(CFLAGS) $(INCLUDE_FLAGS) $(SDLFLAGS) ./src/**/*.c ./src/*.c -o $(DEMO_NAME)
build-emscripten:
emcc $(CFLAGS) $(INCLUDE_FLAGS) $(EMCCFLAGS) ./src/**/*.c ./src/*.c -o docs/examples/$(DEMO_NAME)/index.html
run:
./$(DEMO_NAME)
clean:
rm renderer