From fa918e73eb6d423d3f7f011e3f305106e8dca79c Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Tue, 3 Jul 2012 12:54:03 -0700 Subject: [PATCH] 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. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.34.1