fukasawa e60969
# makefile for libpng using gcc (generic, static library)
fukasawa e60969
# Copyright (C) 2008, 2014 Glenn Randers-Pehrson
fukasawa e60969
# Copyright (C) 2000 Cosmin Truta
fukasawa e60969
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
fukasawa e60969
#
fukasawa e60969
# This code is released under the libpng license.
fukasawa e60969
# For conditions of distribution and use, see the disclaimer
fukasawa e60969
# and license in png.h
fukasawa e60969
fukasawa e60969
# Location of the zlib library and include files
fukasawa e60969
ZLIBINC = ../zlib
fukasawa e60969
ZLIBLIB = ../zlib
fukasawa e60969
fukasawa e60969
# Compiler, linker, lib and other tools
fukasawa e60969
CC = gcc
fukasawa e60969
LD = $(CC)
fukasawa e60969
AR_RC = ar rcs
fukasawa e60969
RANLIB = ranlib
fukasawa e60969
CP = cp
fukasawa e60969
RM_F = rm -f
fukasawa e60969
fukasawa e60969
WARNMORE = -Wwrite-strings -Wpointer-arith -Wshadow \
fukasawa e60969
	-Wmissing-declarations -Wtraditional -Wcast-align \
fukasawa e60969
	-Wstrict-prototypes -Wmissing-prototypes # -Wconversion
fukasawa e60969
CPPFLAGS = -I$(ZLIBINC) # -DPNG_DEBUG=5
fukasawa e60969
CFLAGS = -W -Wall -O2 # $(WARNMORE) -g
fukasawa e60969
LDFLAGS =
fukasawa e60969
LIBS = -lz -lm
fukasawa e60969
fukasawa e60969
# File extensions
fukasawa e60969
EXEEXT =
fukasawa e60969
fukasawa e60969
# Pre-built configuration
fukasawa e60969
# See scripts/pnglibconf.mak for more options
fukasawa e60969
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
fukasawa e60969
fukasawa e60969
# Variables
fukasawa e60969
OBJS =  png.o pngerror.o pngget.o pngmem.o pngpread.o \
fukasawa e60969
	pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
fukasawa e60969
	pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
fukasawa e60969
fukasawa e60969
# Targets
fukasawa e60969
all: static
fukasawa e60969
fukasawa e60969
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
fukasawa e60969
	$(CP) $(PNGLIBCONF_H_PREBUILT) $@
fukasawa e60969
fukasawa e60969
.c.o:
fukasawa e60969
	$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
fukasawa e60969
fukasawa e60969
static: libpng.a pngtest$(EXEEXT)
fukasawa e60969
fukasawa e60969
shared:
fukasawa e60969
	@echo This is a generic makefile that cannot create shared libraries.
fukasawa e60969
	@echo Please use a configuration that is specific to your platform.
fukasawa e60969
	@false
fukasawa e60969
fukasawa e60969
libpng.a: $(OBJS)
fukasawa e60969
	$(AR_RC) $@ $(OBJS)
fukasawa e60969
	$(RANLIB) $@
fukasawa e60969
fukasawa e60969
test: pngtest$(EXEEXT)
fukasawa e60969
	./pngtest$(EXEEXT)
fukasawa e60969
fukasawa e60969
pngtest$(EXEEXT): pngtest.o libpng.a
fukasawa e60969
	$(LD) $(LDFLAGS) -L$(ZLIBLIB) -o $@ pngtest.o libpng.a $(LIBS)
fukasawa e60969
fukasawa e60969
clean:
fukasawa e60969
	$(RM_F) *.o libpng.a pngtest$(EXEEXT) pngout.png pnglibconf.h
fukasawa e60969
fukasawa e60969
png.o:      png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
pngget.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
pngmem.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
pngread.o:  png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
pngrio.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
pngset.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
pngwio.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
fukasawa e60969
pngtest.o:  png.h pngconf.h pnglibconf.h