From ba347e3e176aa991469d33dfff3115dac5cc97ac Mon Sep 17 00:00:00 2001 From: Landon Curt Noll Date: Tue, 21 Feb 2023 18:38:23 -0800 Subject: [PATCH] improve 1989 Makefiles --- 1989/Makefile | 2 +- 1989/fubar/Makefile | 73 ++++++++++++++------------ 1989/jar.1/Makefile | 67 +++++++++++++----------- 1989/jar.2/Makefile | 69 +++++++++++++----------- 1989/ovdluhe/Makefile | 80 +++++++++++++++------------- 1989/paul/Makefile | 70 ++++++++++++++----------- 1989/robison/Makefile | 68 +++++++++++++----------- 1989/roemer/Makefile | 71 ++++++++++++++----------- 1989/tromp/Makefile | 118 ++++++++++++++++++++++++++++++++++++++++-- 1989/vanb/Makefile | 69 +++++++++++++----------- 1989/westley/Makefile | 70 ++++++++++++++----------- 11 files changed, 466 insertions(+), 291 deletions(-) diff --git a/1989/Makefile b/1989/Makefile index 59740ffc3..953449a18 100644 --- a/1989/Makefile +++ b/1989/Makefile @@ -50,7 +50,7 @@ # tool locations ################ # -SHELL= /bin/bash +SHELL= bash MAKE= make diff --git a/1989/fubar/Makefile b/1989/fubar/Makefile index 2295a232f..3ae32df95 100644 --- a/1989/fubar/Makefile +++ b/1989/fubar/Makefile @@ -327,29 +327,25 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings +# Common C compiler warnings to silence # -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra +#CSILENCE= +CSILENCE= -Wno-implicit-function-declaration -Wno-incompatible-library-redeclaration + +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} #CWARN= -Wall -Wextra ${CSILENCE} CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} -# Silence warnings that ${CWARN} would normally complain about -# -CSILENCE= -Wno-implicit-function-declaration -Wno-incompatible-library-redeclaration -#CSILENCE= -Wno-implicit-int - -# compiler standard +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -361,12 +357,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -375,7 +371,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -388,7 +384,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -399,20 +395,31 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +#CSILENCE+= +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## @@ -423,11 +430,11 @@ ENTRY= fubar PROG= ${ENTRY} # OBJ= ${PROG}.o -DATA= fubar.sh fubar.orig.sh +DATA= fubar.sh TARGET= ${PROG} # -ALT_OBJ= ${PROG}.orig.o -ALT_TARGET= ${PROG}.orig +ALT_OBJ= +ALT_TARGET= ################# diff --git a/1989/jar.1/Makefile b/1989/jar.1/Makefile index 67d24cc15..8464ccd4c 100644 --- a/1989/jar.1/Makefile +++ b/1989/jar.1/Makefile @@ -327,29 +327,25 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings -# -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -# Silence warnings that ${CWARN} would normally complain about +# Common C compiler warnings to silence # CSILENCE= #CSILENCE= -Wno-implicit-int -# compiler standard +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +#CWARN= -Wall -Wextra ${CSILENCE} +CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -361,12 +357,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -375,7 +371,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -388,7 +384,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -399,20 +395,31 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +#CSILENCE+= +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1989/jar.2/Makefile b/1989/jar.2/Makefile index db2d8da90..154a11592 100644 --- a/1989/jar.2/Makefile +++ b/1989/jar.2/Makefile @@ -327,29 +327,25 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings -# -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra -CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -# Silence warnings that ${CWARN} would normally complain about +# Common C compiler warnings to silence # +#CSILENCE= CSILENCE= -Wno-implicit-function-declaration -Wno-missing-braces -Wno-parentheses -#CSILENCE= -Wno-implicit-int -# compiler standard +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +#CWARN= -Wall -Wextra ${CSILENCE} +CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -361,12 +357,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -375,7 +371,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -388,7 +384,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -399,20 +395,31 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +#CSILENCE+= +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1989/ovdluhe/Makefile b/1989/ovdluhe/Makefile index 5345a25f7..aa28e69ab 100644 --- a/1989/ovdluhe/Makefile +++ b/1989/ovdluhe/Makefile @@ -327,30 +327,27 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings +# Common C compiler warnings to silence # -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra +#CSILENCE= +CSILENCE= -Wno-char-subscripts -Wno-constant-conversion -Wno-empty-body \ + -Wno-implicit-function-declaration -Wno-parentheses -Wno-unsequenced \ + -Wno-unused-variable + +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} #CWARN= -Wall -Wextra ${CSILENCE} CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} -# Silence warnings that ${CWARN} would normally complain about -# -CSILENCE= -Wno-char-subscripts -Wno-constant-conversion -Wno-empty-body \ - -Wno-implicit-function-declaration -Wno-parentheses -Wno-unsequenced -#CSILENCE= -Wno-implicit-int - -# compiler standard +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -362,12 +359,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -376,7 +373,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -389,7 +386,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -400,20 +397,33 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-comma -Wno-implicit-int-conversion -Wno-missing-prototypes \ + -Wno-missing-variable-declarations -Wno-poison-system-directories + -Wno-sign-conversion -Wno-strict-prototypes +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## @@ -427,8 +437,8 @@ OBJ= ${PROG}.o DATA= TARGET= ${PROG} # -ALT_OBJ= ${PROG}.orig.o -ALT_TARGET= ${PROG}.orig +ALT_OBJ= +ALT_TARGET= ################# @@ -451,10 +461,6 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} -${PROG}.orig: ${PROG}.orig.c - @echo "NOTE: The original source may not compile using modern compilers." - ${CC} ${CFLAGS} $< -o $@ ${LIBS} - # data files # data: ${DATA} diff --git a/1989/paul/Makefile b/1989/paul/Makefile index d8503a226..570cf962c 100644 --- a/1989/paul/Makefile +++ b/1989/paul/Makefile @@ -327,31 +327,27 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings -# -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra -CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -# Silence warnings that ${CWARN} would normally complain about +# Common C compiler warnings to silence # +#CSILENCE= CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-format-security \ -Wno-incompatible-library-redeclaration -Wno-int-to-pointer-cast \ -Wno-pointer-to-int-cast -Wno-return-type -#CSILENCE= -Wno-implicit-int -# compiler standard +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +CWARN= -Wall -Wextra ${CSILENCE} +#CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -363,12 +359,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -377,7 +373,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -390,7 +386,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -401,20 +397,32 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-cast-align -Wno-missing-prototypes -Wno-pedantic \ + -Wno-poison-system-directories -Wno-strict-prototypes +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1989/robison/Makefile b/1989/robison/Makefile index eab91fb95..dc5bde980 100644 --- a/1989/robison/Makefile +++ b/1989/robison/Makefile @@ -327,29 +327,25 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings +# Common C compiler warnings to silence # -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra +#CSILENCE= +CSILENCE= -Wno-unused-parameter + +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} #CWARN= -Wall -Wextra ${CSILENCE} CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} -# Silence warnings that ${CWARN} would normally complain about -# -CSILENCE= -Wno-unused-parameter -#CSILENCE= -Wno-implicit-int - -# compiler standard +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -361,12 +357,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -375,7 +371,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -388,7 +384,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -399,20 +395,32 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-missing-prototypes -Wno-poison-system-directories \ + -Wno-strict-prototypes +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1989/roemer/Makefile b/1989/roemer/Makefile index 770abb687..048d30bef 100644 --- a/1989/roemer/Makefile +++ b/1989/roemer/Makefile @@ -327,30 +327,26 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings -# -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -# Silence warnings that ${CWARN} would normally complain about +# Common C compiler warnings to silence # +#CSILENCE= CSILENCE= -Wno-char-subscripts -Wno-error -Wno-implicit-function-declaration \ -Wno-string-plus-int -Wno-unused-value -#CSILENCE= -Wno-implicit-int -# compiler standard +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +#CWARN= -Wall -Wextra ${CSILENCE} +CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -362,12 +358,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -376,7 +372,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -389,7 +385,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -400,20 +396,33 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-array-bounds-pointer-arithmetic -Wno-comma \ + -Wno-implicit-int-conversion -Wno-missing-variable-declarations \ + -Wno-poison-system-directories +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1989/tromp/Makefile b/1989/tromp/Makefile index 7122e751f..18d0eea92 100644 --- a/1989/tromp/Makefile +++ b/1989/tromp/Makefile @@ -345,13 +345,13 @@ CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-pointer-to-int-cast -Wno-string-plus-int -Wno-return-type -Wno-unknown-warning-option #CSILENCE= -Wno-implicit-int -# compiler standard +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -363,12 +363,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC=26 -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -377,7 +377,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -416,6 +416,114 @@ CC= cc #CC=clang MAY_NEED_GCC= gcc +# Set X11_LIBDIR to the directory where the X11 library resides +# +#X11_LIBDIR= /usr/X11R6/lib +#X11_LIBDIR= /usr/X11/lib +X11_LIBDIR= /opt/X11/lib + +# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# +#X11_INCDIR= /usr/X11R6/include +#X11_INCDIR= /usr/X11/include +X11_INCDIR= /opt/X11/include + +# Common C compiler warnings to silence +# +#CSILENCE= +CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-pointer-to-int-cast \ + -Wno-no-return-type -Wno-builtin-requires-header -Wno-empty-body \ + -Wno-string-plus-int -Wno-return-type -Wno-unknown-warning-option + +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +CWARN= -Wall -Wextra ${CSILENCE} +#CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard +# +#CSTD= +#CSTD= -ansi +CSTD= -std=gnu89 + +# Compiler bit architecture +# +# Some entries require 32-bitness: +# ARCH= -m32 +# +# Some entries require 64-bitness: +# ARCH= -m64 +# +# By default we assume nothing: +# +ARCH= + +# Defines that are needed to compile +# +CDEFINE= +#CDEFINE= -DIOCCC + +# Include files that are needed to compile +# +CINCLUDE= +#CINCLUDE= -include stdlib.h +#CINCLUDE= -include stdio.h +#CINCLUDE= -include stdlib.h -include stdio.h +#CINCLUDE= -I ${X11_INCDIR} +#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 + +# Optimization +# +# Most compiles will safely use -O2. Some can use only -O1 or -O. +# A few compilers have broken optimizers or this entry make break +# under those buggy optimizers and thus you may not want anything. +# Reasonable compilers will allow for -O3. +# +#OPT= +#OPT= -O +#OPT= -O1 +#OPT= -O2 +OPT= -O3 + +# Default flags for ANSI C compilation +# +CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} + +# Libraries needed to build +# +LIBS= +#LIBS= -lm +#LIBS= -L ${X11_LIBDIR} -lX11 +#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL + +# C compiler to use +# +CC= cc +#CC=clang +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +#CSILENCE+= +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif + ############################## # Special flags for this entry diff --git a/1989/vanb/Makefile b/1989/vanb/Makefile index 7c375cc73..9a106df6c 100644 --- a/1989/vanb/Makefile +++ b/1989/vanb/Makefile @@ -327,29 +327,25 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings -# -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -# Silence warnings that ${CWARN} would normally complain about +# Common C compiler warnings to silence # +#CSILENCE= CSILENCE= -Wno-char-subscripts -Wno-error -Wno-implicit-function-declaration -Wno-pedantic -#CSILENCE= -Wno-implicit-int -# compiler standard +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +CWARN= -Wall -Wextra ${CSILENCE} +#CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -361,12 +357,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # CDEFINE= -#CDEFINE= -DIOCCC=26 +#CDEFINE= -DIOCCC -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -375,7 +371,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -388,7 +384,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -399,20 +395,31 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-poison-system-directories +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ############################## diff --git a/1989/westley/Makefile b/1989/westley/Makefile index c687f9c63..caa49fd3e 100644 --- a/1989/westley/Makefile +++ b/1989/westley/Makefile @@ -327,30 +327,26 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings -# -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -# Silence warnings that ${CWARN} would normally complain about +# Common C compiler warnings to silence # +#CSILENCE= CSILENCE= -Wno-comment -Wno-error -Wno-implicit-function-declaration \ -Wno-logical-op-parentheses -#CSILENCE= -Wno-implicit-int -# compiler standard +# Common C compiler warning flags +# +#CWARN= ${CSILENCE} +#CWARN= -Wall ${CSILENCE} +CWARN= -Wall -Wextra ${CSILENCE} +#CWARN= -Wall -Wextra -pedantic ${CSILENCE} + +# Compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=gnu89 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -362,12 +358,12 @@ CSTD= -std=gnu89 # ARCH= -# defines that are needed to compile +# Defines that are needed to compile # +#CDEFINE= CDEFINE= -Dtrgpune=putchar -#CDEFINE= -DIOCCC=26 -# include files that are needed to compile +# Include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -376,7 +372,7 @@ CINCLUDE= #CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# optimization +# Optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break @@ -389,7 +385,7 @@ CINCLUDE= #OPT= -O2 OPT= -O3 -# default flags for ANSI C compilation +# Default flags for ANSI C compilation # CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} @@ -400,20 +396,32 @@ LIBS= #LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# C compiler to use # CC= cc #CC=clang -MAY_NEED_GCC= gcc +#CC=gcc + +# Compiler add-ons or replacements for clang only +# +ifeq ($(CC),clang) +# +CSILENCE+= -Wno-missing-prototypes -Wno-pedantic -Wno-poison-system-directories \ + -Wno-strict-prototypes +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ##############################