aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKikooDX <kikoodx@paranoici.org>2022-03-26 12:36:38 +0100
committerKikooDX <kikoodx@paranoici.org>2022-03-26 12:36:38 +0100
commit2cb24f14fabb1179b38476c8e6a45386a5ab05f0 (patch)
tree900e7e1dbe6c1c61086e66e4bc9bbf7fc5c4abec
parentf006b6d58c2c777d73d50912497f54d8edfdcb75 (diff)
downloadlzy-2cb24f14fabb1179b38476c8e6a45386a5ab05f0.tar.gz
header dependencies
-rw-r--r--.gitignore1
-rw-r--r--Makefile9
2 files changed, 6 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore
index fe73ff5..d9ded93 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,7 @@
/*.g1a
/*.g3a
*.o
+*.d
lzy
# Python bytecode
diff --git a/Makefile b/Makefile
index 66bca25..03a145e 100644
--- a/Makefile
+++ b/Makefile
@@ -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