1# Copyright (C) 2001-2012 Artifex Software, Inc. 2# All Rights Reserved. 3# 4# This software is provided AS-IS with no warranty, either express or 5# implied. 6# 7# This software is distributed under license and may not be copied, 8# modified or distributed except as expressly authorized under the terms 9# of the license contained in the file LICENSE in this distribution. 10# 11# Refer to licensing information at http://www.artifex.com or contact 12# Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134, San Rafael, 13# CA 94903, U.S.A., +1(415)492-9861, for further information. 14# 15# makefile for PNG (Portable Network Graphics) code. 16# Users of this makefile must define the following: 17# ZSRCDIR - the zlib source directory 18# ZGENDIR - the zlib generated intermediate file directory 19# ZOBJDIR - the zlib object directory 20# PNGSRCDIR - the source directory 21# PNGGENDIR - the generated intermediate file directory 22# PNGOBJDIR - the object directory 23# SHARE_LIBPNG - 0 to compile libpng, 1 to share 24# LIBPNG_NAME - if SHARE_LIBPNG=1, the name of the shared library 25 26# This partial makefile compiles the png library for use in the Ghostscript 27# PNG drivers. You can get the source code for this library from: 28# http://www.libpng.org/pub/png/src/ 29# ftp://swrinde.nde.swri.edu/pub/png/src/ 30# ftp://ftp.uu.net/graphics/png/src/ 31# http://libpng.sourceforge.net/ 32# Please see Ghostscript's `Make.htm' file for instructions about how to 33# unpack these archives. 34# 35# When each version of Ghostscript is released, we copy the associated 36# version of the png library to 37# ftp://ftp.cs.wisc.edu/ghost/3rdparty/ 38# for more convenient access. 39# 40# this makefile should work with libpng versions 0.90 and above 41# 42# NOTE: the archive for libpng 0.95 may be inconsistent: if you have 43# compilation problems, use a newer version. 44# 45# Please see Ghostscript's Make.htm file for instructions about how to 46# unpack these archives. 47# 48# The specification for the PNG file format is available from: 49# http://www.group42.com/png.htm 50# http://www.w3.org/pub/WWW/TR/WD-png 51 52# (Rename directories.) 53PNGSRC=$(PNGSRCDIR)$(D) 54PNGGEN=$(PNGGENDIR)$(D) 55PNGOBJ=$(PNGOBJDIR)$(D) 56PNGO_=$(O_)$(PNGOBJ) 57PZGEN=$(ZGENDIR)$(D) 58 59# PI_ and PF_ are defined in gs.mak. 60# NB: we can't use the normal $(CC_) here because msvccmd.mak 61# adds /Za which conflicts with the libpng 1.5.x source. 62PNGCC=$(CC) $(CFLAGS) $(I_)$(PI_)$(_I) $(I_)$(PNGGENDIR)$(_I) $(PF_) $(D_)PNG_NO_ASSEMBLER_CODE$(_D) 63 64# Define the name of this makefile. 65LIBPNG_MAK=$(GLSRC)png.mak 66 67png.clean : png.config-clean png.clean-not-config-clean 68 69### WRONG. MUST DELETE OBJ AND GEN FILES SELECTIVELY. 70png.clean-not-config-clean : 71 $(RM_) $(PNGOBJ)*.$(OBJ) 72 73pnglibconf_h=$(PNGGENDIR)$(D)pnglibconf.h 74 75png.config-clean : 76 $(RM_) $(pnglibconf_h) 77 $(RM_) $(PNGGEN)lpg*.dev 78 79$(pnglibconf_h) : $(PNGSRC)scripts$(D)pnglibconf.h.prebuilt 80 $(CP_) $(PNGSRC)scripts$(D)pnglibconf.h.prebuilt $(pnglibconf_h) 81 82PDEP=$(AK) $(pnglibconf_h) 83 84png_1=$(PNGOBJ)png.$(OBJ) $(PNGOBJ)pngmem.$(OBJ) $(PNGOBJ)pngerror.$(OBJ) $(PNGOBJ)pngset.$(OBJ) 85png_2=$(PNGOBJ)pngtrans.$(OBJ) $(PNGOBJ)pngwrite.$(OBJ) $(PNGOBJ)pngwtran.$(OBJ) $(PNGOBJ)pngwutil.$(OBJ) $(PNGOBJ)pngwio.$(OBJ) 86png_3=$(PNGOBJ)pngread.$(OBJ) $(PNGOBJ)pngrutil.$(OBJ) $(PNGOBJ)pngrtran.$(OBJ) $(PNGOBJ)pngrio.$(OBJ) $(PNGOBJ)pngget.$(OBJ) 87 88# libpng modules 89 90$(PNGOBJ)png.$(OBJ) : $(PNGSRC)png.c $(PDEP) 91 $(PNGCC) $(PNGO_)png.$(OBJ) $(C_) $(PNGSRC)png.c 92 93$(PNGOBJ)pngwio.$(OBJ) : $(PNGSRC)pngwio.c $(PDEP) 94 $(PNGCC) $(PNGO_)pngwio.$(OBJ) $(C_) $(PNGSRC)pngwio.c 95 96$(PNGOBJ)pngmem.$(OBJ) : $(PNGSRC)pngmem.c $(PDEP) 97 $(PNGCC) $(PNGO_)pngmem.$(OBJ) $(C_) $(PNGSRC)pngmem.c 98 99$(PNGOBJ)pngerror.$(OBJ) : $(PNGSRC)pngerror.c $(PDEP) 100 $(PNGCC) $(PNGO_)pngerror.$(OBJ) $(C_) $(PNGSRC)pngerror.c 101 102$(PNGOBJ)pngset.$(OBJ) : $(PNGSRC)pngset.c $(PDEP) 103 $(PNGCC) $(PNGO_)pngset.$(OBJ) $(C_) $(PNGSRC)pngset.c 104 105$(PNGOBJ)pngtrans.$(OBJ) : $(PNGSRC)pngtrans.c $(PDEP) 106 $(PNGCC) $(PNGO_)pngtrans.$(OBJ) $(C_) $(PNGSRC)pngtrans.c 107 108$(PNGOBJ)pngwrite.$(OBJ) : $(PNGSRC)pngwrite.c $(PDEP) 109 $(PNGCC) $(PNGO_)pngwrite.$(OBJ) $(C_) $(PNGSRC)pngwrite.c 110 111$(PNGOBJ)pngwtran.$(OBJ) : $(PNGSRC)pngwtran.c $(PDEP) 112 $(PNGCC) $(PNGO_)pngwtran.$(OBJ) $(C_) $(PNGSRC)pngwtran.c 113 114$(PNGOBJ)pngwutil.$(OBJ) : $(PNGSRC)pngwutil.c $(PDEP) 115 $(PNGCC) $(PNGO_)pngwutil.$(OBJ) $(C_) $(PNGSRC)pngwutil.c 116 117$(PNGOBJ)pngread.$(OBJ) : $(PNGSRC)pngread.c $(PDEP) 118 $(PNGCC) $(PNGO_)pngread.$(OBJ) $(C_) $(PNGSRC)pngread.c 119 120$(PNGOBJ)pngrutil.$(OBJ) : $(PNGSRC)pngrutil.c $(PDEP) 121 $(PNGCC) $(PNGO_)pngrutil.$(OBJ) $(C_) $(PNGSRC)pngrutil.c 122 123$(PNGOBJ)pngrtran.$(OBJ) : $(PNGSRC)pngrtran.c $(PDEP) 124 $(PNGCC) $(PNGO_)pngrtran.$(OBJ) $(C_) $(PNGSRC)pngrtran.c 125 126$(PNGOBJ)pngrio.$(OBJ) : $(PNGSRC)pngrio.c $(PDEP) 127 $(PNGCC) $(PNGO_)pngrio.$(OBJ) $(C_) $(PNGSRC)pngrio.c 128 129$(PNGOBJ)pngget.$(OBJ) : $(PNGSRC)pngget.c $(PDEP) 130 $(PNGCC) $(PNGO_)pngget.$(OBJ) $(C_) $(PNGSRC)pngget.c 131 132 133# Define the version of libpng.dev that we are actually using. 134$(PNGGEN)libpng.dev : $(TOP_MAKEFILES) $(PNGGEN)libpng_$(SHARE_LIBPNG).dev 135 $(CP_) $(PNGGEN)libpng_$(SHARE_LIBPNG).dev $(PNGGEN)libpng.dev 136 137# Define the shared version of libpng. 138# Note that it requires libz, which must be searched *after* libpng. 139$(PNGGEN)libpng_1.dev : $(TOP_MAKEFILES) $(LIBPNG_MAK) $(ECHOGS_XE) $(PZGEN)zlibe.dev 140 $(SETMOD) $(PNGGEN)libpng_1 -lib $(LIBPNG_NAME) 141 $(ADDMOD) $(PNGGEN)libpng_1 -include $(PZGEN)zlibe.dev 142 143# Define the non-shared version of libpng. 144$(PNGGEN)libpng_0.dev : $(LIBPNG_MAK) $(ECHOGS_XE) $(png_1) $(png_2) $(png_3)\ 145 $(PZGEN)zlibe.dev $(PNGOBJ)pngwio.$(OBJ) $(PZGEN)crc32.dev 146 $(SETMOD) $(PNGGEN)libpng_0 $(png_1) 147 $(ADDMOD) $(PNGGEN)libpng_0 $(png_2) 148 $(ADDMOD) $(PNGGEN)libpng_0 $(png_3) 149 $(ADDMOD) $(PNGGEN)libpng_0 $(PNGOBJ)pngwio.$(OBJ) 150 $(ADDMOD) $(PNGGEN)libpng_0 -include $(PZGEN)zlibe.dev $(PZGEN)crc32.dev 151 152