summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 10 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index e371044..e46d005 100644
--- a/Makefile
+++ b/Makefile
@@ -1,23 +1,27 @@
CC ?= gcc
-CFLAGS = -std=c99 -Wall -Wextra -O3 -I./inc -MMD $(shell sdl2-config --cflags)
+CFLAGS = -std=c99 -Wall -Wextra -Os -I./inc -MMD $(shell sdl2-config --cflags)
LDFLAGS = -lSDL2 -lSDL2_image -lSDL2_mixer $(shell sdl2-config --libs)
OBJ_NAME = wehfou
OBJS := $(patsubst %.c,%.o,$(wildcard src/*.c))
+LVLS_BIN = inc/levels_bin.h
+LVLS := $(wildcard res/*.kble)
-all: $(OBJ_NAME)
+all: $(LVLS_BIN) $(OBJ_NAME)
$(OBJ_NAME): $(OBJS)
$(CC) $(LDFLAGS) $(LIBRARIES) -o $(OBJ_NAME) $(OBJS)
- strip $(OBJ_NAME)
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
-cg:
+$(LVLS_BIN): $(LVLS)
+ cembed -o $(LVLS_BIN) -t levels $(LVLS)
+
+cg: $(LVLS_BIN)
fxsdk build-cg
-run: $(OBJ_NAME)
+run: all
./$(OBJ_NAME)
format:
@@ -26,7 +30,7 @@ format:
clean:
rm -f $(OBJ_NAME).g3a $(OBJ_NAME)
- rm -f $(OBJS) src/*.d
+ rm -f $(LVLS_BIN) $(OBJS) src/*.d
rm -Rf build-cg
.PHONY: cg run run-txt format clean