header dependencies

This commit is contained in:
KikooDX 2022-03-26 12:36:38 +01:00
parent f006b6d58c
commit 2cb24f14fa
2 changed files with 6 additions and 4 deletions

1
.gitignore vendored
View File

@ -3,6 +3,7 @@
/*.g1a
/*.g3a
*.o
*.d
lzy
# Python bytecode

View File

@ -1,10 +1,9 @@
CC ?= gcc
CFLAGS = -std=c99 -Wall -Wextra -O3 -I./inc $(shell sdl2-config --cflags)
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))
HEADERS := $(wildcard inc/*.h)
all: $(OBJ_NAME)
@ -12,7 +11,7 @@ $(OBJ_NAME): $(OBJS)
$(CC) $(LDFLAGS) $(LIBRARIES) -o $(OBJ_NAME) $(OBJS)
strip $(OBJ_NAME)
%.o: %.c $(HEADERS)
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
cg:
@ -27,7 +26,9 @@ format:
clean:
rm -f $(OBJ_NAME).g3a $(OBJ_NAME)
rm -f $(OBJS)
rm -f $(OBJS) src/*.d
rm -Rf build-cg
.PHONY: cg run run-txt format clean
-include src/*.d