mirror of
https://github.com/glennrp/libpng.git
synced 2026-10-24 08:39:18 +03:00
Changes include manually merged code from Manfred SCHLAEGL. Co-authored-by: Manfred SCHLAEGL <manfred.schlaegl@gmx.at> Signed-off-by: Cosmin Truta <ctruta@gmail.com>
94 lines
3.5 KiB
Plaintext
94 lines
3.5 KiB
Plaintext
# makefile for libpng using gcc (static library)
|
|
# Copyright (C) 2000, 2014, 2019-2025 Cosmin Truta
|
|
# Copyright (C) 2008, 2014 Glenn Randers-Pehrson
|
|
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
|
#
|
|
# This code is released under the libpng license.
|
|
# For conditions of distribution and use, see the disclaimer
|
|
# and license in png.h
|
|
|
|
# Location of the zlib library and include files
|
|
ZLIBINC = ../zlib
|
|
ZLIBLIB = ../zlib
|
|
|
|
# Compiler, linker, lib and other tools
|
|
CC = gcc
|
|
LD = $(CC)
|
|
AR = ar
|
|
RANLIB = ranlib
|
|
CP = cp
|
|
RM_F = rm -f
|
|
|
|
# Compiler and linker flags
|
|
STDC = -pedantic-errors # -std=c99
|
|
WARN = -Wall -Wextra -Wundef
|
|
WARNMORE = -Wcast-align -Wconversion -Wshadow -Wpointer-arith -Wwrite-strings \
|
|
-Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes
|
|
LOCAL_CPPFLAGS =
|
|
CPPFLAGS = -I$(ZLIBINC) # -DPNG_DEBUG=5
|
|
ALL_CPPFLAGS = $(LOCAL_CPPFLAGS) $(CPPFLAGS)
|
|
LOCAL_CFLAGS = $(STDC) $(WARN) $(WARNMORE)
|
|
CFLAGS = -O2 -g
|
|
ALL_CFLAGS = $(LOCAL_CFLAGS) $(CFLAGS)
|
|
ARFLAGS = rc
|
|
LDFLAGS = -L$(ZLIBLIB) -g
|
|
LIBS = -lz -lm
|
|
|
|
# File extensions
|
|
EXEEXT =
|
|
|
|
# Pre-built configuration
|
|
# See scripts/pnglibconf/pnglibconf.mak for more options
|
|
PNGLIBCONF_H_PREBUILT = pnglibconf.h.prebuilt
|
|
|
|
# File lists
|
|
OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o pngread.o \
|
|
pngrio.o pngrtran.o pngrutil.o pngset.o pngsimd.o \
|
|
pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
|
|
|
|
# Targets
|
|
all: libpng.a pngtest$(EXEEXT)
|
|
|
|
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
|
|
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
|
|
|
|
.c.o:
|
|
$(CC) -c $(ALL_CPPFLAGS) $(ALL_CFLAGS) -o $@ $*.c
|
|
|
|
libpng.a: $(OBJS)
|
|
$(AR) $(ARFLAGS) $@ $(OBJS)
|
|
$(RANLIB) $@
|
|
|
|
test: pngtest$(EXEEXT)
|
|
./pngtest$(EXEEXT)
|
|
|
|
pngtest$(EXEEXT): pngtest.o libpng.a
|
|
$(LD) $(LDFLAGS) -o $@ pngtest.o libpng.a $(LIBS)
|
|
|
|
clean:
|
|
$(RM_F) *.o libpng.a pngtest$(EXEEXT) pngout.png pnglibconf.h
|
|
|
|
# TODO:
|
|
# Use the compiler to generate dependency files (e.g. "$(CC) -MD") and
|
|
# include those files here, for the benefit of the Make implementations
|
|
# that support the GNU Make syntax extensions.
|
|
|
|
png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h pngtarget.h
|
|
pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h pngtarget.h
|
|
pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h pngtarget.h
|
|
pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h pngtarget.h
|
|
pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h pngtarget.h
|
|
pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h pngtarget.h
|
|
pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h pngtarget.h
|
|
pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h pngtarget.h
|
|
pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h pngtarget.h
|
|
pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h pngtarget.h
|
|
pngsimd.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h pngtarget.h
|
|
pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h pngtarget.h
|
|
pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h pngtarget.h
|
|
pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h pngtarget.h
|
|
pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h pngtarget.h
|
|
pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h pngtarget.h
|
|
|
|
pngtest.o: png.h pngconf.h pnglibconf.h
|