From: Brian Norris Date: Tue, 3 Jul 2012 19:54:03 +0000 (-0700) Subject: Makefile: compile *.cc separately X-Git-Tag: pldi2013~389^2^2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=fa918e73eb6d423d3f7f011e3f305106e8dca79c;p=model-checker.git Makefile: compile *.cc separately This Makefile rule doesn't have to include all *.cc files at once. They can be compiled separately. Note that this slows down compilation slightly, but it also allows better parallel (jobserver) compilation; for example, you can use `make -j4' to perform separate compilations using 4 different threads, utilizing a multi-core system more effectively. --- diff --git a/Makefile b/Makefile index ddc89cb..6ef1e94 100644 --- a/Makefile +++ b/Makefile @@ -50,8 +50,8 @@ mymemory.o: mymemory.h snapshotimp.h snapshot.h mymemory.cc snapshot.o: mymemory.h snapshot.h snapshotimp.h snapshot.cc $(CXX) -fPIC -c snapshot.cc $(CPPFLAGS) -$(MODEL_O): $(MODEL_CC) $(MODEL_H) - $(CXX) -fPIC -c $(MODEL_CC) $(CPPFLAGS) +%.o: %.cc $(MODEL_H) + $(CXX) -fPIC -c $< $(CPPFLAGS) clean: rm -f $(BIN) *.o *.so