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

make doesn't respect newly added files without make clean #3658

Closed
Sopel97 opened this issue Aug 15, 2021 · 2 comments
Closed

make doesn't respect newly added files without make clean #3658

Sopel97 opened this issue Aug 15, 2021 · 2 comments

Comments

@Sopel97
Copy link
Member

Sopel97 commented Aug 15, 2021

Makes abrok break every time a new .cpp file is added, and users also were confused by it.

Caused by some .depend thingy.

1:14 PM] vondele: This could be a partial fix:
diff --git a/src/Makefile b/src/Makefile
index c1dab86ba..2d33418e1 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -912,7 +912,7 @@ icc-profile-use:
        EXTRACXXFLAGS='-prof_use -prof_dir ./profdir' \
        all
 
-.depend:
+.depend: Makefile
        -@$(CXX) $(DEPENDFLAGS) -MM $(SRCS) > $@ 2> /dev/null
 
 -include .depend

3:20 PM] vondele: I think the only real fix is to have a dependency on $(SRCS) otherwise code can be miscompiled in principle.

also https://stackoverflow.com/a/30142139/3763139 may be of help

vondele added a commit to vondele/Stockfish that referenced this issue Aug 15, 2021
fixes official-stockfish#3658

dependencies are now regenerated for each code change, this adds some 1s overhead in compile time, but avoids potential miscompilations or build problems.

No functional change
@vondele
Copy link
Member

vondele commented Aug 15, 2021

good to have an issue, but I don't think the above diff is not good enough, a more thorough fix is the PR above.

The disadvantage is somewhat slower compile times (1s overhead), which we can only get rid off by having a .dep file per source file, IMO.

@Sopel97
Copy link
Member Author

Sopel97 commented Aug 15, 2021

Having one .dep file per source shouldn't be an issue, all build artifacts could be placed in a separate "build" directory. I think the so post I linked above has a solution of this kind.

Joachim26 pushed a commit to Joachim26/StockfishNPS that referenced this issue Mar 28, 2023
fixes official-stockfish#3658

dependencies are now regenerated for each code change, this adds some 1s overhead in compile time, but avoids potential miscompilations or build problems.

closes official-stockfish#3659

No functional change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants