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:
Cosmin Truta
2025-01-21 19:06:43 +02:00
parent 36a16fd761
commit 9cc729b523
25 changed files with 127 additions and 129 deletions

View File

@@ -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