mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
build: Update scripts/makefile.*
Apply the following updates: * Tidy up the compiler flag definitions. * Update the Darwin, Linux and MSYS makefiles to match the compiler flags used in scripts/makefile.clang and scripts/makefile.gcc. * Add the `pngtest-static` target in the Darwin makefile, following on the Linux makefile. * Rewrite some of the implicit make rules to match one another more consistently. * Make corrections in the copyright years to match git log.
This commit is contained in:
parent
36a16fd761
commit
9cc729b523
@ -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-2024 Cosmin Truta
|
||||
# Copyright (C) 2018-2025 Cosmin Truta
|
||||
# Copyright (C) 2002, 2006, 2010-2014 Glenn Randers-Pehrson
|
||||
# Copyright (C) 1998 Greg Roelofs
|
||||
# Copyright (C) 1996, 1997 Andreas Dilger
|
||||
@ -36,13 +36,10 @@ SUN_LD_FLAGS=-fast -xtarget=ultra
|
||||
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=$(SUN_CC_FLAGS) # $(WARNMORE) -g
|
||||
CFLAGS=$(SUN_CC_FLAGS) # -g
|
||||
ARFLAGS=rc
|
||||
LDFLAGS=$(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) libpng.a -lz -lm
|
||||
LDFLAGS=$(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) libpng.a -lz -lm # -g
|
||||
|
||||
OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
|
||||
pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
|
||||
@ -53,7 +50,7 @@ OBJSDLL = $(OBJS:.o=.pic.o)
|
||||
.SUFFIXES: .c .o .pic.o
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $*.c
|
||||
|
||||
.c.pic.o:
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -KPIC -o $@ $*.c
|
||||
|
@ -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-2024 Cosmin Truta
|
||||
# Copyright (C) 2018-2025 Cosmin Truta
|
||||
# Copyright (C) 2002, 2006, 2010-2014 Glenn Randers-Pehrson
|
||||
# Copyright (C) 1998 Greg Roelofs
|
||||
# Copyright (C) 1996, 1997 Andreas Dilger
|
||||
@ -36,13 +36,10 @@ SUN_LD_FLAGS=-fast -xtarget=ultra -xarch=v9
|
||||
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=$(SUN_CC_FLAGS) # $(WARNMORE) -g
|
||||
CFLAGS=$(SUN_CC_FLAGS) # -g
|
||||
ARFLAGS=rc
|
||||
LDFLAGS=-L. -R. $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm
|
||||
LDFLAGS=-L. -R. $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm # -g
|
||||
|
||||
OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
|
||||
pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
|
||||
@ -53,7 +50,7 @@ OBJSDLL = $(OBJS:.o=.pic.o)
|
||||
.SUFFIXES: .c .o .pic.o
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $*.c
|
||||
|
||||
.c.pic.o:
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -KPIC -o $@ $*.c
|
||||
|
@ -1,5 +1,5 @@
|
||||
# makefile for libpng using gcc (generic, static library)
|
||||
# Copyright (C) 2000, 2020-2024 Cosmin Truta
|
||||
# Copyright (C) 2000, 2020-2025 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.
|
||||
@ -22,9 +22,8 @@ RM_F = rm -f
|
||||
LIBNAME = libpng16
|
||||
PNGMAJ = 16
|
||||
|
||||
WARNMORE =
|
||||
CPPFLAGS = -I$(ZLIBINC) # -DPNG_DEBUG=5
|
||||
CFLAGS = -O2 -Wall -Wextra -Wundef # $(WARNMORE) -g
|
||||
CFLAGS = -O2 # -g
|
||||
ARFLAGS = rc
|
||||
LDFLAGS = -L. -L$(ZLIBLIB) -lpng16 -lz -lm # -g
|
||||
|
||||
@ -35,7 +34,7 @@ OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
|
||||
|
||||
# Targets
|
||||
.c.o:
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $*.c
|
||||
|
||||
all: $(LIBNAME).a pngtest
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# makefile for libpng
|
||||
# Copyright (C) 2022 Cosmin Truta
|
||||
# Copyright (C) 2022-2025 Cosmin Truta
|
||||
# Copyright (C) 2002, 2014 Glenn Randers-Pehrson
|
||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
||||
#
|
||||
@ -28,7 +28,7 @@ OBJS = $(LBR)(png.o) $(LBR)(pngerror.o) $(LBR)(pngget.o) $(LBR)(pngmem.o) \
|
||||
all: $(LBR) pngtest.ttp
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) $<
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c
|
||||
|
||||
$(LBR): $(OBJS)
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# makefile for libpng on BeOS x86 ELF with gcc
|
||||
# modified from makefile.linux by Sander Stoks
|
||||
# Copyright (C) 2020-2024 Cosmin Truta
|
||||
# Copyright (C) 2020-2025 Cosmin Truta
|
||||
# Copyright (C) 2002, 2006, 2008, 2010-2014 Glenn Randers-Pehrson
|
||||
# Copyright (C) 1999 Greg Roelofs
|
||||
# Copyright (C) 1996, 1997 Andreas Dilger
|
||||
@ -33,14 +33,10 @@ ALIGN=
|
||||
# For i386:
|
||||
# ALIGN=-malign-loops=2 -malign-functions=2
|
||||
|
||||
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
|
||||
-Wmissing-declarations -Wtraditional -Wcast-align \
|
||||
-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=-O1 -funroll-loops $(ALIGN) -Wall -Wextra -Wundef # $(WARNMORE) -g
|
||||
CFLAGS=-O1 -funroll-loops $(ALIGN) # -g
|
||||
ARFLAGS=rc
|
||||
# LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng -lz
|
||||
LDFLAGS=-L. -Wl,-soname=$(LIBSOMAJ) -L$(ZLIBLIB) -lz # -g
|
||||
@ -58,7 +54,7 @@ OBJSDLL = $(OBJS)
|
||||
.SUFFIXES: .c .o
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $*.c
|
||||
|
||||
all: libpng.a $(LIBSO) pngtest
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# makefile for libpng on Darwin / macOS
|
||||
# Copyright (C) 2020-2024 Cosmin Truta
|
||||
# Copyright (C) 2014, 2018-2025 Cosmin Truta
|
||||
# Copyright (C) 2002, 2004, 2006, 2008, 2010-2014 Glenn Randers-Pehrson
|
||||
# Copyright (C) 2001 Christoph Pfisterer
|
||||
# derived from makefile.linux:
|
||||
@ -10,10 +10,6 @@
|
||||
# For conditions of distribution and use, see the disclaimer
|
||||
# and license in png.h
|
||||
|
||||
# Where the zlib library and include files are located
|
||||
ZLIBLIB=/usr/lib
|
||||
ZLIBINC=/usr/include
|
||||
|
||||
# Library name:
|
||||
LIBNAME=libpng16
|
||||
PNGMAJ=16
|
||||
@ -30,13 +26,22 @@ LN_SF=ln -sf
|
||||
CP=cp
|
||||
RM_F=rm -f
|
||||
|
||||
NOHWOPT=-DPNG_ARM_NEON_OPT=0 -DPNG_MIPS_MSA_OPT=0 \
|
||||
-DPNG_POWERPC_VSX_OPT=0 -DPNG_INTEL_SSE_OPT=0
|
||||
DEFS=$(NOHWOPT)
|
||||
CPPFLAGS=-I$(ZLIBINC) $(DEFS)
|
||||
CFLAGS=-O3 -funroll-loops -Wall -Wextra -Wundef
|
||||
ARFLAGS=rc
|
||||
LDFLAGS=-L. -L$(ZLIBLIB) -lpng16 -lz
|
||||
# Compiler and linker flags
|
||||
NOHWOPT = -DPNG_ARM_NEON_OPT=0 -DPNG_MIPS_MSA_OPT=0 \
|
||||
-DPNG_POWERPC_VSX_OPT=0 -DPNG_INTEL_SSE_OPT=0
|
||||
STDC = -pedantic-errors
|
||||
WARN = -Wall -Wextra -Wundef
|
||||
WARNMORE = -Wcast-align -Wconversion -Wshadow -Wpointer-arith -Wwrite-strings \
|
||||
-Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes
|
||||
LOCAL_CPPFLAGS = $(NOHWOPT)
|
||||
CPPFLAGS = # -DPNG_DEBUG=5
|
||||
ALL_CPPFLAGS = $(LOCAL_CPPFLAGS) $(CPPFLAGS)
|
||||
LOCAL_CFLAGS = $(STDC) $(WARN) # $(WARNMORE)
|
||||
CFLAGS = -O3 -funroll-loops # -g
|
||||
ALL_CFLAGS = $(LOCAL_CFLAGS) $(CFLAGS)
|
||||
ARFLAGS = rc
|
||||
LDFLAGS = -L. -lpng16 -lz # -g
|
||||
LDFLAGS_A = libpng.a -lz -lm # -g
|
||||
|
||||
# Pre-built configuration
|
||||
# See scripts/pnglibconf.mak for more options
|
||||
@ -52,12 +57,12 @@ OBJSDLL = $(OBJS:.o=.pic.o)
|
||||
.SUFFIXES: .c .o .pic.o
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
|
||||
$(CC) -c $(ALL_CPPFLAGS) $(ALL_CFLAGS) -o $@ $*.c
|
||||
|
||||
.c.pic.o:
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -fno-common -o $@ $*.c
|
||||
$(CC) -c $(ALL_CPPFLAGS) $(ALL_CFLAGS) -fno-common -o $@ $*.c
|
||||
|
||||
all: libpng.a $(LIBSO) pngtest
|
||||
all: libpng.a $(LIBSO) pngtest pngtest-static
|
||||
|
||||
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
|
||||
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
|
||||
@ -71,15 +76,25 @@ $(LIBSO): $(LIBSOMAJ)
|
||||
|
||||
$(LIBSOMAJ): $(OBJSDLL)
|
||||
$(CC) -dynamiclib \
|
||||
-current_version 16 -compatibility_version 16 \
|
||||
-o $(LIBSOMAJ) \
|
||||
$(OBJSDLL) -L$(ZLIBLIB) -lz
|
||||
-current_version 16 -compatibility_version 16 \
|
||||
-o $(LIBSOMAJ) \
|
||||
$(OBJSDLL) -lz
|
||||
|
||||
pngtest: pngtest.o $(LIBSO)
|
||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
||||
|
||||
test: pngtest
|
||||
pngtest-static: pngtest.o libpng.a
|
||||
$(CC) -o pngtest-static $(CFLAGS) pngtest.o $(LDFLAGS_A)
|
||||
|
||||
test: pngtest pngtest-static
|
||||
@echo ""
|
||||
@echo " Running pngtest dynamically linked with $(LIBSO):"
|
||||
@echo ""
|
||||
./pngtest
|
||||
@echo ""
|
||||
@echo " Running pngtest statically linked with libpng.a:"
|
||||
@echo ""
|
||||
./pngtest-static
|
||||
|
||||
install:
|
||||
@echo "The $@ target is no longer supported by this makefile."
|
||||
@ -94,8 +109,9 @@ install-shared:
|
||||
@false
|
||||
|
||||
clean:
|
||||
$(RM_F) *.o libpng.a pngtest pngout.png
|
||||
$(RM_F) $(OBJS) $(OBJSDLL) libpng.a
|
||||
$(RM_F) $(LIBNAME).*dylib pnglibconf.h
|
||||
$(RM_F) pngtest*.o pngtest pngtest-static pngout.png
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# makefile for libpng on DEC Alpha Unix
|
||||
# Copyright (C) 2020-2024 Cosmin Truta
|
||||
# Copyright (C) 2020-2025 Cosmin Truta
|
||||
# Copyright (C) 2000-2002, 2006, 2010-2014 Glenn Randers-Pehrson
|
||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
||||
#
|
||||
@ -30,7 +30,7 @@ ZLIBLIB=../zlib
|
||||
ZLIBINC=../zlib
|
||||
|
||||
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
|
||||
CFLAGS=-std -w1 -O # -g
|
||||
CFLAGS=-std -w1 -O
|
||||
ARFLAGS=rc
|
||||
LDFLAGS=-L$(ZLIBLIB) -rpath $(ZLIBLIB) libpng.a -lz -lm
|
||||
|
||||
@ -43,7 +43,7 @@ OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
|
||||
pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $*.c
|
||||
|
||||
all: $(LIBSO) libpng.a pngtest
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# DJGPP (DOS gcc) makefile for libpng
|
||||
# Copyright (C) 2020-2024 Cosmin Truta
|
||||
# Copyright (C) 2020-2025 Cosmin Truta
|
||||
# Copyright (C) 2002, 2006, 2009-2014 Glenn Randers-Pehrson
|
||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
||||
#
|
||||
@ -11,7 +11,7 @@ CC=gcc
|
||||
AR=ar
|
||||
RANLIB=ranlib
|
||||
CPPFLAGS=-I../zlib -DPNG_NO_SNPRINTF
|
||||
CFLAGS=-O
|
||||
CFLAGS=-O2 -Wall -Wextra -Wundef
|
||||
ARFLAGS=rc
|
||||
LDFLAGS=-L. -L../zlib/ -lpng -lz -lm
|
||||
|
||||
@ -27,7 +27,7 @@ OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
|
||||
pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $*.c
|
||||
|
||||
all: libpng.a pngtest
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# makefile for libpng under FreeBSD
|
||||
# Copyright (C) 2020-2022 Cosmin Truta
|
||||
# Copyright (C) 2018-2025 Cosmin Truta
|
||||
# Copyright (C) 2014 Glenn Randers-Pehrson and Andrey A. Chernov
|
||||
# Copyright (C) 2002, 2007, 2009 Glenn Randers-Pehrson and Andrey A. Chernov
|
||||
#
|
||||
@ -35,7 +35,7 @@ SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \
|
||||
pngtrans.c pngwio.c pngwrite.c pngwtran.c pngwutil.c
|
||||
|
||||
.c.o:
|
||||
${CC} -c ${CPPFLAGS} ${CFLAGS} -o $@ $<
|
||||
${CC} -c ${CPPFLAGS} ${CFLAGS} -o $@ $*.c
|
||||
|
||||
pnglibconf.h: ${PNGLIBCONF_H_PREBUILT}
|
||||
cp ${PNGLIBCONF_H_PREBUILT} $@
|
||||
|
@ -1,5 +1,5 @@
|
||||
# makefile for libpng, HPUX (10.20 and 11.00) using the ANSI/C product.
|
||||
# Copyright (C) 2020-2024 Cosmin Truta
|
||||
# Copyright (C) 2018-2025 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
|
||||
@ -56,7 +56,7 @@ OBJSDLL = $(OBJS:.o=.pic.o)
|
||||
.SUFFIXES: .c .o .pic.o
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $*.c
|
||||
|
||||
.c.pic.o:
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) +z -o $@ $*.c
|
||||
|
@ -1,5 +1,5 @@
|
||||
# makefile for libpng on HP-UX using GCC with the HP ANSI/C linker.
|
||||
# Copyright (C) 2020-2024 Cosmin Truta
|
||||
# Copyright (C) 2018-2025 Cosmin Truta
|
||||
# Copyright (C) 2002, 2006-2008, 2010-2014 Glenn Randers-Pehrson
|
||||
# Copyright (C) 2001, Laurent faillie
|
||||
# Copyright (C) 1998, 1999 Greg Roelofs
|
||||
@ -37,12 +37,8 @@ ZLIBINC=/opt/zlib/include
|
||||
# LDSHARED=ld -b
|
||||
# SHAREDLIB=libz.sl
|
||||
|
||||
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
|
||||
-Wmissing-declarations -Wtraditional -Wcast-align \
|
||||
-Wstrict-prototypes -Wmissing-prototypes # -Wconversion
|
||||
|
||||
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
|
||||
CFLAGS=-O3 -funroll-loops -Wall -Wextra -Wundef # $(WARNMORE) -g
|
||||
CFLAGS=-O3 -funroll-loops # -g
|
||||
ARFLAGS=rc
|
||||
#LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng16 -lz -lm # -g
|
||||
LDFLAGS=-L. -L$(ZLIBLIB) -lpng16 -lz -lm # -g
|
||||
@ -56,7 +52,7 @@ OBJSDLL = $(OBJS:.o=.pic.o)
|
||||
.SUFFIXES: .c .o .pic.o
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $*.c
|
||||
|
||||
.c.pic.o:
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -fPIC -o $@ $*.c
|
||||
|
@ -1,5 +1,5 @@
|
||||
# makefile for libpng, HPUX (10.20 and 11.00) using the ANSI/C product.
|
||||
# Copyright (C) 2020-2024 Cosmin Truta
|
||||
# Copyright (C) 2018-2025 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
|
||||
@ -55,7 +55,7 @@ OBJSDLL = $(OBJS:.o=.pic.o)
|
||||
.SUFFIXES: .c .o .pic.o
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $*.c
|
||||
|
||||
.c.pic.o:
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) +z -o $@ $*.c
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Makefile for libpng (static)
|
||||
# IBM C version 3.x for Win32 and OS/2
|
||||
# Copyright (C) 2006, 2014 Glenn Randers-Pehrson
|
||||
# Copyright (C) 2000, 2020 Cosmin Truta
|
||||
# Copyright (C) 2000, 2020-2025 Cosmin Truta
|
||||
#
|
||||
# This code is released under the libpng license.
|
||||
# For conditions of distribution and use, see the disclaimer
|
||||
@ -46,7 +46,7 @@ LIBS = libpng$(A) $(ZLIBLIB)/zlib$(A)
|
||||
|
||||
# Targets
|
||||
.c$(O):
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) $<
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c
|
||||
|
||||
all: libpng$(A) pngtest$(E)
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# makefile for libpng.a and libpng16.so on Linux ELF with gcc
|
||||
# Copyright (C) 2020-2024 Cosmin Truta
|
||||
# Copyright (C) 2018-2025 Cosmin Truta
|
||||
# Copyright (C) 1998, 1999, 2002, 2006, 2008, 2010-2014 Greg Roelofs and
|
||||
# Glenn Randers-Pehrson
|
||||
# Copyright (C) 1996, 1997 Andreas Dilger
|
||||
@ -24,24 +24,22 @@ LN_SF=ln -sf
|
||||
CP=cp
|
||||
RM_F=rm -f
|
||||
|
||||
# Where the zlib library and include files are located.
|
||||
#ZLIBLIB=/usr/local/lib
|
||||
#ZLIBINC=/usr/local/include
|
||||
ZLIBLIB=../zlib
|
||||
ZLIBINC=../zlib
|
||||
|
||||
# Compiler and linker flags
|
||||
NOHWOPT=-DPNG_ARM_NEON_OPT=0 -DPNG_MIPS_MSA_OPT=0 \
|
||||
-DPNG_POWERPC_VSX_OPT=0 -DPNG_INTEL_SSE_OPT=0
|
||||
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
|
||||
-Wmissing-declarations -Wtraditional -Wcast-align \
|
||||
-Wstrict-prototypes -Wmissing-prototypes # -Wconversion
|
||||
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
|
||||
NOHWOPT = -DPNG_ARM_NEON_OPT=0 -DPNG_MIPS_MSA_OPT=0 \
|
||||
-DPNG_POWERPC_VSX_OPT=0 -DPNG_INTEL_SSE_OPT=0
|
||||
STDC = -pedantic-errors
|
||||
WARN = -Wall -Wextra -Wundef
|
||||
WARNMORE = -Wcast-align -Wconversion -Wshadow -Wpointer-arith -Wwrite-strings \
|
||||
-Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes
|
||||
LOCAL_CPPFLAGS = $(NOHWOPT)
|
||||
CPPFLAGS = # -DPNG_DEBUG=5
|
||||
ALL_CPPFLAGS = $(LOCAL_CPPFLAGS) $(CPPFLAGS)
|
||||
LOCAL_CFLAGS = $(STDC) $(WARN) # $(WARNMORE)
|
||||
CFLAGS = -O3 -funroll-loops # -g
|
||||
ALL_CFLAGS = $(LOCAL_CFLAGS) $(CFLAGS)
|
||||
ARFLAGS = rc
|
||||
LDFLAGS = -L. -Wl,-rpath,. -lpng16 -lz -lm # -g
|
||||
LDFLAGS_A = libpng.a -lz -lm # -g
|
||||
|
||||
# Pre-built configuration
|
||||
# See scripts/pnglibconf.mak for more options
|
||||
@ -57,10 +55,10 @@ OBJSDLL = $(OBJS:.o=.pic.o)
|
||||
.SUFFIXES: .c .o .pic.o
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
|
||||
$(CC) -c $(ALL_CPPFLAGS) $(ALL_CFLAGS) -o $@ $*.c
|
||||
|
||||
.c.pic.o:
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -fPIC -o $@ $*.c
|
||||
$(CC) -c $(ALL_CPPFLAGS) $(ALL_CFLAGS) -fPIC -o $@ $*.c
|
||||
|
||||
all: libpng.a $(LIBSO) pngtest pngtest-static
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# makefile for libpng
|
||||
# Copyright (C) 2020-2024 Cosmin Truta
|
||||
# Copyright (C) 2018-2025 Cosmin Truta
|
||||
# Copyright (C) 1998-2014 Glenn Randers-Pehrson
|
||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
||||
#
|
||||
@ -26,7 +26,7 @@ OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
|
||||
pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $*.c
|
||||
|
||||
all: libpng.a pngtest
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# makefile for libpng using MSYS/gcc (shared, static library)
|
||||
# Copyright (C) 2000, 2019-2024 Cosmin Truta
|
||||
# Copyright (C) 2000, 2019-2025 Cosmin Truta
|
||||
# Copyright (C) 2012 Glenn Randers-Pehrson and Christopher M. Wheeler
|
||||
#
|
||||
# Portions taken from makefile.linux and makefile.gcc:
|
||||
@ -21,23 +21,28 @@ PNGMAJ=16
|
||||
LIBSO=$(LIBNAME).dll
|
||||
LIBSOMAJ=$(LIBNAME).dll.$(PNGMAJ)
|
||||
|
||||
# Where the zlib library and include files are located.
|
||||
#ZLIBLIB=../zlib
|
||||
#ZLIBINC=../zlib
|
||||
ZLIBLIB=/usr/local/lib
|
||||
ZLIBINC=/usr/local/include
|
||||
|
||||
# Compiler, linker, lib and other tools
|
||||
CC = gcc
|
||||
LD = $(CC)
|
||||
AR = ar
|
||||
RANLIB = ranlib
|
||||
CP = cp
|
||||
RM_F = rm -rf
|
||||
RM_F = rm -f
|
||||
LN_SF = ln -sf
|
||||
|
||||
# Compiler and linker flags
|
||||
NOHWOPT = -DPNG_ARM_NEON_OPT=0 -DPNG_MIPS_MSA_OPT=0 \
|
||||
-DPNG_POWERPC_VSX_OPT=0 -DPNG_INTEL_SSE_OPT=0
|
||||
STDC = -pedantic-errors
|
||||
WARN = -Wall -Wextra -Wundef
|
||||
WARNMORE = -Wcast-align -Wconversion -Wshadow -Wpointer-arith -Wwrite-strings \
|
||||
-Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes
|
||||
LOCAL_CPPFLAGS = $(NOHWOPT)
|
||||
CPPFLAGS = # -DPNG_DEBUG=5
|
||||
CFLAGS = -O2 -Wall -Wextra -Wundef # -g
|
||||
ALL_CPPFLAGS = $(LOCAL_CPPFLAGS) $(CPPFLAGS)
|
||||
LOCAL_CFLAGS = $(STDC) $(WARN) # $(WARNMORE)
|
||||
CFLAGS = -O2 # -g
|
||||
ALL_CFLAGS = $(LOCAL_CFLAGS) $(CFLAGS)
|
||||
ARFLAGS = rc
|
||||
LDFLAGS = # -g
|
||||
LIBS = -lz -lm
|
||||
@ -61,7 +66,7 @@ pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
|
||||
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) $<
|
||||
$(CC) -c $(ALL_CPPFLAGS) $(ALL_CFLAGS) -o $@ $*.c
|
||||
|
||||
static: libpng.a pngtest$(EXEEXT)
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# makefile for libpng on NetBSD
|
||||
# Copyright (C) 2020-2022 Cosmin Truta
|
||||
# Copyright (C) 2018-2025 Cosmin Truta
|
||||
# Copyright (C) 2007-2009, 2014 Glenn Randers-Pehrson
|
||||
# Copyright (C) 2002 Patrick R.L. Welche
|
||||
#
|
||||
@ -32,7 +32,7 @@ PNGLIBCONF_H_PREBUILT= scripts/pnglibconf.h.prebuilt
|
||||
# .endif
|
||||
|
||||
.c.o:
|
||||
${CC} -c ${CPPFLAGS} ${CFLAGS} -o $@ $<
|
||||
${CC} -c ${CPPFLAGS} ${CFLAGS} -o $@ $*.c
|
||||
|
||||
pnglibconf.h: ${PNGLIBCONF_H_PREBUILT}
|
||||
cp ${PNGLIBCONF_H_PREBUILT} $@
|
||||
|
@ -1,5 +1,5 @@
|
||||
# makefile for libpng
|
||||
# Copyright (C) 2020-2022 Cosmin Truta
|
||||
# Copyright (C) 2018-2025 Cosmin Truta
|
||||
# Copyright (C) 2007-2009, 2014 Glenn Randers-Pehrson
|
||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
||||
#
|
||||
@ -26,7 +26,7 @@ CLEANFILES+= pngtest.o pngtest pnglibconf.h
|
||||
PNGLIBCONF_H_PREBUILT= scripts/pnglibconf.h.prebuilt
|
||||
|
||||
.c.o:
|
||||
${CC} -c ${CPPFLAGS} ${CFLAGS} -o $@ $<
|
||||
${CC} -c ${CPPFLAGS} ${CFLAGS} -o $@ $*.c
|
||||
|
||||
pnglibconf.h: ${PNGLIBCONF_H_PREBUILT}
|
||||
cp ${PNGLIBCONF_H_PREBUILT} $@
|
||||
|
@ -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-2024 Cosmin Truta
|
||||
# Copyright (C) 2018-2025 Cosmin Truta
|
||||
# Copyright (C) 2002, 2006, 2010-2014 Glenn Randers-Pehrson
|
||||
# Copyright (C) 1998 Greg Roelofs
|
||||
# Copyright (C) 1996, 1997 Andreas Dilger
|
||||
@ -50,7 +50,7 @@ OBJSDLL = $(OBJS:.o=.pic.o)
|
||||
.SUFFIXES: .c .o .pic.o
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $*.c
|
||||
|
||||
.c.pic.o:
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -KPIC -o $@ $*.c
|
||||
|
@ -1,5 +1,5 @@
|
||||
# makefile for libpng.a and libpng16.so, SGI IRIX with 'cc'
|
||||
# Copyright (C) 2020-2024 Cosmin Truta
|
||||
# Copyright (C) 2018-2025 Cosmin Truta
|
||||
# Copyright (C) 2001-2002, 2006, 2010-2014 Glenn Randers-Pehrson
|
||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
||||
#
|
||||
@ -35,9 +35,8 @@ ZLIBINC=../zlib
|
||||
# See "man abi". zlib must be built with the same ABI.
|
||||
ABI=
|
||||
|
||||
WARNMORE=
|
||||
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
|
||||
CFLAGS=$(ABI) -O $(WARNMORE) -fPIC -mabi=n32 # -g
|
||||
CFLAGS=$(ABI) -O -fPIC -mabi=n32 # -g
|
||||
ARFLAGS=rc
|
||||
LDFLAGS=$(ABI) -L. -L$(ZLIBLIB) -lpng -lz -lm # -g
|
||||
LDSHARED=cc $(ABI) -shared -soname $(LIBSOMAJ) \
|
||||
@ -53,7 +52,7 @@ OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
|
||||
pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $*.c
|
||||
|
||||
all: libpng.a pngtest shared
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# makefile for libpng.a and libpng16.so, SGI IRIX with 'cc'
|
||||
# Copyright (C) 2020-2024 Cosmin Truta
|
||||
# Copyright (C) 2018-2025 Cosmin Truta
|
||||
# Copyright (C) 2001-2002, 2006, 2007, 2010-2014 Glenn Randers-Pehrson
|
||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
||||
#
|
||||
@ -35,11 +35,10 @@ ZLIBINC=../zlib
|
||||
# See "man abi". zlib must be built with the same ABI.
|
||||
ABI=
|
||||
|
||||
WARNMORE=-fullwarn
|
||||
# Note: -KPIC is the default anyhow
|
||||
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
|
||||
#CFLAGS= $(ABI) -O $(WARNMORE) -KPIC # -g
|
||||
CFLAGS=$(ABI) -O $(WARNMORE) # -g
|
||||
#CFLAGS=$(ABI) -O -fullwarn -KPIC # -g
|
||||
CFLAGS=$(ABI) -O -fullwarn # -g
|
||||
ARFLAGS=rc
|
||||
LDFLAGS_A=$(ABI) -L. -L$(ZLIBLIB) -lpng16 -lz -lm # -g
|
||||
LDFLAGS=$(ABI) -L. -L$(ZLIBLIB) -lpng -lz -lm # -g
|
||||
@ -56,7 +55,7 @@ OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
|
||||
pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $*.c
|
||||
|
||||
all: libpng.a pngtest shared
|
||||
|
||||
|
@ -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-2024 Cosmin Truta
|
||||
# Copyright (C) 2018-2025 Cosmin Truta
|
||||
# Copyright (C) 2002, 2006, 2008, 2010-2014 Glenn Randers-Pehrson
|
||||
# Copyright (C) 1998-2001 Greg Roelofs
|
||||
# Copyright (C) 1996-1997 Andreas Dilger
|
||||
@ -19,7 +19,6 @@ LIBSO=$(LIBNAME).so
|
||||
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
|
||||
|
||||
# Utilities:
|
||||
# gcc 2.95 doesn't work.
|
||||
CC=cc
|
||||
AR=ar
|
||||
RANLIB=echo
|
||||
@ -56,7 +55,7 @@ OBJSDLL = $(OBJS:.o=.pic.o)
|
||||
.SUFFIXES: .c .o .pic.o
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $*.c
|
||||
|
||||
.c.pic.o:
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -KPIC -o $@ $*.c
|
||||
|
@ -1,5 +1,5 @@
|
||||
# makefile for libpng on Solaris 2.x with gcc
|
||||
# Copyright (C) 2020-2024 Cosmin Truta
|
||||
# Copyright (C) 2018-2025 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
|
||||
@ -34,11 +34,8 @@ RM_F=/bin/rm -f
|
||||
ZLIBLIB=/usr/local/lib
|
||||
ZLIBINC=/usr/local/include
|
||||
|
||||
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
|
||||
-Wmissing-declarations -Wtraditional -Wcast-align \
|
||||
-Wstrict-prototypes -Wmissing-prototypes # -Wconversion
|
||||
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
|
||||
CFLAGS=-O -Wall -Wextra -Wundef # $(WARNMORE) -g
|
||||
CFLAGS=-O # -g
|
||||
ARFLAGS=rc
|
||||
LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm # -g
|
||||
|
||||
@ -55,7 +52,7 @@ OBJSDLL = $(OBJS:.o=.pic.o)
|
||||
.SUFFIXES: .c .o .pic.o
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $*.c
|
||||
|
||||
.c.pic.o:
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -fPIC -o $@ $*.c
|
||||
|
@ -1,5 +1,5 @@
|
||||
# makefile for libpng
|
||||
# Copyright (C) 2020-2024 Cosmin Truta
|
||||
# Copyright (C) 2015, 2018-2025 Cosmin Truta
|
||||
# Copyright (C) 2002, 2006, 2014 Glenn Randers-Pehrson
|
||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
||||
#
|
||||
@ -23,7 +23,7 @@ RM_F = rm -f
|
||||
AWK = awk
|
||||
|
||||
NOHWOPT = -DPNG_ARM_NEON_OPT=0 -DPNG_MIPS_MSA_OPT=0 \
|
||||
-DPNG_POWERPC_VSX_OPT=0 -DPNG_INTEL_SSE_OPT=0
|
||||
-DPNG_POWERPC_VSX_OPT=0 -DPNG_INTEL_SSE_OPT=0
|
||||
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
|
||||
@ -41,7 +41,7 @@ OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
|
||||
pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $*.c
|
||||
|
||||
all: libpng.a pngtest
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# makefile for libpng
|
||||
# Copyright (C) 2020-2024 Cosmin Truta
|
||||
# Copyright (C) 2018-2025 Cosmin Truta
|
||||
# Copyright (C) 2002, 2006, 2014 Glenn Randers-Pehrson
|
||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
||||
#
|
||||
@ -33,7 +33,7 @@ OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
|
||||
pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $*.c
|
||||
|
||||
all: libpng.a pngtest
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user