lzy/Makefile

35 lines
657 B
Makefile

CC = gcc
CFLAGS = -std=c99 -Wall -Wextra -O3 -I./inc -MMD $(shell sdl2-config --cflags)
LDFLAGS = -lSDL2 -lSDL2_image -lSDL2_mixer $(shell sdl2-config --libs)
OBJ_NAME = lzy
OBJS := $(patsubst %.c,%.o,$(wildcard src/*.c))
all: $(OBJ_NAME)
$(OBJ_NAME): $(OBJS)
$(CC) -o $(OBJ_NAME) $(OBJS) $(LDFLAGS)
strip $(OBJ_NAME)
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
cg:
fxsdk build-cg
run: $(OBJ_NAME)
./$(OBJ_NAME)
format:
@clang-format -style=file -verbose -i src/*.c
@clang-format -style=file -verbose -i inc/*.h
clean:
rm -f $(OBJ_NAME).g3a $(OBJ_NAME)
rm -f $(OBJS) src/*.d
rm -Rf build-cg
.PHONY: cg run run-txt format clean
-include src/*.d