hints/*.2020 vs CFLAGS, take 3...
Avoid use of GNU make's 'override' feature by requiring 'make CCFLAGS=-O' to replace -g from the make command line instead of 'make CFLAGS=-O'. Note the extra 'C' in the spelling. Revert the previous umpteen MORECFLAGS+= back to normal CFLAGS+=.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
# NetHack 3.7 linux.2020 $NHDT-Date: 1599593762 2020/09/08 19:36:02 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.10 $
|
# NetHack 3.7 linux.2020 $NHDT-Date: 1599687610 2020/09/09 21:40:10 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.11 $
|
||||||
# Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007.
|
# Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007.
|
||||||
# NetHack may be freely redistributed. See license for details.
|
# NetHack may be freely redistributed. See license for details.
|
||||||
#
|
#
|
||||||
@@ -16,12 +16,16 @@
|
|||||||
# linux.2020 hints file provides a single-user build for Linux (such
|
# linux.2020 hints file provides a single-user build for Linux (such
|
||||||
# as Ubuntu focal).
|
# as Ubuntu focal).
|
||||||
|
|
||||||
# compiler flags: various -I, -D, and -W get appended below;
|
# compiler flags: CCFLAGS is used to construct a value for CFLAGS with
|
||||||
|
# various -I, -D, and -W settings appended below;
|
||||||
# these are the settings of most interest for an end-user build
|
# these are the settings of most interest for an end-user build
|
||||||
# (clang doesn't support '-Og', gcc needs 4.x or later)
|
# (clang doesn't support '-Og', gcc needs 4.x or later)
|
||||||
CFLAGS = -g
|
CCFLAGS = -g
|
||||||
#CFLAGS = -g -Og
|
#CCFLAGS = -g -Og
|
||||||
#CFLAGS = -O2
|
#CCFLAGS = -O2
|
||||||
|
# Note: this is not the usual 'CFLAGS' which is used in default
|
||||||
|
# rules for compiling C code; specifying a value for that on the
|
||||||
|
# 'make' command line should be avoided.
|
||||||
|
|
||||||
# note: '#-INCLUDE' is not just a comment; multiw-1 contains sections 1 to 3
|
# note: '#-INCLUDE' is not just a comment; multiw-1 contains sections 1 to 3
|
||||||
#-INCLUDE multiw-1.2020
|
#-INCLUDE multiw-1.2020
|
||||||
@@ -53,42 +57,41 @@ GAMEGRP = games
|
|||||||
|
|
||||||
#-INCLUDE multiw-2.2020
|
#-INCLUDE multiw-2.2020
|
||||||
|
|
||||||
# MORECFLAGS is eventually appended to CFLAGS
|
CFLAGS=$(CCFLAGS) -I../include -DNOTPARMDECL
|
||||||
MORECFLAGS=-I../include -DNOTPARMDECL
|
|
||||||
|
|
||||||
ifeq "$(CCISCLANG)" ""
|
ifeq "$(CCISCLANG)" ""
|
||||||
# get the version of gcc
|
# get the version of gcc
|
||||||
GCCGTEQ9 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 9)
|
GCCGTEQ9 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 9)
|
||||||
ifeq "$(GCCGTEQ9)" "1"
|
ifeq "$(GCCGTEQ9)" "1"
|
||||||
MORECFLAGS+=-Wno-format-overflow
|
CFLAGS+=-Wno-format-overflow
|
||||||
endif #gcc version greater than or equal to 9
|
endif #gcc version greater than or equal to 9
|
||||||
endif #not clang
|
endif #not clang
|
||||||
# As of LLVM build 2336.1.00, this gives dozens of spurious messages, so
|
# As of LLVM build 2336.1.00, this gives dozens of spurious messages, so
|
||||||
# leave it out by default.
|
# leave it out by default.
|
||||||
#MORECFLAGS+=-Wunreachable-code
|
#CFLAGS+=-Wunreachable-code
|
||||||
#MORECFLAGS+=-Wall -Wextra -Wno-missing-field-initializers -Wimplicit \
|
#CFLAGS+=-Wall -Wextra -Wno-missing-field-initializers -Wimplicit \
|
||||||
# -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings
|
# -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings
|
||||||
#MORECFLAGS+=-DGCC_WARN
|
#CFLAGS+=-DGCC_WARN
|
||||||
|
|
||||||
# NetHack sources control
|
# NetHack sources control
|
||||||
MORECFLAGS+=-DDLB
|
CFLAGS+=-DDLB
|
||||||
MORECFLAGS+=-DHACKDIR=\"$(HACKDIR)\"
|
CFLAGS+=-DHACKDIR=\"$(HACKDIR)\"
|
||||||
MORECFLAGS+=-DDEFAULT_WINDOW_SYS=\"$(WANT_DEFAULT)\"
|
CFLAGS+=-DDEFAULT_WINDOW_SYS=\"$(WANT_DEFAULT)\"
|
||||||
MORECFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
|
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
|
||||||
MORECFLAGS+=-DTIMED_DELAY
|
CFLAGS+=-DTIMED_DELAY
|
||||||
MORECFLAGS+=-DDUMPLOG
|
CFLAGS+=-DDUMPLOG
|
||||||
MORECFLAGS+=-DCONFIG_ERROR_SECURE=FALSE
|
CFLAGS+=-DCONFIG_ERROR_SECURE=FALSE
|
||||||
#MORECFLAGS+=-DGREPPATH=\"/usr/bin/grep\"
|
#CFLAGS+=-DGREPPATH=\"/usr/bin/grep\"
|
||||||
MORECFLAGS+=-DCOMPRESS=\"/bin/gzip\" -DCOMPRESS_EXTENSION=\".gz\"
|
CFLAGS+=-DCOMPRESS=\"/bin/gzip\" -DCOMPRESS_EXTENSION=\".gz\"
|
||||||
#MORECFLAGS+=-DNOMAIL
|
#CFLAGS+=-DNOMAIL
|
||||||
#MORECFLAGS+=-DEXTRA_SANITY_CHECKS
|
#CFLAGS+=-DEXTRA_SANITY_CHECKS
|
||||||
#MORECFLAGS+=-DEDIT_GETLIN
|
#CFLAGS+=-DEDIT_GETLIN
|
||||||
#MORECFLAGS+=-DSCORE_ON_BOTL
|
#CFLAGS+=-DSCORE_ON_BOTL
|
||||||
#MORECFLAGS+=-DMSGHANDLER
|
#CFLAGS+=-DMSGHANDLER
|
||||||
#MORECFLAGS+=-DTTY_TILES_ESCCODES
|
#CFLAGS+=-DTTY_TILES_ESCCODES
|
||||||
#MORECFLAGS+=-DTTY_SOUND_ESCCODES
|
#CFLAGS+=-DTTY_SOUND_ESCCODES
|
||||||
|
|
||||||
MORECFLAGS+= $(WINCFLAGS) #WINCFLAGS set from multiw-2.2020
|
CFLAGS+= $(WINCFLAGS) #WINCFLAGS set from multiw-2.2020
|
||||||
|
|
||||||
VARDATND =
|
VARDATND =
|
||||||
VARDATND0 =
|
VARDATND0 =
|
||||||
@@ -122,7 +125,7 @@ X11CFLAGS = -I/opt/X11/include
|
|||||||
# avoid repeated complaints about _X_NONNULL(args...) in <X11/Xfuncproto.h>
|
# avoid repeated complaints about _X_NONNULL(args...) in <X11/Xfuncproto.h>
|
||||||
X11CFLAGS += -Wno-variadic-macros
|
X11CFLAGS += -Wno-variadic-macros
|
||||||
ifdef USE_XPM
|
ifdef USE_XPM
|
||||||
MORECFLAGS += -DUSE_XPM
|
CFLAGS += -DUSE_XPM
|
||||||
WINX11LIB += -lXpm
|
WINX11LIB += -lXpm
|
||||||
VARDATND0 += rip.xpm
|
VARDATND0 += rip.xpm
|
||||||
endif
|
endif
|
||||||
@@ -161,13 +164,6 @@ WINOBJ = $(sort $(WINOBJ0))
|
|||||||
# prevent duplicates in VARDATND if both X11 and Qt are being supported
|
# prevent duplicates in VARDATND if both X11 and Qt are being supported
|
||||||
VARDATND += $(sort $(VARDATND0))
|
VARDATND += $(sort $(VARDATND0))
|
||||||
|
|
||||||
# if CFLAGS=foo was specified on the command line, CFLAGS+=$(MORECFLAGS)
|
|
||||||
# would be ignored without 'override'; we want to allow CFLAGS=-g vs -O
|
|
||||||
# on the command line without having to specify all the other stuff
|
|
||||||
#
|
|
||||||
override CFLAGS+=$(MORECFLAGS)
|
|
||||||
#
|
|
||||||
|
|
||||||
|
|
||||||
#PREFIX=/usr
|
#PREFIX=/usr
|
||||||
PREFIX=$(wildcard ~)/nh/install
|
PREFIX=$(wildcard ~)/nh/install
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NetHack 3.7 macOS.2020 $NHDT-Date: 1599593767 2020/09/08 19:36:07 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.72 $
|
# NetHack 3.7 macOS.2020 $NHDT-Date: 1599687615 2020/09/09 21:40:15 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.73 $
|
||||||
# Copyright (c) Kenneth Lorber, Kensington, Maryland, 2015.
|
# Copyright (c) Kenneth Lorber, Kensington, Maryland, 2015.
|
||||||
# NetHack may be freely redistributed. See license for details.
|
# NetHack may be freely redistributed. See license for details.
|
||||||
#
|
#
|
||||||
@@ -16,12 +16,16 @@
|
|||||||
# macOS X hints file
|
# macOS X hints file
|
||||||
#
|
#
|
||||||
|
|
||||||
# compiler flags: various -I, -D, and -W get appended below;
|
# compiler flags: CCFLAGS is used to construct a value for CFLAGS with
|
||||||
|
# various -I, -D, and -W settings appended below;
|
||||||
# these are the settings of most interest for an end-user build
|
# these are the settings of most interest for an end-user build
|
||||||
# (clang doesn't support '-Og', gcc needs 4.x or later)
|
# (clang doesn't support '-Og', gcc needs 4.x or later)
|
||||||
CFLAGS = -g
|
CCFLAGS = -g
|
||||||
#CFLAGS = -g -Og
|
#CCFLAGS = -g -Og
|
||||||
#CFLAGS = -O2
|
#CCFLAGS = -O2
|
||||||
|
# Note: this is not the usual 'CFLAGS' which is used in default
|
||||||
|
# rules for compiling C code; specifying a value for that on the
|
||||||
|
# 'make' command line should be avoided.
|
||||||
|
|
||||||
# note: '#-INCLUDE' is not just a comment; multiw-1 contains sections 1 to 3
|
# note: '#-INCLUDE' is not just a comment; multiw-1 contains sections 1 to 3
|
||||||
#-INCLUDE multiw-1.2020
|
#-INCLUDE multiw-1.2020
|
||||||
@@ -55,12 +59,11 @@ endif
|
|||||||
|
|
||||||
#-INCLUDE multiw-2.2020
|
#-INCLUDE multiw-2.2020
|
||||||
|
|
||||||
# MORECFLAGS is eventually appended to CFLAGS
|
CFLAGS=$(CCFLAGS) -I../include -DNOTPARMDECL
|
||||||
MORECFLAGS=-I../include -DNOTPARMDECL
|
|
||||||
|
|
||||||
ifndef WANT_WIN_QT
|
ifndef WANT_WIN_QT
|
||||||
# these are normally used when compiling nethack's core
|
# these are normally used when compiling nethack's core
|
||||||
MORECFLAGS+=-ansi -pedantic -Wno-long-long
|
CFLAGS+=-ansi -pedantic -Wno-long-long
|
||||||
# but -ansi forces -std=c90 for C or -std=c++98 for C++;
|
# but -ansi forces -std=c90 for C or -std=c++98 for C++;
|
||||||
# win/Qt/qt_*.cpp compiled with C++98 semantics trigger
|
# win/Qt/qt_*.cpp compiled with C++98 semantics trigger
|
||||||
#In file included from .../qt5/include/QtCore/qglobal.h:105:
|
#In file included from .../qt5/include/QtCore/qglobal.h:105:
|
||||||
@@ -70,30 +73,30 @@ MORECFLAGS+=-ansi -pedantic -Wno-long-long
|
|||||||
endif
|
endif
|
||||||
# As of LLVM build 2336.1.00, this gives dozens of spurious messages, so
|
# As of LLVM build 2336.1.00, this gives dozens of spurious messages, so
|
||||||
# leave it out by default.
|
# leave it out by default.
|
||||||
#MORECFLAGS+=-Wunreachable-code
|
#CFLAGS+=-Wunreachable-code
|
||||||
MORECFLAGS+=-Wall -Wextra -Wno-missing-field-initializers -Wimplicit \
|
CFLAGS+=-Wall -Wextra -Wno-missing-field-initializers -Wimplicit \
|
||||||
-Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings
|
-Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings
|
||||||
MORECFLAGS+=-DGCC_WARN
|
CFLAGS+=-DGCC_WARN
|
||||||
|
|
||||||
# NetHack sources control
|
# NetHack sources control
|
||||||
MORECFLAGS+=-DDLB
|
CFLAGS+=-DDLB
|
||||||
MORECFLAGS+=-DHACKDIR=\"$(HACKDIR)\"
|
CFLAGS+=-DHACKDIR=\"$(HACKDIR)\"
|
||||||
MORECFLAGS+=-DDEFAULT_WINDOW_SYS=\"$(WANT_DEFAULT)\" -DDLB
|
CFLAGS+=-DDEFAULT_WINDOW_SYS=\"$(WANT_DEFAULT)\" -DDLB
|
||||||
MORECFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
|
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
|
||||||
#MORECFLAGS+=-DTIMED_DELAY
|
#CFLAGS+=-DTIMED_DELAY
|
||||||
#MORECFLAGS+=-DDUMPLOG
|
#CFLAGS+=-DDUMPLOG
|
||||||
#MORECFLAGS+=-DCONFIG_ERROR_SECURE=FALSE
|
#CFLAGS+=-DCONFIG_ERROR_SECURE=FALSE
|
||||||
MORECFLAGS+=-DGREPPATH=\"/usr/bin/grep\"
|
CFLAGS+=-DGREPPATH=\"/usr/bin/grep\"
|
||||||
#MORECFLAGS+=-DCOMPRESS=\"/bin/gzip\" -DCOMPRESS_EXTENSION=\".gz\"
|
#CFLAGS+=-DCOMPRESS=\"/bin/gzip\" -DCOMPRESS_EXTENSION=\".gz\"
|
||||||
MORECFLAGS+=-DNOMAIL
|
CFLAGS+=-DNOMAIL
|
||||||
#MORECFLAGS+=-DEXTRA_SANITY_CHECKS
|
#CFLAGS+=-DEXTRA_SANITY_CHECKS
|
||||||
#MORECFLAGS+=-DEDIT_GETLIN
|
#CFLAGS+=-DEDIT_GETLIN
|
||||||
#MORECFLAGS+=-DSCORE_ON_BOTL
|
#CFLAGS+=-DSCORE_ON_BOTL
|
||||||
#MORECFLAGS+=-DMSGHANDLER
|
#CFLAGS+=-DMSGHANDLER
|
||||||
#MORECFLAGS+=-DTTY_TILES_ESCCODES
|
#CFLAGS+=-DTTY_TILES_ESCCODES
|
||||||
#MORECFLAGS+=-DTTY_SOUND_ESCCODES
|
#CFLAGS+=-DTTY_SOUND_ESCCODES
|
||||||
|
|
||||||
MORECFLAGS+= $(WINCFLAGS) #WINCFLAGS set from multiw-2.2020
|
CFLAGS+= $(WINCFLAGS) #WINCFLAGS set from multiw-2.2020
|
||||||
|
|
||||||
VARDATND =
|
VARDATND =
|
||||||
VARDATND0 =
|
VARDATND0 =
|
||||||
@@ -127,7 +130,7 @@ X11CFLAGS = -I/opt/X11/include
|
|||||||
# avoid repeated complaints about _X_NONNULL(args...) in <X11/Xfuncproto.h>
|
# avoid repeated complaints about _X_NONNULL(args...) in <X11/Xfuncproto.h>
|
||||||
X11CFLAGS += -Wno-variadic-macros
|
X11CFLAGS += -Wno-variadic-macros
|
||||||
ifdef USE_XPM
|
ifdef USE_XPM
|
||||||
MORECFLAGS += -DUSE_XPM
|
CFLAGS += -DUSE_XPM
|
||||||
WINX11LIB += -lXpm
|
WINX11LIB += -lXpm
|
||||||
VARDATND0 += rip.xpm
|
VARDATND0 += rip.xpm
|
||||||
endif
|
endif
|
||||||
@@ -165,13 +168,6 @@ WINOBJ = $(sort $(WINOBJ0))
|
|||||||
# prevent duplicates in VARDATND if both X11 and Qt are being supported
|
# prevent duplicates in VARDATND if both X11 and Qt are being supported
|
||||||
VARDATND += $(sort $(VARDATND0))
|
VARDATND += $(sort $(VARDATND0))
|
||||||
|
|
||||||
# if CFLAGS=foo was specified on the command line, CFLAGS+=$(MORECFLAGS)
|
|
||||||
# would be ignored without 'override'; we want to allow CFLAGS=-g vs -O
|
|
||||||
# on the command line without having to specify all the other stuff
|
|
||||||
#
|
|
||||||
override CFLAGS+=$(MORECFLAGS)
|
|
||||||
#
|
|
||||||
|
|
||||||
|
|
||||||
WANT_BUNDLE=1
|
WANT_BUNDLE=1
|
||||||
ifdef WANT_SHARE_INSTALL
|
ifdef WANT_SHARE_INSTALL
|
||||||
|
|||||||
Reference in New Issue
Block a user