diff --git a/1984/decot/Makefile b/1984/decot/Makefile index cf3df28bd..74f036206 100644 --- a/1984/decot/Makefile +++ b/1984/decot/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-array-bounds -Wno-error -Wno-implicit-function-declaration \ -Wno-keyword-macro -Wno-main-return-type -Wno-missing-field-initializers \ -Wno-unused-value -Wno-unused-variable -#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 +CSTD= -std=gnu90 -# 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 -# 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-comma -Wno-format-nonliteral -Wno-missing-variable-declarations \ + -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 ############################## @@ -444,7 +452,7 @@ all: ${DATA} ${TARGET} supernova deep_magic magic charon pluto ${PROG}: ${PROG}.c - @echo "NOTE: This entry uses non-standard args to main() that do not work with modern compilers." + @echo "NOTE: This entry may not compile when using modern compilers." ${CC} ${CFLAGS} $< -o $@ ${LIBS} # alternative executable diff --git a/1984/decot/README.md b/1984/decot/README.md index 332c92a71..4df2ea516 100644 --- a/1984/decot/README.md +++ b/1984/decot/README.md @@ -6,7 +6,7 @@ Dave Decot make all -NOTE: This entry uses non-standard args to main() that do not work with modern compilers. +NOTE: This entry may not compile when using modern compilers. ## Judges' comments: