scripts: Set the compiler warning options to "-Wall -Wextra -Wundef"

Considering that "-Wextra" is a more descriptive alternative to "-W",
and that "-Wundef" is a highly useful warning option that has been
available in ancient versions of gcc (version 2.x), we replace all
occurrences of "-W -Wall" with "-Wall -Wextra -Wundef".

Also clean up the makefiles.
diff --git a/scripts/makefile.32sunu b/scripts/makefile.32sunu
index 0aeaa36..2993e0f 100644
--- a/scripts/makefile.32sunu
+++ b/scripts/makefile.32sunu
@@ -1,6 +1,6 @@
 # makefile for libpng on Solaris 2.x with cc
 # Contributed by William L. Sebok, based on makefile.linux
-# Copyright (C) 2020 Cosmin Truta
+# Copyright (C) 2020-2022 Cosmin Truta
 # Copyright (C) 2002, 2006, 2010-2014 Glenn Randers-Pehrson
 # Copyright (C) 1998 Greg Roelofs
 # Copyright (C) 1996, 1997 Andreas Dilger
@@ -22,9 +22,9 @@
 # Utilities:
 CC=cc
 AR_RC=ar rc
+RANLIB=echo
 MKDIR_P=mkdir -p
 LN_SF=ln -f -s
-RANLIB=echo
 RM_F=/bin/rm -f
 
 SUN_CC_FLAGS=-fast -xtarget=ultra
@@ -45,7 +45,7 @@
 
 WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
 	-Wmissing-declarations -Wtraditional -Wcast-align \
-	-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
+	-Wstrict-prototypes -Wmissing-prototypes # -Wconversion
 CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
 CFLAGS=$(SUN_CC_FLAGS) # $(WARNMORE) -g
 LDFLAGS=$(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) libpng.a -lz -lm
diff --git a/scripts/makefile.64sunu b/scripts/makefile.64sunu
index 2aeb3b2..567c7e6 100644
--- a/scripts/makefile.64sunu
+++ b/scripts/makefile.64sunu
@@ -1,6 +1,6 @@
 # makefile for libpng on Solaris 2.x with cc
 # Contributed by William L. Sebok, based on makefile.linux
-# Copyright (C) 2020 Cosmin Truta
+# Copyright (C) 2020-2022 Cosmin Truta
 # Copyright (C) 2002, 2006, 2010-2014 Glenn Randers-Pehrson
 # Copyright (C) 1998 Greg Roelofs
 # Copyright (C) 1996, 1997 Andreas Dilger
@@ -22,9 +22,9 @@
 # Utilities:
 CC=cc
 AR_RC=ar rc
+RANLIB=echo
 MKDIR_P=mkdir -p
 LN_SF=ln -f -s
-RANLIB=echo
 RM_F=/bin/rm -f
 
 SUN_CC_FLAGS=-fast -xtarget=ultra -xarch=v9
@@ -45,7 +45,7 @@
 
 WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
 	-Wmissing-declarations -Wtraditional -Wcast-align \
-	-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
+	-Wstrict-prototypes -Wmissing-prototypes # -Wconversion
 CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
 CFLAGS= $(SUN_CC_FLAGS) # $(WARNMORE) -g
 LDFLAGS=-L. -R. $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm
diff --git a/scripts/makefile.aix b/scripts/makefile.aix
index 8ebc6ac..c5cc530 100644
--- a/scripts/makefile.aix
+++ b/scripts/makefile.aix
@@ -1,6 +1,6 @@
 # makefile for libpng using gcc (generic, static library)
+# Copyright (C) 2000, 2022 Cosmin Truta
 # Copyright (C) 2002, 2006-2009, 2014 Glenn Randers-Pehrson
-# Copyright (C) 2000 Cosmin Truta
 # Copyright (C) 2000 Marc O. Gloor (AIX support added, from makefile.gcc)
 # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
 #
@@ -16,8 +16,8 @@
 CC = gcc
 LD = $(CC)
 AR_RC = ar rcs
-MKDIR_P = mkdir -p
 RANLIB = ranlib
+MKDIR_P = mkdir -p
 RM_F = rm -f
 LN_SF = ln -f -s
 
@@ -43,8 +43,8 @@
 
 WARNMORE =
 CPPFLAGS = -I$(ZLIBINC) # -DPNG_DEBUG=5
-CFLAGS = -W -Wall -O2 # $(WARNMORE) -g
-LDFLAGS = -L. -L$(ZLIBLIB) -lpng16 -lz -lm
+CFLAGS = -O2 -Wall -Wextra -Wundef # $(WARNMORE) -g
+LDFLAGS = -L. -L$(ZLIBLIB) -lpng16 -lz -lm # -g
 
 # File lists
 OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
diff --git a/scripts/makefile.beos b/scripts/makefile.beos
index 8781362..2ed049e 100644
--- a/scripts/makefile.beos
+++ b/scripts/makefile.beos
@@ -1,5 +1,6 @@
 # makefile for libpng on BeOS x86 ELF with gcc
 # modified from makefile.linux by Sander Stoks
+# Copyright (C) 2020-2022 Cosmin Truta
 # Copyright (C) 2002, 2006, 2008, 2010-2014 Glenn Randers-Pehrson
 # Copyright (C) 1999 Greg Roelofs
 # Copyright (C) 1996, 1997 Andreas Dilger
@@ -21,9 +22,9 @@
 # Utilities:
 CC=gcc
 AR_RC=ar rc
+RANLIB=ranlib
 MKDIR_P=mkdir -p
 LN_SF=ln -sf
-RANLIB=ranlib
 CP=cp
 RM_F=/bin/rm -f
 
@@ -37,14 +38,14 @@
 
 WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
 	-Wmissing-declarations -Wtraditional -Wcast-align \
-	-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
+	-Wstrict-prototypes -Wmissing-prototypes # -Wconversion
 
 # On BeOS, -O1 is actually better than -O3.  This is a known bug but it's
 # still here in R4.5
 CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
-CFLAGS=-W -Wall -O1 -funroll-loops $(ALIGN) # $(WARNMORE) -g
+CFLAGS=-O1 -funroll-loops $(ALIGN) -Wall -Wextra -Wundef # $(WARNMORE) -g
 # LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng -lz
-LDFLAGS=-L. -Wl,-soname=$(LIBSOMAJ) -L$(ZLIBLIB) -lz
+LDFLAGS=-L. -Wl,-soname=$(LIBSOMAJ) -L$(ZLIBLIB) -lz # -g
 
 # where make install puts libpng.a, libpng16.so*, and png.h
 prefix=/usr/local
diff --git a/scripts/makefile.clang b/scripts/makefile.clang
index 583f6ce..fe0544a 100644
--- a/scripts/makefile.clang
+++ b/scripts/makefile.clang
@@ -1,6 +1,6 @@
 # makefile for libpng using clang (generic, static library)
+# Copyright (C) 2000, 2014, 2019-2022 Cosmin Truta
 # Copyright (C) 2008, 2014 Glenn Randers-Pehrson
-# Copyright (C) 2000, 2014, 2019 Cosmin Truta
 # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
 #
 # This code is released under the libpng license.
@@ -23,8 +23,8 @@
 	-Wmissing-declarations -Wtraditional -Wcast-align \
 	-Wstrict-prototypes -Wmissing-prototypes # -Wconversion
 CPPFLAGS = -I$(ZLIBINC) # -DPNG_DEBUG=5
-CFLAGS = -W -Wall -O2 # $(WARNMORE) -g
-LDFLAGS = -L$(ZLIBLIB)
+CFLAGS = -O2 -Wall -Wextra -Wundef # $(WARNMORE) -g
+LDFLAGS = -L$(ZLIBLIB) # -g
 LIBS = -lz -lm
 
 # File extensions
diff --git a/scripts/makefile.darwin b/scripts/makefile.darwin
index e77680f..9cc0381 100644
--- a/scripts/makefile.darwin
+++ b/scripts/makefile.darwin
@@ -1,5 +1,5 @@
-# makefile for libpng on Darwin / Mac OS X
-# Copyright (C) 2020 Cosmin Truta
+# makefile for libpng on Darwin / macOS
+# Copyright (C) 2020-2022 Cosmin Truta
 # Copyright (C) 2002, 2004, 2006, 2008, 2010-2014 Glenn Randers-Pehrson
 # Copyright (C) 2001 Christoph Pfisterer
 # derived from makefile.linux:
@@ -22,6 +22,7 @@
 # Library name:
 LIBNAME = libpng16
 PNGMAJ = 16
+RELEASE = 37
 
 # Shared library names:
 LIBSO=$(LIBNAME).dylib
@@ -32,14 +33,14 @@
 # Utilities:
 CC=cc
 AR_RC=ar rc
+RANLIB=ranlib
 MKDIR_P=mkdir -p
 LN_SF=ln -sf
-RANLIB=ranlib
 CP=cp
-RM_F=/bin/rm -f
+RM_F=rm -f
 
 CPPFLAGS=-I$(ZLIBINC)
-CFLAGS=-W -Wall -O3 -funroll-loops
+CFLAGS=-O3 -funroll-loops -Wall -Wextra -Wundef
 LDFLAGS=-L. -L$(ZLIBLIB) -lpng16 -lz
 
 INCPATH=$(prefix)/include
diff --git a/scripts/makefile.dec b/scripts/makefile.dec
index 455dce5..80a9cb3 100644
--- a/scripts/makefile.dec
+++ b/scripts/makefile.dec
@@ -17,11 +17,11 @@
 OLDSO=libpng.so
 
 # Utilities:
-AR_RC=ar rc
 CC=cc
+AR_RC=ar rc
+RANLIB=ranlib
 MKDIR_P=mkdir
 LN_SF=ln -f -s
-RANLIB=ranlib
 CP=cp
 RM_F=/bin/rm -f
 
@@ -75,7 +75,7 @@
 	$(CP) $(PNGLIBCONF_H_PREBUILT) $@
 
 libpng.a: $(OBJS)
-	$(AR_RC) $@  $(OBJS)
+	$(AR_RC) $@ $(OBJS)
 	$(RANLIB) $@
 
 libpng.pc:
diff --git a/scripts/makefile.dj2 b/scripts/makefile.dj2
index d5f8bca..3d493e6 100644
--- a/scripts/makefile.dj2
+++ b/scripts/makefile.dj2
@@ -1,4 +1,5 @@
 # DJGPP (DOS gcc) makefile for libpng
+# Copyright (C) 2020-2022 Cosmin Truta
 # Copyright (C) 2002, 2006, 2009-2014 Glenn Randers-Pehrson
 # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
 #
@@ -17,8 +18,6 @@
 CFLAGS=-O
 LDFLAGS=-L. -L../zlib/ -lpng -lz -lm
 
-RANLIB=ranlib
-
 CP=cp
 RM_F=rm -f
 
@@ -39,8 +38,8 @@
 	$(CP) $(PNGLIBCONF_H_PREBUILT) $@
 
 libpng.a: $(OBJS)
-	ar rc $@  $(OBJS)
-	$(RANLIB) $@
+	ar rc $@ $(OBJS)
+	ranlib $@
 
 pngtest: pngtest.o libpng.a
 	$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
diff --git a/scripts/makefile.freebsd b/scripts/makefile.freebsd
index e958e6d..cdd3994 100644
--- a/scripts/makefile.freebsd
+++ b/scripts/makefile.freebsd
@@ -1,5 +1,5 @@
 # makefile for libpng under FreeBSD
-# Copyright (C) 2020 Cosmin Truta
+# Copyright (C) 2020-2022 Cosmin Truta
 # Copyright (C) 2014 Glenn Randers-Pehrson and Andrey A. Chernov
 # Copyright (C) 2002, 2007, 2009 Glenn Randers-Pehrson and Andrey A. Chernov
 #
@@ -38,7 +38,7 @@
 DPADD+=		${LIBM} ${LIBZ}
 
 CPPFLAGS+=	-I. -I${ZLIBINC}
-CFLAGS+=	-W -Wall
+CFLAGS+=	-Wall -Wextra -Wundef
 
 # Pre-built configuration
 # See scripts/pnglibconf.mak for more options
diff --git a/scripts/makefile.gcc b/scripts/makefile.gcc
index 9fdd046..e2ea897 100644
--- a/scripts/makefile.gcc
+++ b/scripts/makefile.gcc
@@ -1,6 +1,6 @@
 # makefile for libpng using gcc (generic, static library)
+# Copyright (C) 2000, 2014, 2019-2022 Cosmin Truta
 # Copyright (C) 2008, 2014 Glenn Randers-Pehrson
-# Copyright (C) 2000, 2014, 2019 Cosmin Truta
 # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
 #
 # This code is released under the libpng license.
@@ -23,8 +23,8 @@
 	-Wmissing-declarations -Wtraditional -Wcast-align \
 	-Wstrict-prototypes -Wmissing-prototypes # -Wconversion
 CPPFLAGS = -I$(ZLIBINC) # -DPNG_DEBUG=5
-CFLAGS = -W -Wall -O2 # $(WARNMORE) -g
-LDFLAGS = -L$(ZLIBLIB)
+CFLAGS = -O2 -Wall -Wextra -Wundef # $(WARNMORE) -g
+LDFLAGS = -L$(ZLIBLIB) # -g
 LIBS = -lz -lm
 
 # File extensions
diff --git a/scripts/makefile.hp64 b/scripts/makefile.hp64
index 6961618..c05b141 100644
--- a/scripts/makefile.hp64
+++ b/scripts/makefile.hp64
@@ -1,5 +1,5 @@
 # makefile for libpng, HPUX (10.20 and 11.00) using the ANSI/C product.
-# Copyright (C) 2020 Cosmin Truta
+# Copyright (C) 2020-2022 Cosmin Truta
 # Copyright (C) 1999-2002, 2006, 2009, 2010-2014 Glenn Randers-Pehrson
 # Copyright (C) 1995 Guy Eric Schalnat, Group 42
 # Contributed by Jim Rice and updated by Chris Schleicher, Hewlett Packard
@@ -30,11 +30,11 @@
 OLDSO=libpng.sl
 
 # Utilities:
-AR_RC=ar rc
 CC=cc
+AR_RC=ar rc
+RANLIB=ranlib
 MKDIR_P=mkdir -p
 LN_SF=ln -sf
-RANLIB=ranlib
 CP=cp
 RM_F=/bin/rm -f
 
diff --git a/scripts/makefile.hpgcc b/scripts/makefile.hpgcc
index f7caaa3..84bdb54 100644
--- a/scripts/makefile.hpgcc
+++ b/scripts/makefile.hpgcc
@@ -1,5 +1,5 @@
 # makefile for libpng on HP-UX using GCC with the HP ANSI/C linker.
-# Copyright (C) 2020 Cosmin Truta
+# Copyright (C) 2020-2022 Cosmin Truta
 # Copyright (C) 2002, 2006-2008, 2010-2014 Glenn Randers-Pehrson
 # Copyright (C) 2001, Laurent faillie
 # Copyright (C) 1998, 1999 Greg Roelofs
@@ -23,9 +23,9 @@
 CC=gcc
 LD=ld
 AR_RC=ar rc
+RANLIB=ranlib
 MKDIR_P=mkdir -p
 LN_SF=ln -sf
-RANLIB=ranlib
 CP=cp
 RM_F=/bin/rm -f
 
@@ -47,12 +47,12 @@
 
 WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
 	-Wmissing-declarations -Wtraditional -Wcast-align \
-	-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
+	-Wstrict-prototypes -Wmissing-prototypes # -Wconversion
 
 CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
-CFLAGS=-W -Wall -O3 -funroll-loops # $(WARNMORE) -g
-#LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng16 -lz -lm
-LDFLAGS=-L. -L$(ZLIBLIB) -lpng16 -lz -lm
+CFLAGS=-O3 -funroll-loops -Wall -Wextra -Wundef # $(WARNMORE) -g
+#LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng16 -lz -lm # -g
+LDFLAGS=-L. -L$(ZLIBLIB) -lpng16 -lz -lm # -g
 
 INCPATH=$(prefix)/include
 LIBPATH=$(exec_prefix)/lib
diff --git a/scripts/makefile.hpux b/scripts/makefile.hpux
index e412ba5..58b0f9d 100644
--- a/scripts/makefile.hpux
+++ b/scripts/makefile.hpux
@@ -1,5 +1,5 @@
 # makefile for libpng, HPUX (10.20 and 11.00) using the ANSI/C product.
-# Copyright (C) 2020 Cosmin Truta
+# Copyright (C) 2020-2022 Cosmin Truta
 # Copyright (C) 1999-2002, 2006, 2010-2014 Glenn Randers-Pehrson
 # Copyright (C) 1995 Guy Eric Schalnat, Group 42
 # Contributed by Jim Rice and updated by Chris Schleicher, Hewlett Packard
@@ -31,11 +31,11 @@
 OLDSO=libpng.sl
 
 # Utilities:
-AR_RC=ar rc
 CC=cc
+AR_RC=ar rc
+RANLIB=ranlib
 MKDIR_P=mkdir -p
 LN_SF=ln -sf
-RANLIB=ranlib
 RM_F=/bin/rm -f
 
 # where make install puts libpng.a, libpng16.sl, and png.h
diff --git a/scripts/makefile.linux b/scripts/makefile.linux
index 0142255..7b1b9b0 100644
--- a/scripts/makefile.linux
+++ b/scripts/makefile.linux
@@ -1,5 +1,5 @@
 # makefile for libpng.a and libpng16.so on Linux ELF with gcc
-# Copyright (C) 2020 Cosmin Truta
+# Copyright (C) 2020-2022 Cosmin Truta
 # Copyright (C) 1998, 1999, 2002, 2006, 2008, 2010-2014 Greg Roelofs and
 # Glenn Randers-Pehrson
 # Copyright (C) 1996, 1997 Andreas Dilger
@@ -20,13 +20,13 @@
 OLDSO=libpng.so
 
 # Utilities:
-AR_RC=ar rc
 CC=gcc
+AR_RC=ar rc
+RANLIB=ranlib
 MKDIR_P=mkdir -p
 LN_SF=ln -sf
-RANLIB=ranlib
 CP=cp
-RM_F=/bin/rm -f
+RM_F=rm -f
 
 # where "make install" puts libpng16.a, libpng16.so*,
 # libpng16/png.h, libpng16/pngconf.h, and libpng16/pnglibconf.h
@@ -42,13 +42,12 @@
 
 WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
 	-Wmissing-declarations -Wtraditional -Wcast-align \
-	-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
+	-Wstrict-prototypes -Wmissing-prototypes # -Wconversion
 
 CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
-CFLAGS=-W -Wall -O3 -funroll-loops # $(WARNMORE) -g
-
-LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng16 -lz -lm
-LDFLAGS_A=-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) libpng.a -lz -lm
+CFLAGS=-O3 -funroll-loops -Wall -Wextra -Wundef # $(WARNMORE) -g
+LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng16 -lz -lm # -g
+LDFLAGS_A=-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) libpng.a -lz -lm # -g
 
 INCPATH=$(prefix)/include
 LIBPATH=$(exec_prefix)/lib
diff --git a/scripts/makefile.linux-opt b/scripts/makefile.linux-opt
index d2619f9..52874c9 100644
--- a/scripts/makefile.linux-opt
+++ b/scripts/makefile.linux-opt
@@ -1,5 +1,5 @@
 # makefile for libpng.a and libpng16.so on Linux ELF with gcc
-# Copyright (C) 2020 Cosmin Truta
+# Copyright (C) 2020-2022 Cosmin Truta
 # Copyright (C) 1998, 1999, 2002, 2006, 2008, 2010-2014, 2017 Greg Roelofs and
 # Glenn Randers-Pehrson
 # Copyright (C) 1996, 1997 Andreas Dilger
@@ -20,13 +20,13 @@
 OLDSO=libpng.so
 
 # Utilities:
-AR_RC=ar rc
 CC=gcc
+AR_RC=ar rc
+RANLIB=ranlib
 MKDIR_P=mkdir -p
 LN_SF=ln -sf
-RANLIB=ranlib
 CP=cp
-RM_F=/bin/rm -f
+RM_F=rm -f
 
 # where "make install" puts libpng16.a, libpng16.so*,
 # libpng16/png.h, libpng16/pngconf.h, and libpng16/pnglibconf.h
@@ -42,7 +42,7 @@
 
 WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
 	-Wmissing-declarations -Wtraditional -Wcast-align \
-	-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
+	-Wstrict-prototypes -Wmissing-prototypes # -Wconversion
 
 CPPFLAGS=-I$(ZLIBINC)
 CPPFLAGS += -DPNG_ARM_NEON
@@ -50,11 +50,9 @@
 CPPFLAGS += -DPNG_INTEL_SSE
 CPPFLAGS += -DPNG_POWERPC_VSX
 
-CFLAGS=-W -Wall -O3 -funroll-loops # $(WARNMORE) -g
-CFLAGS += -ansi -pedantic
-
-LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng16 -lz -lm
-LDFLAGS_A=-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) libpng.a -lz -lm
+CFLAGS=-O3 -funroll-loops -Wall -Wextra -Wundef # $(WARNMORE) -g
+LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng16 -lz -lm # -g
+LDFLAGS_A=-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) libpng.a -lz -lm # -g
 
 INCPATH=$(prefix)/include
 LIBPATH=$(exec_prefix)/lib
diff --git a/scripts/makefile.mips b/scripts/makefile.mips
index 1f9000b..c96eb61 100644
--- a/scripts/makefile.mips
+++ b/scripts/makefile.mips
@@ -1,5 +1,5 @@
 # makefile for libpng
-# Copyright (C) 2020 Cosmin Truta
+# Copyright (C) 2020-2022 Cosmin Truta
 # Copyright (C) 1998-2014 Glenn Randers-Pehrson
 # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
 #
@@ -50,7 +50,7 @@
 	$(CP) $(PNGLIBCONF_H_PREBUILT) $@
 
 libpng.a: $(OBJS)
-	ar rc $@  $(OBJS)
+	ar rc $@ $(OBJS)
 	$(RANLIB) $@
 
 pngtest: pngtest.o libpng.a
diff --git a/scripts/makefile.msys b/scripts/makefile.msys
index 57c8ea3..9b4149e 100644
--- a/scripts/makefile.msys
+++ b/scripts/makefile.msys
@@ -1,5 +1,5 @@
 # makefile for libpng using MSYS/gcc (shared, static library)
-# Copyright (C) 2019-2020 Cosmin Truta
+# Copyright (C) 2019-2022 Cosmin Truta
 # Copyright (C) 2012 Glenn Randers-Pehrson and Christopher M. Wheeler
 #
 # Portions taken from makefile.linux and makefile.gcc:
@@ -44,8 +44,8 @@
 LN_SF=ln -sf
 
 CPPFLAGS = # -DPNG_DEBUG=5
-CFLAGS = -W -Wall -O2 # -g
-LDFLAGS =
+CFLAGS = -O2 -Wall -Wextra -Wundef # -g
+LDFLAGS = # -g
 LIBS = -lz -lm
 
 # File extensions
diff --git a/scripts/makefile.openbsd b/scripts/makefile.openbsd
index 2061a1e..ad1da03 100644
--- a/scripts/makefile.openbsd
+++ b/scripts/makefile.openbsd
@@ -1,4 +1,5 @@
 # makefile for libpng
+# Copyright (C) 2020-2022 Cosmin Truta
 # Copyright (C) 2007-2009, 2014 Glenn Randers-Pehrson
 # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
 #
@@ -22,7 +23,7 @@
 DOCS=	ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO \
 	libpng-manual.txt
 
-CFLAGS+= -W -Wall
+CFLAGS+= -Wall -Wextra -Wundef
 CPPFLAGS+= -I${.CURDIR}
 
 NOPROFILE= Yes
diff --git a/scripts/makefile.sco b/scripts/makefile.sco
index 362ff0b..67cc8e7 100644
--- a/scripts/makefile.sco
+++ b/scripts/makefile.sco
@@ -1,7 +1,7 @@
 # makefile for SCO OSr5  ELF and Unixware 7 with Native cc
 # Contributed by Mike Hopkirk (hops at sco.com) modified from Makefile.lnx
 #   force ELF build dynamic linking, SONAME setting in lib and RPATH in app
-# Copyright (C) 2020 Cosmin Truta
+# Copyright (C) 2020-2022 Cosmin Truta
 # Copyright (C) 2002, 2006, 2010-2014 Glenn Randers-Pehrson
 # Copyright (C) 1998 Greg Roelofs
 # Copyright (C) 1996, 1997 Andreas Dilger
@@ -23,9 +23,9 @@
 # Utilities:
 CC=cc
 AR_RC=ar rc
+RANLIB=echo
 MKDIR_P=mkdir
 LN_SF=ln -f -s
-RANLIB=echo
 CP=cp
 RM_F=/bin/rm -f
 
diff --git a/scripts/makefile.sggcc b/scripts/makefile.sggcc
index 6958dea..37f7d2d 100644
--- a/scripts/makefile.sggcc
+++ b/scripts/makefile.sggcc
@@ -1,5 +1,5 @@
 # makefile for libpng.a and libpng16.so, SGI IRIX with 'cc'
-# Copyright (C) 2020 Cosmin Truta
+# Copyright (C) 2020-2022 Cosmin Truta
 # Copyright (C) 2001-2002, 2006, 2010-2014 Glenn Randers-Pehrson
 # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
 #
@@ -18,11 +18,11 @@
 OLDSO=libpng.so
 
 # Utilities:
-AR_RC=ar rc
 CC=gcc
+AR_RC=ar rc
+RANLIB=echo
 MKDIR_P=mkdir -p
 LN_SF=ln -sf
-RANLIB=echo
 CP=cp
 RM_F=/bin/rm -f
 
@@ -47,7 +47,7 @@
 WARNMORE=
 CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
 CFLAGS=$(ABI) -O $(WARNMORE) -fPIC -mabi=n32 # -g
-LDFLAGS=$(ABI) -L. -L$(ZLIBLIB) -lpng -lz -lm
+LDFLAGS=$(ABI) -L. -L$(ZLIBLIB) -lpng -lz -lm # -g
 LDSHARED=cc $(ABI) -shared -soname $(LIBSOMAJ) \
 	-set_version sgi$(PNGMAJ).0
 # See "man dso" for info about shared objects
diff --git a/scripts/makefile.sgi b/scripts/makefile.sgi
index 8cc27da..1ead8d8 100644
--- a/scripts/makefile.sgi
+++ b/scripts/makefile.sgi
@@ -1,5 +1,5 @@
 # makefile for libpng.a and libpng16.so, SGI IRIX with 'cc'
-# Copyright (C) 2020 Cosmin Truta
+# Copyright (C) 2020-2022 Cosmin Truta
 # Copyright (C) 2001-2002, 2006, 2007, 2010-2014 Glenn Randers-Pehrson
 # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
 #
@@ -18,11 +18,11 @@
 OLDSO=libpng.so
 
 # Utilities:
-AR_RC=ar rc
 CC=cc
+AR_RC=ar rc
+RANLIB=echo
 MKDIR_P=mkdir -p
 LN_SF=ln -sf
-RANLIB=echo
 CP=cp
 RM_F=/bin/rm -f
 
@@ -48,9 +48,9 @@
 # Note: -KPIC is the default anyhow
 CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
 #CFLAGS= $(ABI) -O $(WARNMORE) -KPIC # -g
-CFLAGS=$(ABI) -O $(WARNMORE)
-LDFLAGS_A=$(ABI) -L. -L$(ZLIBLIB) -lpng16 -lz -lm
-LDFLAGS=$(ABI) -L. -L$(ZLIBLIB) -lpng -lz -lm
+CFLAGS=$(ABI) -O $(WARNMORE) # -g
+LDFLAGS_A=$(ABI) -L. -L$(ZLIBLIB) -lpng16 -lz -lm # -g
+LDFLAGS=$(ABI) -L. -L$(ZLIBLIB) -lpng -lz -lm # -g
 LDSHARED=cc $(ABI) -shared -soname $(LIBSOMAJ) \
 	-set_version sgi$(PNGMAJ).0
 # See "man dso" for info about shared objects
diff --git a/scripts/makefile.so9 b/scripts/makefile.so9
index 8ffb0c6..865c060 100644
--- a/scripts/makefile.so9
+++ b/scripts/makefile.so9
@@ -1,7 +1,7 @@
 # makefile for libpng on Solaris 9 (beta) with Forte cc
 # Updated by Chad Schrock for Solaris 9
 # Contributed by William L. Sebok, based on makefile.linux
-# Copyright (C) 2020 Cosmin Truta
+# Copyright (C) 2020-2022 Cosmin Truta
 # Copyright (C) 2002, 2006, 2008, 2010-2014 Glenn Randers-Pehrson
 # Copyright (C) 1998-2001 Greg Roelofs
 # Copyright (C) 1996-1997 Andreas Dilger
@@ -24,9 +24,9 @@
 # gcc 2.95 doesn't work.
 CC=cc
 AR_RC=ar rc
+RANLIB=echo
 MKDIR_P=mkdir -p
 LN_SF=ln -f -s
-RANLIB=echo
 CP=cp
 RM_F=/bin/rm -f
 
@@ -45,11 +45,7 @@
 ZLIBLIB=/usr/lib
 ZLIBINC=/usr/include
 
-#WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
-	-Wmissing-declarations -Wtraditional -Wcast-align \
-	-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
 CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
-#CFLAGS=-W -Wall -O3 $(WARNMORE) -g
 CFLAGS=-O3
 LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm
 
diff --git a/scripts/makefile.solaris b/scripts/makefile.solaris
index cbbf633..180bdd0 100644
--- a/scripts/makefile.solaris
+++ b/scripts/makefile.solaris
@@ -1,5 +1,5 @@
 # makefile for libpng on Solaris 2.x with gcc
-# Copyright (C) 2020 Cosmin Truta
+# Copyright (C) 2020-2022 Cosmin Truta
 # Copyright (C) 2004, 2006-2008, 2010-2014 Glenn Randers-Pehrson
 # Contributed by William L. Sebok, based on makefile.linux
 # Copyright (C) 1998 Greg Roelofs
@@ -20,11 +20,11 @@
 OLDSO=libpng.so
 
 # Utilities:
-AR_RC=ar rc
 CC=gcc
+AR_RC=ar rc
+RANLIB=echo
 MKDIR_P=mkdir -p
 LN_SF=ln -f -s
-RANLIB=echo
 CP=cp
 RM_F=/bin/rm -f
 
@@ -43,10 +43,10 @@
 
 WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
 	-Wmissing-declarations -Wtraditional -Wcast-align \
-	-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
+	-Wstrict-prototypes -Wmissing-prototypes # -Wconversion
 CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
-CFLAGS=-W -Wall -O # $(WARNMORE) -g
-LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm
+CFLAGS=-O -Wall -Wextra -Wundef # $(WARNMORE) -g
+LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm # -g
 
 INCPATH=$(prefix)/include
 LIBPATH=$(exec_prefix)/lib
diff --git a/scripts/makefile.std b/scripts/makefile.std
index eec63b0..a3bb944 100644
--- a/scripts/makefile.std
+++ b/scripts/makefile.std
@@ -1,5 +1,5 @@
 # makefile for libpng
-# Copyright (C) 2020 Cosmin Truta
+# Copyright (C) 2020-2022 Cosmin Truta
 # Copyright (C) 2002, 2006, 2014 Glenn Randers-Pehrson
 # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
 #
@@ -32,9 +32,9 @@
 CPP = $(CC) -E
 LD = $(CC)
 AR_RC = ar rc
+RANLIB = ranlib
 MKDIR_P = mkdir
 LN_SF = ln -sf
-RANLIB = ranlib
 CP = cp
 MV_F = mv -f
 RM_F = rm -f
@@ -44,7 +44,7 @@
 DFA_EXTRA = # extra files that can be used to control configuration
 CPPFLAGS = -I$(ZLIBINC) # -DPNG_DEBUG=5
 CFLAGS = -O # -g
-LDFLAGS = -L$(ZLIBLIB)
+LDFLAGS = -L$(ZLIBLIB) # -g
 LIBS = -lz -lm
 
 # Pre-built configuration
diff --git a/scripts/makefile.sunos b/scripts/makefile.sunos
index 392878e..13450ec 100644
--- a/scripts/makefile.sunos
+++ b/scripts/makefile.sunos
@@ -1,5 +1,5 @@
 # makefile for libpng
-# Copyright (C) 2020 Cosmin Truta
+# Copyright (C) 2020-2022 Cosmin Truta
 # Copyright (C) 2002, 2006, 2014 Glenn Randers-Pehrson
 # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
 #
@@ -28,21 +28,16 @@
 ZLIBLIB=../zlib
 ZLIBINC=../zlib
 
-
-WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow -Wconversion \
-	-Wmissing-declarations -Wtraditional -Wcast-align \
-	-Wstrict-prototypes -Wmissing-prototypes
-
 CC=gcc
 AR_RC=ar rc
+RANLIB=ranlib
 MKDIR_P=mkdir -p
 LN_SF=ln -f -s
-RANLIB=ranlib
 CP=cp
 RM_F=/bin/rm -f
 
 CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
-CFLAGS=-O # $(WARNMORE)
+CFLAGS=-O
 LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
 
 # Pre-built configuration
@@ -62,7 +57,7 @@
 	$(CP) $(PNGLIBCONF_H_PREBUILT) $@
 
 libpng.a: $(OBJS)
-	$(AR_RC) $@  $(OBJS)
+	$(AR_RC) $@ $(OBJS)
 	$(RANLIB) $@
 
 pngtest: pngtest.o libpng.a