From 1cdde11877fb84d337f33f48cd36c0984203621a Mon Sep 17 00:00:00 2001 From: Cosmin Truta Date: Sun, 11 Feb 2024 23:14:09 +0200 Subject: [PATCH] build: Update the makefiles for the benefit of cross-compilation Split AR_RC into AR and ARFLAGS. The variables AR and ARFLAGS are de-facto standards (like CC and CFLAGS, LD and LDFLAGS, etc.) that may be overridden when running make. Moreover, configuring CC, LD, AR, etc., to point to a cross-platform compiler, linker, librarian, etc., is a de-facto standard practice as well. Also remove the MKDIR_P variable definitions from all makefiles. They've been leftovers from the removal of the "install*" targets. --- scripts/makefile.32sunu | 8 ++++---- scripts/makefile.64sunu | 10 +++++----- scripts/makefile.aix | 8 ++++---- scripts/makefile.amiga | 2 -- scripts/makefile.beos | 8 ++++---- scripts/makefile.clang | 7 ++++--- scripts/makefile.darwin | 8 ++++---- scripts/makefile.dec | 8 ++++---- scripts/makefile.dj2 | 9 ++++++--- scripts/makefile.emcc | 7 ++++--- scripts/makefile.gcc | 7 ++++--- scripts/makefile.hp64 | 9 ++++----- scripts/makefile.hpgcc | 10 +++++----- scripts/makefile.hpux | 8 ++++---- scripts/makefile.linux | 8 ++++---- scripts/makefile.mips | 12 ++++++------ scripts/makefile.msys | 12 ++++++------ scripts/makefile.sco | 10 +++++----- scripts/makefile.sggcc | 8 ++++---- scripts/makefile.sgi | 8 ++++---- scripts/makefile.so9 | 8 ++++---- scripts/makefile.solaris | 8 ++++---- scripts/makefile.std | 8 ++++---- scripts/makefile.sunos | 8 ++++---- scripts/makefile.vcwin-arm64 | 2 +- scripts/makefile.vcwin32 | 2 +- scripts/smakefile.ppc | 5 ++--- 27 files changed, 105 insertions(+), 103 deletions(-) diff --git a/scripts/makefile.32sunu b/scripts/makefile.32sunu index ea4894e74..822e8a923 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-2022 Cosmin Truta +# Copyright (C) 2020-2024 Cosmin Truta # Copyright (C) 2002, 2006, 2010-2014 Glenn Randers-Pehrson # Copyright (C) 1998 Greg Roelofs # Copyright (C) 1996, 1997 Andreas Dilger @@ -19,9 +19,8 @@ LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ) # Utilities: CC=cc -AR_RC=ar rc +AR=ar RANLIB=echo -MKDIR_P=mkdir -p LN_SF=ln -f -s RM_F=/bin/rm -f @@ -42,6 +41,7 @@ WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \ -Wstrict-prototypes -Wmissing-prototypes # -Wconversion CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5 CFLAGS=$(SUN_CC_FLAGS) # $(WARNMORE) -g +ARFLAGS=rc LDFLAGS=$(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) libpng.a -lz -lm OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \ @@ -65,7 +65,7 @@ DELETE = $(RM_F) DFNFLAGS = $(DEFS) $(CPPFLAGS) libpng.a: $(OBJS) - $(AR_RC) $@ $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) $(RANLIB) $@ $(LIBSO): $(LIBSOMAJ) diff --git a/scripts/makefile.64sunu b/scripts/makefile.64sunu index 3f603d3f1..65414b6b5 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-2022 Cosmin Truta +# Copyright (C) 2020-2024 Cosmin Truta # Copyright (C) 2002, 2006, 2010-2014 Glenn Randers-Pehrson # Copyright (C) 1998 Greg Roelofs # Copyright (C) 1996, 1997 Andreas Dilger @@ -19,9 +19,8 @@ LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ) # Utilities: CC=cc -AR_RC=ar rc +AR=ar RANLIB=echo -MKDIR_P=mkdir -p LN_SF=ln -f -s RM_F=/bin/rm -f @@ -41,7 +40,8 @@ WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \ -Wmissing-declarations -Wtraditional -Wcast-align \ -Wstrict-prototypes -Wmissing-prototypes # -Wconversion CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5 -CFLAGS= $(SUN_CC_FLAGS) # $(WARNMORE) -g +CFLAGS=$(SUN_CC_FLAGS) # $(WARNMORE) -g +ARFLAGS=rc LDFLAGS=-L. -R. $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \ @@ -65,7 +65,7 @@ DELETE = $(RM_F) DFNFLAGS = $(DEFS) $(CPPFLAGS) libpng.a: $(OBJS) - $(AR_RC) $@ $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) $(RANLIB) $@ $(LIBSO): $(LIBSOMAJ) diff --git a/scripts/makefile.aix b/scripts/makefile.aix index f00734e90..5b24f54fc 100644 --- a/scripts/makefile.aix +++ b/scripts/makefile.aix @@ -1,5 +1,5 @@ # makefile for libpng using gcc (generic, static library) -# Copyright (C) 2000, 2022 Cosmin Truta +# Copyright (C) 2000, 2020-2024 Cosmin Truta # Copyright (C) 2002, 2006-2009, 2014 Glenn Randers-Pehrson # Copyright (C) 2000 Marc O. Gloor (AIX support added, from makefile.gcc) # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. @@ -15,9 +15,8 @@ ZLIBLIB = ../zlib # Compiler, linker, lib and other tools CC = gcc LD = $(CC) -AR_RC = ar rcs +AR = ar RANLIB = ranlib -MKDIR_P = mkdir -p RM_F = rm -f LIBNAME = libpng16 @@ -26,6 +25,7 @@ PNGMAJ = 16 WARNMORE = CPPFLAGS = -I$(ZLIBINC) # -DPNG_DEBUG=5 CFLAGS = -O2 -Wall -Wextra -Wundef # $(WARNMORE) -g +ARFLAGS = rc LDFLAGS = -L. -L$(ZLIBLIB) -lpng16 -lz -lm # -g # File lists @@ -44,7 +44,7 @@ REMOVE = $(RM_F) DFNFLAGS = $(DEFS) $(CPPFLAGS) $(LIBNAME).a: $(OBJS) - $(AR_RC) $@ $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) $(RANLIB) $@ test: pngtest diff --git a/scripts/makefile.amiga b/scripts/makefile.amiga index 2dae9af99..321c7112a 100644 --- a/scripts/makefile.amiga +++ b/scripts/makefile.amiga @@ -26,8 +26,6 @@ LN= slink RM= delete quiet # library (.lib) file creation command AR= oml -# make directory command -MKDIR= makedir # Pre-built configuration # See scripts/pnglibconf.mak for more options diff --git a/scripts/makefile.beos b/scripts/makefile.beos index e02bdc3f4..fcc7f9cac 100644 --- a/scripts/makefile.beos +++ b/scripts/makefile.beos @@ -1,6 +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) 2020-2024 Cosmin Truta # Copyright (C) 2002, 2006, 2008, 2010-2014 Glenn Randers-Pehrson # Copyright (C) 1999 Greg Roelofs # Copyright (C) 1996, 1997 Andreas Dilger @@ -19,9 +19,8 @@ LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ) # Utilities: CC=gcc -AR_RC=ar rc +AR=ar RANLIB=ranlib -MKDIR_P=mkdir -p LN_SF=ln -sf CP=cp RM_F=/bin/rm -f @@ -42,6 +41,7 @@ WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \ # still here in R4.5 CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5 CFLAGS=-O1 -funroll-loops $(ALIGN) -Wall -Wextra -Wundef # $(WARNMORE) -g +ARFLAGS=rc # LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng -lz LDFLAGS=-L. -Wl,-soname=$(LIBSOMAJ) -L$(ZLIBLIB) -lz # -g @@ -66,7 +66,7 @@ pnglibconf.h: $(PNGLIBCONF_H_PREBUILT) $(CP) $(PNGLIBCONF_H_PREBUILT) $@ libpng.a: $(OBJS) - $(AR_RC) $@ $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) $(RANLIB) $@ $(LIBSO): $(LIBSOMAJ) diff --git a/scripts/makefile.clang b/scripts/makefile.clang index 2e154236f..08aaccf85 100644 --- a/scripts/makefile.clang +++ b/scripts/makefile.clang @@ -1,5 +1,5 @@ # makefile for libpng using clang (generic, static library) -# Copyright (C) 2000, 2014, 2019-2022 Cosmin Truta +# Copyright (C) 2000, 2014, 2019-2024 Cosmin Truta # Copyright (C) 2008, 2014 Glenn Randers-Pehrson # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. # @@ -14,7 +14,7 @@ ZLIBLIB = ../zlib # Compiler, linker, lib and other tools CC = clang LD = $(CC) -AR_RC = ar rcs +AR = ar RANLIB = ranlib CP = cp RM_F = rm -f @@ -28,6 +28,7 @@ WARNMORE = -Wwrite-strings -Wpointer-arith -Wshadow \ DEFS = $(NOHWOPT) CPPFLAGS = -I$(ZLIBINC) $(DEFS) # -DPNG_DEBUG=5 CFLAGS = -O2 -Wall -Wextra -Wundef # $(WARNMORE) -g +ARFLAGS = rc LDFLAGS = -L$(ZLIBLIB) # -g LIBS = -lz -lm @@ -60,7 +61,7 @@ shared: @false libpng.a: $(OBJS) - $(AR_RC) $@ $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) $(RANLIB) $@ test: pngtest$(EXEEXT) diff --git a/scripts/makefile.darwin b/scripts/makefile.darwin index 0c50b57e6..e68797e5e 100644 --- a/scripts/makefile.darwin +++ b/scripts/makefile.darwin @@ -1,5 +1,5 @@ # makefile for libpng on Darwin / macOS -# Copyright (C) 2020-2022 Cosmin Truta +# Copyright (C) 2020-2024 Cosmin Truta # Copyright (C) 2002, 2004, 2006, 2008, 2010-2014 Glenn Randers-Pehrson # Copyright (C) 2001 Christoph Pfisterer # derived from makefile.linux: @@ -24,9 +24,8 @@ LIBSOMAJ=$(LIBNAME).$(PNGMAJ).dylib # Utilities: CC=cc -AR_RC=ar rc +AR=ar RANLIB=ranlib -MKDIR_P=mkdir -p LN_SF=ln -sf CP=cp RM_F=rm -f @@ -36,6 +35,7 @@ NOHWOPT=-DPNG_ARM_NEON_OPT=0 -DPNG_MIPS_MSA_OPT=0 \ DEFS=$(NOHWOPT) CPPFLAGS=-I$(ZLIBINC) $(DEFS) CFLAGS=-O3 -funroll-loops -Wall -Wextra -Wundef +ARFLAGS=rc LDFLAGS=-L. -L$(ZLIBLIB) -lpng16 -lz # Pre-built configuration @@ -63,7 +63,7 @@ pnglibconf.h: $(PNGLIBCONF_H_PREBUILT) $(CP) $(PNGLIBCONF_H_PREBUILT) $@ libpng.a: $(OBJS) - $(AR_RC) $@ $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) $(RANLIB) $@ $(LIBSO): $(LIBSOMAJ) diff --git a/scripts/makefile.dec b/scripts/makefile.dec index b788b5aa3..2cca020df 100644 --- a/scripts/makefile.dec +++ b/scripts/makefile.dec @@ -1,5 +1,5 @@ # makefile for libpng on DEC Alpha Unix -# Copyright (C) 2020-2022 Cosmin Truta +# Copyright (C) 2020-2024 Cosmin Truta # Copyright (C) 2000-2002, 2006, 2010-2014 Glenn Randers-Pehrson # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. # @@ -17,9 +17,8 @@ LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ) # Utilities: CC=cc -AR_RC=ar rc +AR=ar RANLIB=ranlib -MKDIR_P=mkdir LN_SF=ln -f -s CP=cp RM_F=/bin/rm -f @@ -32,6 +31,7 @@ ZLIBINC=../zlib CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5 CFLAGS=-std -w1 -O # -g +ARFLAGS=rc LDFLAGS=-L$(ZLIBLIB) -rpath $(ZLIBLIB) libpng.a -lz -lm # Pre-built configuration @@ -51,7 +51,7 @@ pnglibconf.h: $(PNGLIBCONF_H_PREBUILT) $(CP) $(PNGLIBCONF_H_PREBUILT) $@ libpng.a: $(OBJS) - $(AR_RC) $@ $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) $(RANLIB) $@ $(LIBSO): $(LIBSOMAJ) diff --git a/scripts/makefile.dj2 b/scripts/makefile.dj2 index ff0d33286..376715097 100644 --- a/scripts/makefile.dj2 +++ b/scripts/makefile.dj2 @@ -1,5 +1,5 @@ # DJGPP (DOS gcc) makefile for libpng -# Copyright (C) 2020-2022 Cosmin Truta +# Copyright (C) 2020-2024 Cosmin Truta # Copyright (C) 2002, 2006, 2009-2014 Glenn Randers-Pehrson # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. # @@ -8,8 +8,11 @@ # and license in png.h CC=gcc +AR=ar +RANLIB=ranlib CPPFLAGS=-I../zlib -DPNG_NO_SNPRINTF CFLAGS=-O +ARFLAGS=rc LDFLAGS=-L. -L../zlib/ -lpng -lz -lm CP=cp @@ -32,8 +35,8 @@ pnglibconf.h: $(PNGLIBCONF_H_PREBUILT) $(CP) $(PNGLIBCONF_H_PREBUILT) $@ libpng.a: $(OBJS) - ar rc $@ $(OBJS) - ranlib $@ + $(AR) $(ARFLAGS) $@ $(OBJS) + $(RANLIB) $@ pngtest: pngtest.o libpng.a $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) diff --git a/scripts/makefile.emcc b/scripts/makefile.emcc index 5d27621c0..1ab01b8db 100644 --- a/scripts/makefile.emcc +++ b/scripts/makefile.emcc @@ -1,5 +1,5 @@ # makefile for libpng using emscripten -# Copyright (C) 2000, 2014, 2019-2022 Cosmin Truta +# Copyright (C) 2000, 2014, 2019-2024 Cosmin Truta # Copyright (C) 2021 Kirk Roerig # Copyright (C) 2008, 2014 Glenn Randers-Pehrson # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. @@ -15,13 +15,14 @@ ZLIBLIB = ../zlib # Compiler, linker, lib and other tools CC = emcc LD = $(CC) -AR_RC = emar rcs +AR = emar RANLIB = emranlib CP = cp RM_F = rm -f CPPFLAGS = -I$(ZLIBINC) # -DPNG_DEBUG=5 CFLAGS = -O2 -Wall -Wextra -Wundef +ARFLAGS = rc LDFLAGS = -L$(ZLIBLIB) PNGTEST_LDFLAGS = --preload-file=pngtest.png LIBS = -lz -lm @@ -51,7 +52,7 @@ shared: @false libpng.a: $(OBJS) - $(AR_RC) $@ $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) $(RANLIB) $@ test: pngtest diff --git a/scripts/makefile.gcc b/scripts/makefile.gcc index b215a70fb..fc0a1a090 100644 --- a/scripts/makefile.gcc +++ b/scripts/makefile.gcc @@ -1,5 +1,5 @@ # makefile for libpng using gcc (generic, static library) -# Copyright (C) 2000, 2014, 2019-2022 Cosmin Truta +# Copyright (C) 2000, 2014, 2019-2024 Cosmin Truta # Copyright (C) 2008, 2014 Glenn Randers-Pehrson # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. # @@ -14,7 +14,7 @@ ZLIBLIB = ../zlib # Compiler, linker, lib and other tools CC = gcc LD = $(CC) -AR_RC = ar rcs +AR = ar RANLIB = ranlib CP = cp RM_F = rm -f @@ -28,6 +28,7 @@ WARNMORE = -Wwrite-strings -Wpointer-arith -Wshadow \ DEFS = $(NOHWOPT) CPPFLAGS = -I$(ZLIBINC) $(DEFS) # -DPNG_DEBUG=5 CFLAGS = -O2 -Wall -Wextra -Wundef # $(WARNMORE) -g +ARFLAGS = rc LDFLAGS = -L$(ZLIBLIB) # -g LIBS = -lz -lm @@ -60,7 +61,7 @@ shared: @false libpng.a: $(OBJS) - $(AR_RC) $@ $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) $(RANLIB) $@ test: pngtest$(EXEEXT) diff --git a/scripts/makefile.hp64 b/scripts/makefile.hp64 index e9c0a6938..c974d2f33 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-2022 Cosmin Truta +# Copyright (C) 2020-2024 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 @@ -29,9 +29,8 @@ LIBSOMAJ=$(LIBNAME).sl.$(PNGMAJ) # Utilities: CC=cc -AR_RC=ar rc +AR=ar RANLIB=ranlib -MKDIR_P=mkdir -p LN_SF=ln -sf CP=cp RM_F=/bin/rm -f @@ -41,7 +40,7 @@ CPPFLAGS=-I$(ZLIBINC) \ CFLAGS=-O -Ae -Wl,+vnocompatwarnings +DD64 +Z # Caution: be sure you have built zlib with the same CFLAGS. CCFLAGS=-O -Ae -Wl,+vnocompatwarnings +DD64 +Z - +ARFLAGS=rc LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm # Pre-built configuration @@ -68,7 +67,7 @@ pnglibconf.h: $(PNGLIBCONF_H_PREBUILT) $(CP) $(PNGLIBCONF_H_PREBUILT) $@ libpng.a: $(OBJS) - $(AR_RC) $@ $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) $(RANLIB) $@ $(LIBSO): $(LIBSOMAJ) diff --git a/scripts/makefile.hpgcc b/scripts/makefile.hpgcc index 3686bd0ae..a24fb9339 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-2022 Cosmin Truta +# Copyright (C) 2020-2024 Cosmin Truta # Copyright (C) 2002, 2006-2008, 2010-2014 Glenn Randers-Pehrson # Copyright (C) 2001, Laurent faillie # Copyright (C) 1998, 1999 Greg Roelofs @@ -19,10 +19,9 @@ LIBSOMAJ=$(LIBNAME).sl.$(PNGMAJ) # Utilities: CC=gcc -LD=ld -AR_RC=ar rc +AR=ar RANLIB=ranlib -MKDIR_P=mkdir -p +LD=ld LN_SF=ln -sf CP=cp RM_F=/bin/rm -f @@ -44,6 +43,7 @@ WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \ CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5 CFLAGS=-O3 -funroll-loops -Wall -Wextra -Wundef # $(WARNMORE) -g +ARFLAGS=rc #LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng16 -lz -lm # -g LDFLAGS=-L. -L$(ZLIBLIB) -lpng16 -lz -lm # -g @@ -64,7 +64,7 @@ OBJSDLL = $(OBJS:.o=.pic.o) all: libpng.a $(LIBSO) pngtest libpng.a: $(OBJS) - $(AR_RC) $@ $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) $(RANLIB) $@ $(LIBSO): $(LIBSOMAJ) diff --git a/scripts/makefile.hpux b/scripts/makefile.hpux index 59041f02a..c3950ae3f 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-2022 Cosmin Truta +# Copyright (C) 2020-2024 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 @@ -30,9 +30,8 @@ LIBSOMAJ=$(LIBNAME).sl.$(PNGMAJ) # Utilities: CC=cc -AR_RC=ar rc +AR=ar RANLIB=ranlib -MKDIR_P=mkdir -p LN_SF=ln -sf RM_F=/bin/rm -f @@ -40,6 +39,7 @@ CPPFLAGS=-I$(ZLIBINC) CFLAGS=-O -Ae +DA1.1 +DS2.0 # Caution: be sure you have built zlib with the same CFLAGS. CCFLAGS=-O -Ae +DA1.1 +DS2.0 +ARFLAGS=rc LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm # Pre-built configuration @@ -66,7 +66,7 @@ pnglibconf.h: $(PNGLIBCONF_H_PREBUILT) $(CP) $(PNGLIBCONF_H_PREBUILT) $@ libpng.a: $(OBJS) - $(AR_RC) $@ $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) $(RANLIB) $@ $(LIBSO): $(LIBSOMAJ) diff --git a/scripts/makefile.linux b/scripts/makefile.linux index 3fece3d6c..c49cdde9d 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-2022 Cosmin Truta +# Copyright (C) 2020-2024 Cosmin Truta # Copyright (C) 1998, 1999, 2002, 2006, 2008, 2010-2014 Greg Roelofs and # Glenn Randers-Pehrson # Copyright (C) 1996, 1997 Andreas Dilger @@ -18,9 +18,8 @@ LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ) # Utilities: CC=gcc -AR_RC=ar rc +AR=ar RANLIB=ranlib -MKDIR_P=mkdir -p LN_SF=ln -sf CP=cp RM_F=rm -f @@ -40,6 +39,7 @@ WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \ DEFS=$(NOHWOPT) CPPFLAGS=-I$(ZLIBINC) $(DEFS) # -DPNG_DEBUG=5 CFLAGS=-O3 -funroll-loops -Wall -Wextra -Wundef # $(WARNMORE) -g +ARFLAGS=rc 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 @@ -68,7 +68,7 @@ pnglibconf.h: $(PNGLIBCONF_H_PREBUILT) $(CP) $(PNGLIBCONF_H_PREBUILT) $@ libpng.a: $(OBJS) - $(AR_RC) $@ $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) $(RANLIB) $@ $(LIBSO): $(LIBSOMAJ) diff --git a/scripts/makefile.mips b/scripts/makefile.mips index ca50f6077..45de36d46 100644 --- a/scripts/makefile.mips +++ b/scripts/makefile.mips @@ -1,5 +1,5 @@ # makefile for libpng -# Copyright (C) 2020-2022 Cosmin Truta +# Copyright (C) 2020-2024 Cosmin Truta # Copyright (C) 1998-2014 Glenn Randers-Pehrson # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. # @@ -8,15 +8,15 @@ # and license in png.h CC=cc +AR=ar +#RANLIB=ranlib +RANLIB=echo CPPFLAGS=-I../zlib -DSYSV -Dmips CFLAGS=-O -systype sysv -w #CFLAGS=-O +ARFLAGS=rc LDFLAGS=-L. -L../zlib/ -lpng -lz -lm -AR_RC=ar rc -#RANLIB=ranlib -RANLIB=echo - # Pre-built configuration # See scripts/pnglibconf.mak for more options PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt @@ -34,7 +34,7 @@ pnglibconf.h: $(PNGLIBCONF_H_PREBUILT) cp $(PNGLIBCONF_H_PREBUILT) $@ libpng.a: $(OBJS) - $(AR_RC) $@ $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) $(RANLIB) $@ pngtest: pngtest.o libpng.a diff --git a/scripts/makefile.msys b/scripts/makefile.msys index e2878233c..8ebcaab99 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-2022 Cosmin Truta +# Copyright (C) 2000, 2019-2024 Cosmin Truta # Copyright (C) 2012 Glenn Randers-Pehrson and Christopher M. Wheeler # # Portions taken from makefile.linux and makefile.gcc: @@ -30,20 +30,20 @@ ZLIBINC=/usr/local/include # Compiler, linker, lib and other tools CC = gcc LD = $(CC) -AR_RC = ar rcs +AR = ar RANLIB = ranlib CP = cp RM_F = rm -rf -MKDIR_P=mkdir -p -LN_SF=ln -sf +LN_SF = ln -sf CPPFLAGS = # -DPNG_DEBUG=5 CFLAGS = -O2 -Wall -Wextra -Wundef # -g +ARFLAGS = rc LDFLAGS = # -g LIBS = -lz -lm # File extensions -EXEEXT=.exe +EXEEXT = .exe # Pre-built configuration # See scripts/pnglibconf.mak for more options @@ -75,7 +75,7 @@ $(LIBSOMAJ): $(CC) -shared -Wl,-soname,$(LIBSOMAJ) -o $(LIBSOMAJ) libpng.a: $(OBJS) - $(AR_RC) $@ $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) $(RANLIB) $@ install: diff --git a/scripts/makefile.sco b/scripts/makefile.sco index 002cd3f9b..8a8e50ffc 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-2022 Cosmin Truta +# Copyright (C) 2020-2024 Cosmin Truta # Copyright (C) 2002, 2006, 2010-2014 Glenn Randers-Pehrson # Copyright (C) 1998 Greg Roelofs # Copyright (C) 1996, 1997 Andreas Dilger @@ -20,9 +20,8 @@ LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ) # Utilities: CC=cc -AR_RC=ar rc +AR=ar RANLIB=echo -MKDIR_P=mkdir LN_SF=ln -f -s CP=cp RM_F=/bin/rm -f @@ -34,7 +33,8 @@ ZLIBLIB=../zlib ZLIBINC=../zlib CPPFLAGS=-I$(ZLIBINC) -CFLAGS= -dy -belf -O3 +CFLAGS=-dy -belf -O3 +ARFLAGS=rc LDFLAGS=-L. -L$(ZLIBLIB) -lpng16 -lz -lm # Pre-built configuration @@ -61,7 +61,7 @@ pnglibconf.h: $(PNGLIBCONF_H_PREBUILT) $(CP) $(PNGLIBCONF_H_PREBUILT) $@ libpng.a: $(OBJS) - $(AR_RC) $@ $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) $(RANLIB) $@ $(LIBSO): $(LIBSOMAJ) diff --git a/scripts/makefile.sggcc b/scripts/makefile.sggcc index e017916ef..f694f6eed 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-2022 Cosmin Truta +# Copyright (C) 2020-2024 Cosmin Truta # Copyright (C) 2001-2002, 2006, 2010-2014 Glenn Randers-Pehrson # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. # @@ -17,9 +17,8 @@ LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ) # Utilities: CC=gcc -AR_RC=ar rc +AR=ar RANLIB=echo -MKDIR_P=mkdir -p LN_SF=ln -sf CP=cp RM_F=/bin/rm -f @@ -39,6 +38,7 @@ ABI= WARNMORE= CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5 CFLAGS=$(ABI) -O $(WARNMORE) -fPIC -mabi=n32 # -g +ARFLAGS=rc LDFLAGS=$(ABI) -L. -L$(ZLIBLIB) -lpng -lz -lm # -g LDSHARED=cc $(ABI) -shared -soname $(LIBSOMAJ) \ -set_version sgi$(PNGMAJ).0 @@ -61,7 +61,7 @@ pnglibconf.h: $(PNGLIBCONF_H_PREBUILT) $(CP) $(PNGLIBCONF_H_PREBUILT) $@ libpng.a: $(OBJS) - $(AR_RC) $@ $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) $(RANLIB) $@ shared: $(LIBSOMAJ) diff --git a/scripts/makefile.sgi b/scripts/makefile.sgi index c7f8720e5..a60650c25 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-2022 Cosmin Truta +# Copyright (C) 2020-2024 Cosmin Truta # Copyright (C) 2001-2002, 2006, 2007, 2010-2014 Glenn Randers-Pehrson # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. # @@ -17,9 +17,8 @@ LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ) # Utilities: CC=cc -AR_RC=ar rc +AR=ar RANLIB=echo -MKDIR_P=mkdir -p LN_SF=ln -sf CP=cp RM_F=/bin/rm -f @@ -41,6 +40,7 @@ WARNMORE=-fullwarn CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5 #CFLAGS= $(ABI) -O $(WARNMORE) -KPIC # -g CFLAGS=$(ABI) -O $(WARNMORE) # -g +ARFLAGS=rc 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) \ @@ -64,7 +64,7 @@ pnglibconf.h: $(PNGLIBCONF_H_PREBUILT) $(CP) $(PNGLIBCONF_H_PREBUILT) $@ libpng.a: $(OBJS) - $(AR_RC) $@ $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) $(RANLIB) $@ $(LIBSO): $(LIBSOMAJ) diff --git a/scripts/makefile.so9 b/scripts/makefile.so9 index 2fd8e7017..5af3ad995 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-2022 Cosmin Truta +# Copyright (C) 2020-2024 Cosmin Truta # Copyright (C) 2002, 2006, 2008, 2010-2014 Glenn Randers-Pehrson # Copyright (C) 1998-2001 Greg Roelofs # Copyright (C) 1996-1997 Andreas Dilger @@ -21,9 +21,8 @@ LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ) # Utilities: # gcc 2.95 doesn't work. CC=cc -AR_RC=ar rc +AR=ar RANLIB=echo -MKDIR_P=mkdir -p LN_SF=ln -f -s CP=cp RM_F=/bin/rm -f @@ -41,6 +40,7 @@ ZLIBINC=/usr/include CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5 CFLAGS=-O3 +ARFLAGS=rc LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm # Pre-built configuration @@ -67,7 +67,7 @@ pnglibconf.h: $(PNGLIBCONF_H_PREBUILT) $(CP) $(PNGLIBCONF_H_PREBUILT) $@ libpng.a: $(OBJS) - $(AR_RC) $@ $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) $(RANLIB) $@ $(LIBSO): $(LIBSOMAJ) diff --git a/scripts/makefile.solaris b/scripts/makefile.solaris index 4aa672deb..c4d770978 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-2022 Cosmin Truta +# Copyright (C) 2020-2024 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 @@ -19,9 +19,8 @@ LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ) # Utilities: CC=gcc -AR_RC=ar rc +AR=ar RANLIB=echo -MKDIR_P=mkdir -p LN_SF=ln -f -s CP=cp RM_F=/bin/rm -f @@ -40,6 +39,7 @@ WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \ -Wstrict-prototypes -Wmissing-prototypes # -Wconversion CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5 CFLAGS=-O -Wall -Wextra -Wundef # $(WARNMORE) -g +ARFLAGS=rc LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm # -g # Pre-built configuration @@ -66,7 +66,7 @@ pnglibconf.h: $(PNGLIBCONF_H_PREBUILT) $(CP) $(PNGLIBCONF_H_PREBUILT) $@ libpng.a: $(OBJS) - $(AR_RC) $@ $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) $(RANLIB) $@ $(LIBSO): $(LIBSOMAJ) diff --git a/scripts/makefile.std b/scripts/makefile.std index 6ce0a498a..6d69bf586 100644 --- a/scripts/makefile.std +++ b/scripts/makefile.std @@ -1,5 +1,5 @@ # makefile for libpng -# Copyright (C) 2020-2022 Cosmin Truta +# Copyright (C) 2020-2024 Cosmin Truta # Copyright (C) 2002, 2006, 2014 Glenn Randers-Pehrson # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. # @@ -16,9 +16,8 @@ ZLIBINC=../zlib CC = cc CPP = $(CC) -E LD = $(CC) -AR_RC = ar rc +AR = ar RANLIB = ranlib -MKDIR_P = mkdir MV_F = mv -f RM_F = rm -f AWK = awk @@ -29,6 +28,7 @@ DFNFLAGS = # DFNFLAGS contains -D options to use in the libpng build DFA_EXTRA = # extra files that can be used to control configuration CPPFLAGS = -I$(ZLIBINC) $(NOHWOPT) # -DPNG_DEBUG=5 CFLAGS = -O # -g +ARFLAGS = rc LDFLAGS = -L$(ZLIBLIB) # -g LIBS = -lz -lm @@ -66,7 +66,7 @@ pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk pngconf.h pngusr.dfa $(MV_F) pnglibconf.tmp $@ libpng.a: $(OBJS) - $(AR_RC) $@ $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) $(RANLIB) $@ pngtest: pngtest.o libpng.a diff --git a/scripts/makefile.sunos b/scripts/makefile.sunos index 675e8760f..e8c046bb0 100644 --- a/scripts/makefile.sunos +++ b/scripts/makefile.sunos @@ -1,5 +1,5 @@ # makefile for libpng -# Copyright (C) 2020-2022 Cosmin Truta +# Copyright (C) 2020-2024 Cosmin Truta # Copyright (C) 2002, 2006, 2014 Glenn Randers-Pehrson # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. # @@ -14,14 +14,14 @@ ZLIBLIB=../zlib ZLIBINC=../zlib CC=gcc -AR_RC=ar rc +AR=ar RANLIB=ranlib -MKDIR_P=mkdir -p CP=cp RM_F=/bin/rm -f CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5 CFLAGS=-O +ARFLAGS=rc LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm # Pre-built configuration @@ -41,7 +41,7 @@ pnglibconf.h: $(PNGLIBCONF_H_PREBUILT) $(CP) $(PNGLIBCONF_H_PREBUILT) $@ libpng.a: $(OBJS) - $(AR_RC) $@ $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) $(RANLIB) $@ pngtest: pngtest.o libpng.a diff --git a/scripts/makefile.vcwin-arm64 b/scripts/makefile.vcwin-arm64 index 9795ba6b0..1e98d1667 100644 --- a/scripts/makefile.vcwin-arm64 +++ b/scripts/makefile.vcwin-arm64 @@ -31,7 +31,7 @@ RM = del PNGLIBCONF_H_PREBUILT = scripts\pnglibconf.h.prebuilt # File extensions -O=.obj +O = .obj # File lists OBJS1 = png$(O) pngerror$(O) pngget$(O) pngmem$(O) pngpread$(O) diff --git a/scripts/makefile.vcwin32 b/scripts/makefile.vcwin32 index ebc053da2..762032216 100644 --- a/scripts/makefile.vcwin32 +++ b/scripts/makefile.vcwin32 @@ -30,7 +30,7 @@ RM = del PNGLIBCONF_H_PREBUILT = scripts\pnglibconf.h.prebuilt # File extensions -O=.obj +O = .obj # File lists OBJS1 = png$(O) pngerror$(O) pngget$(O) pngmem$(O) pngpread$(O) diff --git a/scripts/smakefile.ppc b/scripts/smakefile.ppc index 2fa5b6510..9212d2f06 100644 --- a/scripts/smakefile.ppc +++ b/scripts/smakefile.ppc @@ -11,13 +11,12 @@ CFLAGS = NOSTKCHK NOSINT OPTIMIZE OPTGO OPTPEEP OPTINLOCAL OPTINL IDIR /zlib \ OPTLOOP OPTRDEP=8 OPTDEP=8 OPTCOMP=8 LIBNAME = libpng.a AR = ppc-amigaos-ar -AR_FLAGS = cr +ARFLAGS = cr RANLIB = ppc-amigaos-ranlib LDFLAGS = -r -o LDLIBS = ../zlib/libzip.a LIB:scppc.a LN = ppc-amigaos-ld RM = delete quiet -MKDIR = makedir OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \ pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \ @@ -26,7 +25,7 @@ OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \ all: $(LIBNAME) pngtest $(LIBNAME): $(OBJS) - $(AR) $(AR_FLAGS) $@ $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) $(RANLIB) $@ pngtest: pngtest.o $(LIBNAME)