diff options
author | Thorsten Wißmann <edu@thorsten-wissmann.de> | 2012-06-17 00:43:09 +0200 |
---|---|---|
committer | Thorsten Wißmann <edu@thorsten-wissmann.de> | 2012-06-17 00:45:37 +0200 |
commit | 0c324a720dedd8a160733c19fc5d8b160d95f5b8 (patch) | |
tree | fb8de68d04961601136e7d81731afe4009ec60b3 /Makefile | |
parent | c6a37e3b50519a419231a5e18a69fd643c218ab0 (diff) |
Makefile: Rebuild according to header dependencies
This introduces a header dependency file for each object file.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -15,11 +15,12 @@ HCTARGET = herbstclient TARGETS = $(HLWMTARGET) $(HCTARGET) OBJ = $(HLWMOBJ) $(HCOBJ) +DEPS = $(OBJ:.o=.d) HERBSTCLIENTDOC = doc/herbstclient.txt HERBSTLUFTWMDOC = doc/herbstluftwm.txt -.PHONY: all all-nodoc doc cleandoc install info www cleanwww clean +.PHONY: depend all all-nodoc doc cleandoc install info www cleanwww clean all: $(TARGETS) doc all-nodoc: $(TARGETS) @@ -30,9 +31,12 @@ $(TARGETS): $(call colorecho,LD,$@) $(VERBOSE) $(LD) -o $@ $(LDFLAGS) $^ $(LIBS) -%.o: %.c $(HEADER) +-include $(DEPS) + +%.o: %.c $(call colorecho,CC,$<) $(VERBOSE) $(CC) -c $(CFLAGS) -o $@ $< + $(VERBOSE) $(CC) -c $(CFLAGS) -o $*.d -MT $@ -MM $< info: @echo Some Info: @@ -44,6 +48,8 @@ clean: cleandoc $(VERBOSE) rm -f $(TARGETS) $(call colorecho,RM,$(OBJ)) $(VERBOSE) rm -f $(OBJ) + $(call colorecho,RM,$(DEPS)) + $(VERBOSE) rm -f $(DEPS) cleandoc: $(call colorecho,RM,doc/herbstclient.1) @@ -68,7 +74,6 @@ tar: doc tar -czf $(TARFILE) $(TMPTARDIR) rm -rf $(TMPTARDIR) - doc/%.1: doc/%.txt $(call colorecho,DOC,$@) $(VERBOSE) $(A2X) -f manpage -a "herbstluftwmversion=herbstluftwm $(VERSION)" -a "date=`date +%Y-%m-%d`" $< |