summaryrefslogtreecommitdiff
path: root/LibC
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-02-02 04:41:59 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-02-02 04:41:59 +0100
commit5e0b7f1a565ffd90c80da3965b2f706e7d55ce42 (patch)
treefbe80f035283b2da318acaabcb1e097bee861dec /LibC
parent7e64154d3fdbdebc31addbcd11000c98acb36536 (diff)
downloadserenity-5e0b7f1a565ffd90c80da3965b2f706e7d55ce42.zip
Add basic automatic dependency management to Makefiles.
Diffstat (limited to 'LibC')
-rw-r--r--LibC/.gitignore1
-rw-r--r--LibC/Makefile6
2 files changed, 5 insertions, 2 deletions
diff --git a/LibC/.gitignore b/LibC/.gitignore
index 1f6ba4783d..196c9f02af 100644
--- a/LibC/.gitignore
+++ b/LibC/.gitignore
@@ -1,2 +1,3 @@
*.o
+*.d
LibC.a
diff --git a/LibC/Makefile b/LibC/Makefile
index 90dbd15ed5..7704012171 100644
--- a/LibC/Makefile
+++ b/LibC/Makefile
@@ -59,7 +59,7 @@ INCLUDE_FLAGS = -I.. -I.
DEFINES = -DSERENITY -DUSERLAND -DSANITIZE_PTRS
-CXXFLAGS = $(WARNING_FLAGS) $(OPTIMIZATION_FLAGS) $(LIBC_FLAGS) $(FLAVOR_FLAGS) $(ARCH_FLAGS) $(STANDARD_FLAGS) $(INCLUDE_FLAGS) $(DEFINES)
+CXXFLAGS = -MMD -MP $(WARNING_FLAGS) $(OPTIMIZATION_FLAGS) $(LIBC_FLAGS) $(FLAVOR_FLAGS) $(ARCH_FLAGS) $(STANDARD_FLAGS) $(INCLUDE_FLAGS) $(DEFINES)
CXX = clang
LD = ld
AR = ar
@@ -73,6 +73,8 @@ $(LIBRARY): $(OBJS)
.cpp.o:
@echo "CXX $<"; $(CXX) $(CXXFLAGS) -o $@ -c $<
+-include $(OBJS:%.o=%.d)
+
clean:
- @echo "CLEAN"; rm -f $(LIBRARY) $(OBJS)
+ @echo "CLEAN"; rm -f $(LIBRARY) $(OBJS) *.d