diff --git a/recursiveDescentParsers/cplusplus/interpret++/Makefile b/recursiveDescentParsers/cplusplus/interpret++/Makefile index 3471232ec42ff88aeacc43b54bbae9f9fe5d8f33..a2590301b7fadd6d3fc2bf016339c3d6725dc3db 100644 --- a/recursiveDescentParsers/cplusplus/interpret++/Makefile +++ b/recursiveDescentParsers/cplusplus/interpret++/Makefile @@ -48,21 +48,27 @@ all: $(PROGS) # http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/ # ... and then fixed, and fixed, and fixed some more. DEPDIR := .deps -# Broken: DEPFLAGS = -MT $@ -MMD -MP -MF $(DEPDIR)/$*.d -DEPFLAGS = -MMD -MF $(DEPDIR)/$*.d +# From URL: DEPFLAGS = -MT $@ -MMD -MP -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) +#include the deps (minus says don't complain if they don't) -include $(DEPS) -%.o : %.cpp %.d - $(CC) -c $(CPPFLAGS) $(DEPFLAGS) -o $@ $< +# %.o $(DEPDIR)/%.d : %.cpp $(DEPDIR) +%.o : %.cpp $(DEPDIR) + $(CC) -c $(CPPFLAGS) $(DEPFLAGS) -o $*.o $*.cpp # Make depdir if it doesn't exist... $(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) $(CC) $(CPPFLAGS) $(OBJS) $(LIBS) -o $@