Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Infinite Loop in Makefile Dependency Generation #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions runtime/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
test
TTTest
.depend
.depend-test

testHelper/GeneratedCode.cc
decompressor
Expand Down
12 changes: 8 additions & 4 deletions runtime/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,22 @@ decompressor: $(GENERATED_OBJ) Cycles.o Util.o Log.o LogDecompressor.cc
$(CXX) $(CXX_ARGS) $(EXTRA_NANOLOG_FLAGS) $^ -o decompressor $(INCLUDES) -Igenerated -Werror

clean:
rm -f Perf test compressedLog ./decompressor $(GENERATED_OBJ) $(TEST_BUILD_DIR)/*.o *.o *.gch *.log ./.depend
rm -f Perf test compressedLog ./decompressor $(GENERATED_OBJ) $(TEST_BUILD_DIR)/*.o *.o *.gch *.log ./.depend ./.depend-test

clean-all: clean
rm -f libgtest.a testHelper/GeneratedCode.cc

# Automatic rules to build *.h dependencies. Taken from
# https://stackoverflow.com/questions/2394609/makefile-header-dependencies
depend: .depend
depend: .depend .depend-test

.depend: $(SRCS)
rm -f ./.depend
$(CXX) $(CXX_ARGS) $(INCLUDES) -MM $^ > ./.depend;
sed 's|[a-zA-Z0-9_-]*\.o|$(TEST_BUILD_DIR)/&|' ./.depend >> ./.depend

include .depend
.depend-test: .depend
rm -f ./.depend-test
sed 's|[a-zA-Z0-9_-]*\.o|$(TEST_BUILD_DIR)/&|' ./.depend > ./.depend-test

-include .depend
-include .depend-test