notepad-plus-plus / notepad-plus-plus

Notepad++ official repository

Home Page:https://notepad-plus-plus.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use DIR_O in nppSpecifics.mak properly

ArkadiuszMichalski opened this issue · comments

In nppSpecifics.mak file we use DIR_O variable in condition but in the compile command we don't do this:

$(DIR_O)\UTF8DocumentIterator.obj:: ../../boostregex/UTF8DocumentIterator.cxx
	$(CC) $(CXXFLAGS) -D_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS -c ../../boostregex/UTF8DocumentIterator.cxx	

This causes that when the DIR_O variable is set, this rule does not work properly, the rule try checks the resulting file in a different folder (DIR_O) than it is generated (current folder). No one noticed this because in the case of CMAKE job we do not set DIR_O (unlike MSYS2 job and its makefile, where everything works fine). This happened to me by accident (ref) and it would be good to correct it.

We just have to change:

$(DIR_O)\UTF8DocumentIterator.obj:: ../../boostregex/UTF8DocumentIterator.cxx
	$(CC) $(CXXFLAGS) -D_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS -c ../../boostregex/UTF8DocumentIterator.cxx	
	
$(DIR_O)\BoostRegexSearch.obj:: ../../boostregex/BoostRegexSearch.cxx ../src/CharClassify.h ../src/RESearch.h	
	$(CC) $(CXXFLAGS) -D_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS -c ../../boostregex/BoostRegexSearch.cxx

for example to:

$(DIR_O)\UTF8DocumentIterator.obj:: ../../boostregex/UTF8DocumentIterator.cxx
	$(CC) $(CXXFLAGS) -D_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS -c -Fo$@ %s
	
$(DIR_O)\BoostRegexSearch.obj:: ../../boostregex/BoostRegexSearch.cxx ../src/CharClassify.h ../src/RESearch.h	
	$(CC) $(CXXFLAGS) -D_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS -c -Fo$@ %s

The symbol %s maps to the first dependency in the list.

Edit: One more thing, we use the CC variable here, where everywhere else it's CXX, maybe it's worth changing it to CXX too?