etlegacy-libs/libpng/scripts/makefile.emcc

93 lines
3.2 KiB
Text
Raw Permalink Normal View History

# makefile for libpng using emscripten
# Copyright (C) 2000, 2014, 2019-2025 Cosmin Truta
# Copyright (C) 2021 Kirk Roerig
2019-05-25 13:21:21 +00:00
# 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 = emcc
2019-05-25 13:21:21 +00:00
LD = $(CC)
AR = emar
RANLIB = emranlib
2019-05-25 13:21:21 +00:00
CP = cp
RM_F = rm -f
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 =
2019-05-25 13:21:21 +00:00
CPPFLAGS = -I$(ZLIBINC) # -DPNG_DEBUG=5
ALL_CPPFLAGS = $(LOCAL_CPPFLAGS) $(CPPFLAGS)
LOCAL_CFLAGS = $(STDC) $(WARN) # $(WARNMORE)
CFLAGS = -O2
ALL_CFLAGS = $(LOCAL_CFLAGS) $(CFLAGS)
ARFLAGS = rc
LDFLAGS = -L$(ZLIBLIB)
PNGTEST_LDFLAGS = --preload-file=pngtest.png
2019-05-25 13:21:21 +00:00
LIBS = -lz -lm
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/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 \
pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
2019-05-25 13:21:21 +00:00
# Targets
all: static
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
.c.o:
$(CC) -c $(ALL_CPPFLAGS) $(ALL_CFLAGS) -o $@ $*.c
2019-05-25 13:21:21 +00:00
static: libpng.a pngtest
2019-05-25 13:21:21 +00:00
shared:
@echo This makefile cannot create shared libraries.
2019-05-25 13:21:21 +00:00
@false
libpng.a: $(OBJS)
$(AR) $(ARFLAGS) $@ $(OBJS)
2019-05-25 13:21:21 +00:00
$(RANLIB) $@
test: pngtest
node ./pngtest
2019-05-25 13:21:21 +00:00
pngtest: pngtest.o libpng.a
$(LD) $(LDFLAGS) $(PNGTEST_LDFLAGS) -o $@ pngtest.o libpng.a $(LIBS)
2019-05-25 13:21:21 +00:00
clean:
$(RM_F) *.o libpng.a pngtest pngout.png pnglibconf.h
$(RM_F) pngtest.data pngtest.wasm
2019-05-25 13:21:21 +00:00
png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtest.o: png.h pngconf.h pnglibconf.h