Skip to content
Snippets Groups Projects
Commit ca222f55 authored by Ronald Charles Moore's avatar Ronald Charles Moore
Browse files

tweeked Makefile

parent 21999010
No related branches found
No related tags found
No related merge requests found
...@@ -48,21 +48,27 @@ all: $(PROGS) ...@@ -48,21 +48,27 @@ all: $(PROGS)
# http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/ # http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/
# ... and then fixed, and fixed, and fixed some more. # ... and then fixed, and fixed, and fixed some more.
DEPDIR := .deps DEPDIR := .deps
# Broken: DEPFLAGS = -MT $@ -MMD -MP -MF $(DEPDIR)/$*.d # From URL: DEPFLAGS = -MT $@ -MMD -MP -MF $(DEPDIR)/$*.d
DEPFLAGS = -MMD -MF $(DEPDIR)/$*.d # Simpler, better...
DEPFLAGS = -MMD -MP -MF $(DEPDIR)/$*.d
# include dep files, if they exist (minus says don't complain if they don't)
DEPS := $(OBJS:%.o=$(DEPDIR)/%.d) DEPS := $(OBJS:%.o=$(DEPDIR)/%.d)
#include the deps (minus says don't complain if they don't)
-include $(DEPS) -include $(DEPS)
%.o : %.cpp %.d # %.o $(DEPDIR)/%.d : %.cpp $(DEPDIR)
$(CC) -c $(CPPFLAGS) $(DEPFLAGS) -o $@ $< %.o : %.cpp $(DEPDIR)
$(CC) -c $(CPPFLAGS) $(DEPFLAGS) -o $*.o $*.cpp
# Make depdir if it doesn't exist... # Make depdir if it doesn't exist...
$(DEPDIR): ; @mkdir -p $@ $(DEPDIR): ; @mkdir -p $@
## Now, the targets -- the things that will get made! # generate dep files. Note missing "-o" to keep from generating them too
# $(DEPDIR)/%.d : $(DEPDIR)
# $(CC) -c $(CPPFLAGS) $(DEPFLAGS) $*.cpp
## Now, the REAL targets -- the things that will get made!
$(PROGS): $(OBJS) $(PROGS): $(OBJS)
$(CC) $(CPPFLAGS) $(OBJS) $(LIBS) -o $@ $(CC) $(CPPFLAGS) $(OBJS) $(LIBS) -o $@
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment