From 0b746d3161faecfd0595cee426eab218b2e0025e Mon Sep 17 00:00:00 2001 From: Landon Curt Noll Date: Tue, 21 Feb 2023 15:26:15 -0800 Subject: [PATCH] improve 1984/laman/Makefile --- 1984/laman/Makefile | 70 +++++++++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 31 deletions(-) diff --git a/1984/laman/Makefile b/1984/laman/Makefile index c4f929316..9a04a3bbc 100644 --- a/1984/laman/Makefile +++ b/1984/laman/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-error -Wno-implicit-function-declaration -Wno-implicit-int + +# 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-error -Wno-implicit-function-declaration -Wno-implicit-int -#CSILENCE= -Wno-implicit-int - -# compiler standard +# Compiler standard # #CSTD= #CSTD= -ansi -CSTD= -std=gnu11 +CSTD= -std=c11 -# compiler bit architecture +# Compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -361,12 +357,12 @@ CSTD= -std=gnu11 # 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-comma -Wno-missing-variable-declarations -Wno-pedantic \ + -Wno-poison-system-directories +# +CWARN+= -Weverything +# +endif + +# Specific add-ons or replacements for gcc only +# +ifeq ($(CC),gcc) +# +#CSILENCE+= +# +#CWARN+= +# +endif ##############################