-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (41 loc) · 1.4 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
BIN = alive
GAME_DIR= src
CFLAGS += -std=c99 -pedantic -Wall -O0
LIBS = -lSDL2 -lSDL2_image -lSDL2_ttf -lSDL2_mixer -lm
ENGINE_DIR = ../cunctator/cunctator
ENGINE_DIR_MAIN = ../cunctator
ENGINE_SRC = \
${ENGINE_DIR}/list.c \
${ENGINE_DIR}/input.c \
${ENGINE_DIR}/engine.c \
${ENGINE_DIR}/sprite.c \
${ENGINE_DIR}/animation.c \
${ENGINE_DIR}/entity.c \
${ENGINE_DIR}/loader.c \
${ENGINE_DIR}/text.c \
${ENGINE_DIR}/music_loader.c \
${ENGINE_DIR}/sound_loader.c \
${ENGINE_DIR}/font_loader.c \
${ENGINE_DIR}/texture_loader.c \
${ENGINE_DIR}/texture.c \
${ENGINE_DIR}/console.c
GAME_SRC = \
${GAME_DIR}/main.c \
${GAME_DIR}/assets.c \
${GAME_DIR}/level.c \
${GAME_DIR}/bullets.c \
${GAME_DIR}/math.c \
${GAME_DIR}/player.c \
${GAME_DIR}/enemies.c \
${ENGINE_SRC}
.PHONY: game web release_web format_src
game:
$(CC) -I ${ENGINE_DIR_MAIN} ${GAME_SRC} ${CFLAGS} -o ${BIN} ${LIBS}
web:
emcc -v -I ${ENGINE_DIR_MAIN} ${GAME_SRC} ${CFLAGS} ${LIBS} -s TOTAL_MEMORY=67108864 -s ALLOW_MEMORY_GROWTH=1 --use-preload-plugins -s USE_SDL=2 -s USE_SDL_IMAGE=2 -s USE_SDL_TTF=2 -s USE_SDL_MIXER=2 -lm -s SDL2_IMAGE_FORMATS='["png"]' --preload-file assets -o alive.html
release_web:
mkdir -p release_web
cp alive.data alive.js alive.wasm web/index.html ./release_web
zip -r alive_release_web.zip release_web
format_src:
clang-format -i ./src/*