Nnn: Extra whitespace makes O_* comparison fail

Created on 13 Jan 2021  路  4Comments  路  Source: jarun/nnn

Setting to 1 the O_ flags in the Makefile is not working.

Please consider doing this:

# debug binary
O_DEBUG := 0
# no readline support
O_NORL := 0
# link with PCRE library
O_PCRE := 0

Instead of this:

O_DEBUG := 0  # debug binary
O_NORL := 0  # no readline support
O_PCRE := 0  # link with PCRE library
bug

All 4 comments

I see where you are having problems. The intention is to run make O_DEBUG=1 or similar.

But if you want to modify the Makefile directly you can either move the comments to the line above or in the check for the variable use ifeq ($(strip $(O_*)),1) instead of ifeq ($(O_*),1) to strip the extra whitespaces (O_DEBUG := 0__#comment marked here with _).

@jarun do you think we should change the Makefile to fix this?

You have been able to explain what i meant better than me.
The extra white-spaces before the comment are included in the variable, so the test to modify the compiler flags will fail.
I've been able to compile nnn with the desired flags, but i think ( also since the possibility to set flags in the make file is already present) to allow user to actually use the initial switcher by default. This will save keystrokes and allow the possibility to have a reproducible build by just typing make.
This is a very cool project, I hope it will get better and better.

@KlzXS

do you think we should change the Makefile to fix this?

Yes, let's fix it. Please raise the PR.

Okay. I'm more for the strip option. I think inline comments just look and feel better.

Was this page helpful?
0 / 5 - 0 ratings