If using hints file sys/unix/hints/linux.370 or sys/unix/hints/macOS.370
allow the majority of the boilerplate compile switches to reside in a
compiler response file, instead of on the command line.
Include one of the following on your make command line:
make response=1
or
make resp=1
It can be combined with other make command line options. See
sys/unix/README-hints for further information about those.
The response files that it uses are:
CC (clang or gcc) src/nethack_cc.rsp
CXx (clang++ or g++) src/nethack_cxx.rsp
Note: I think the reduced clutter should actually become the default,
and the override should be noresponse=1 to NOT use it, but I'm
not sure how others feel, so for now, it requires
make resp=1
Feedback on whether that should become the default or not
is welcome.
Tested on Linux with gcc-15 and on Linux with clang-20.
I haven't had a chance to test it on macOS yet.
34 lines
1.0 KiB
Plaintext
34 lines
1.0 KiB
Plaintext
#------------------------------------------------------------------------------
|
|
# NetHack 3.7 response.370 $NHDT-Date: 1668359835 2022/11/13 17:17:15 $ $NHDT-Branch: NetHack-3.7 $
|
|
|
|
ifeq "$(RESP)" "1"
|
|
USE_RESPONSEFILE=1
|
|
endif
|
|
ifeq "$(resp)" "1"
|
|
USE_RESPONSEFILE=1
|
|
endif
|
|
ifeq "$(RESPONSE)" "1"
|
|
USE_RESPONSEFILE=1
|
|
endif
|
|
ifeq "$(response)" "1"
|
|
USE_RESPONSEFILE=1
|
|
endif
|
|
|
|
ifeq "$(USE_RESPONSEFILE)" "1"
|
|
RESPONSEFILES=create_responsefiles
|
|
CXXFLAGS = $(CCXXFLAGS) -I. -I$(QTDIR)/include $(QTCXXFLAGS)
|
|
CC_COMPILER_SWITCHES := $(subst \,\\,$(CFLAGS))
|
|
CC_COMPILER_SWITCHES := $(subst ",\",$(CC_COMPILER_SWITCHES))
|
|
CXX_COMPILER_SWITCHES := $(subst \,\\,$(CXXFLAGS))
|
|
CXX_COMPILER_SWITCHES := $(subst ",\",$(CXX_COMPILER_SWITCHES))
|
|
CC_RESPONSEFILE=../src/nethack_cc.rsp
|
|
CXX_RESPONSEFILE=../src/nethack_cxx.rsp
|
|
CFLAGS=@$(CC_RESPONSEFILE)
|
|
CXXFLAGS=@$(CXX_RESPONSEFILE)
|
|
CLEAN_CC_RESPONSEFILE=rm -f $(CC_RESPONSEFILE);
|
|
CLEAN_CXX_RESPONSEFILE=rm -f $(CXX_RESPONSEFILE);
|
|
endif
|
|
|
|
#end of response.370
|
|
#------------------------------------------------------------------------------
|