Commit ca222f55 authored by Ronald Charles Moore's avatar Ronald Charles Moore
Browse files

tweeked Makefile

parent 21999010
......@@ -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 $@
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment