1# Copyright (C) 1997-2003 artofcode LLC. All rights reserved. 2# 3# This software is provided AS-IS with no warranty, either express or 4# implied. 5# 6# This software is distributed under license and may not be copied, 7# modified or distributed except as expressly authorized under the terms 8# of the license contained in the file LICENSE in this distribution. 9# 10# For more information about licensing, please refer to 11# http://www.ghostscript.com/licensing/. For information on 12# commercial licensing, go to http://www.artifex.com/licensing/ or 13# contact Artifex Software, Inc., 101 Lucas Valley Road #110, 14# San Rafael, CA 94903, U.S.A., +1(415)492-9861. 15 16# $Id: macos-mcp.mak,v 1.35 2005/08/31 05:52:32 ray Exp $ 17# Makefile for CodeWarrior XML project file creation from Darwin/MacOSX. 18 19# Run this file through make on MacOS X (or any other system with shell 20# scripting) to produce an xml project file. Import that file into 21# Metrowerks Codewarrior to perform the actual build targeting MacOS. 22 23# ------------------------------- Options ------------------------------- # 24 25####### The following are the only parts of the file you should need to edit. 26 27# Define the directory for the final executable, and the 28# source, generated intermediate file, and object directories 29# for the graphics library (GL) and the PostScript/PDF interpreter (PS). 30 31BINDIR=./bin 32GLSRCDIR=./src 33GLGENDIR=./obj 34GLOBJDIR=./obj 35PSSRCDIR=./src 36PSLIBDIR=./lib 37PSGENDIR=./obj 38PSOBJDIR=./obj 39 40# Do not edit the next group of lines. 41 42include $(GLSRCDIR)/version.mak 43DD=$(GLGENDIR)/ 44GLD=$(GLGENDIR)/ 45PSD=$(PSGENDIR)/ 46 47# ------ Generic options ------ # 48 49# Define the default directory/ies for the runtime 50# initialization, resource and font files. Separate multiple directories with a :. 51 52GS_LIB_DEFAULT=:,:lib,:Resource,:files,:fonts,:examples 53 54GS_DOCDIR=:doc 55 56# Define whether or not searching for initialization files should always 57# look in the current directory first. This leads to well-known security 58# and confusion problems, but users insist on it. 59# NOTE: this also affects searching for files named on the command line: 60# see the "File searching" section of Use.htm for full details. 61# Because of this, setting SEARCH_HERE_FIRST to 0 is not recommended. 62 63SEARCH_HERE_FIRST=1 64 65# Define the name of the interpreter initialization file. 66# (There is no reason to change this.) 67 68GS_INIT=gs_init.ps 69 70# Choose generic configuration options. 71 72GENOPT= 73 74# Define the name of the executable file. Not used for the CW project, don't change it 75 76GS=macgs 77 78# Define the name of a pre-built executable that can be invoked at build 79# time. Currently, this is only needed for compiled fonts. The usual 80# alternatives are: 81# - the standard name of Ghostscript on your system (typically `gs'): 82BUILD_TIME_GS=gs 83# - the name of the executable you are building now. If you choose this 84# option, then you must build the executable first without compiled fonts, 85# and then again with compiled fonts. 86#BUILD_TIME_GS=$(BINDIR)/$(GS) -I$(PSLIBDIR) 87 88# Define the platform name. 89 90PLATFORM=macos_ 91 92 93# don't use any shared libraries, they are compiled into the Ghostscript Lib 94 95SHARE_LIBPNG=0 96SHARE_JPEG=0 97SHARE_ZLIB=0 98SHARE_JBIG2=0 99SHARE_JASPER=0 100 101# Define the directory where the IJG JPEG library sources are stored, 102# and the major version of the library that is stored there. 103# You may need to change this if the IJG library version changes. 104# See jpeg.mak for more information. 105 106JSRCDIR=jpeg 107JVERSION=6 108 109# Define the directory where the PNG library sources are stored, 110# and the version of the library that is stored there. 111# You may need to change this if the libpng version changes. 112# See libpng.mak for more information. 113 114PSRCDIR=libpng 115PVERSION=10208 116 117# Define the directory where the zlib sources are stored. 118# See zlib.mak for more information. 119 120ZSRCDIR=zlib 121 122# Define the jbig2dec library source location. 123# See jbig2.mak for more information. 124 125JBIG2SRCDIR=jbig2dec 126 127# Define the japser library source location. 128# See jasper.mak for more information. 129 130JASPERSRCDIR=jasper 131 132# Define the directory where the icclib source are stored. 133# See icclib.mak for more information 134 135ICCSRCDIR=icclib 136 137# IJS has not been ported to MacOS Classic. If you do the port, 138# you'll need to set these values. You'll also need to 139# include the ijs.mak makefile (right after icclib.mak). 140# 141# Define the directory where the ijs source is stored, 142# and the process forking method to use for the server. 143# See ijs.mak for more information. 144 145#IJSSRCDIR=ijs 146#IJSEXECTYPE=unix 147 148# ------ Platform-specific options ------ # 149 150# Define the name of the C compiler. 151 152# we don't want to build, so CC and LD don't have to do anything, just echo the arguments 153CC=echo 154CFLAGS= 155CCLD= 156LDFLAGS= 157EXTRALIBS= 158STDLIBS= 159 160# Define whether this platform has floating point hardware: 161# FPU_TYPE=2 means floating point is faster than fixed point. 162# (This is the case on some RISCs with multiple instruction dispatch.) 163# FPU_TYPE=1 means floating point is at worst only slightly slower 164# than fixed point. 165# FPU_TYPE=0 means that floating point may be considerably slower. 166# FPU_TYPE=-1 means that floating point is always much slower than 167# fixed point. 168 169FPU_TYPE=2 170 171# Define the .dev module that implements thread and synchronization 172# primitives for this platform. 173# No real sync in MacOS 8/9, so leave it at nosync 174 175SYNC=nosync 176 177# ------ Devices and features ------ # 178 179# Choose the language feature(s) to include. See gs.mak for details. 180 181FEATURE_DEVS=$(PSD)psl3.dev $(PSD)pdf.dev $(PSD)dpsnext.dev $(PSD)ttfont.dev $(PSD)epsf.dev $(GLD)pipe.dev $(PSD)macres.dev $(PSD)macpoll.dev $(PSD)jbig2.dev 182#FEATURE_DEVS=$(PSD)psl3.dev $(PSD)pdf.dev 183#FEATURE_DEVS=$(PSD)psl3.dev $(PSD)pdf.dev $(PSD)dpsnext.dev $(PSD)ttfont.dev $(PSD)rasterop.dev $(GLD)pipe.dev 184# The following is strictly for testing. 185FEATURE_DEVS_ALL=$(PSD)psl3.dev $(PSD)pdf.dev $(PSD)dpsnext.dev $(PSD)ttfont.dev $(PSD)rasterop.dev $(PSD)double.dev $(PSD)trapping.dev $(PSD)stocht.dev $(GLD)pipe.dev $(GLD)macres.dev $(PSD)jbig2.dev $(PSD)jpx.dev $(PSD)macpoll.dev 186#FEATURE_DEVS=$(FEATURE_DEVS_ALL) 187 188# Choose whether to compile the .ps initialization files into the executable. 189# See gs.mak for details. 190 191COMPILE_INITS=0 192 193# Choose whether to store band lists on files or in memory. 194# The choices are 'file' or 'memory'. 195 196BAND_LIST_STORAGE=file 197 198# Choose which compression method to use when storing band lists in memory. 199# The choices are 'lzw' or 'zlib'. 200 201BAND_LIST_COMPRESSOR=zlib 202 203# Choose the implementation of file I/O: 'stdio', 'fd', or 'both'. 204# See gs.mak and sfxfd.c for more details. 205 206FILE_IMPLEMENTATION=stdio 207 208# Choose the implementation of stdio: '' for file I/O and 'c' for callouts 209# See gs.mak and ziodevs.c/ziodevsc.c for more details. 210 211STDIO_IMPLEMENTATION=c 212 213# Define the name table capacity size of 2^(16+n). 214# Setting this to a non-zero value will slow down the interpreter. 215 216EXTEND_NAMES=0 217 218# Choose the device(s) to include. See devs.mak for details, 219# devs.mak and contrib.mak for the list of available devices. 220 221DEVICE_DEVS=$(DD)macos.dev $(DD)macos_.dev $(DD)display.dev 222 223#DEVICE_DEVS1= 224#DEVICE_DEVS2= 225#DEVICE_DEVS3= 226#DEVICE_DEVS4= 227#DEVICE_DEVS5= 228#DEVICE_DEVS6= 229#DEVICE_DEVS7= 230#DEVICE_DEVS8= 231#DEVICE_DEVS9= 232#DEVICE_DEVS10= 233#DEVICE_DEVS11= 234#DEVICE_DEVS12= 235#DEVICE_DEVS13= 236#DEVICE_DEVS14= 237#DEVICE_DEVS15= 238#DEVICE_DEVS16= 239#DEVICE_DEVS17= 240#DEVICE_DEVS18= 241#DEVICE_DEVS19= 242#DEVICE_DEVS20= 243 244DEVICE_DEVS1=$(DD)bmpmono.dev $(DD)bmpgray.dev $(DD)bmpsep1.dev $(DD)bmpsep8.dev $(DD)bmp16.dev $(DD)bmp256.dev $(DD)bmp16m.dev $(DD)bmp32b.dev 245DEVICE_DEVS2=$(DD)bmpamono.dev $(DD)bmpasep1.dev $(DD)bmpasep8.dev $(DD)bmpa16.dev $(DD)bmpa256.dev $(DD)bmpa16m.dev $(DD)bmpa32b.dev 246DEVICE_DEVS3=$(DD)deskjet.dev $(DD)djet500.dev $(DD)laserjet.dev $(DD)ljetplus.dev $(DD)ljet2p.dev $(DD)ljet3.dev $(DD)ljet3d.dev $(DD)ljet4.dev $(DD)ljet4d.dev $(DD)lj5mono.dev $(DD)lj5gray.dev 247DEVICE_DEVS4=$(DD)cdeskjet.dev $(DD)cdjcolor.dev $(DD)cdjmono.dev $(DD)cdj550.dev $(DD)pj.dev $(DD)pjxl.dev $(DD)pjxl300.dev 248DEVICE_DEVS5=$(DD)uniprint.dev 249DEVICE_DEVS6=$(DD)bj10e.dev $(DD)bj200.dev $(DD)bjc600.dev $(DD)bjc800.dev 250DEVICE_DEVS7=$(DD)faxg3.dev $(DD)faxg32d.dev $(DD)faxg4.dev 251DEVICE_DEVS8=$(DD)pcxmono.dev $(DD)pcxgray.dev $(DD)pcx16.dev $(DD)pcx256.dev $(DD)pcx24b.dev $(DD)pcxcmyk.dev 252DEVICE_DEVS9=$(DD)pbm.dev $(DD)pbmraw.dev $(DD)pgm.dev $(DD)pgmraw.dev $(DD)pgnm.dev $(DD)pgnmraw.dev $(DD)pnm.dev $(DD)pnmraw.dev $(DD)ppm.dev $(DD)ppmraw.dev $(DD)pkm.dev $(DD)pkmraw.dev $(DD)pksm.dev $(DD)pksmraw.dev 253DEVICE_DEVS10=$(DD)tiffcrle.dev $(DD)tiffg3.dev $(DD)tiffg32d.dev $(DD)tiffg4.dev $(DD)tifflzw.dev $(DD)tiffpack.dev 254DEVICE_DEVS11=$(DD)tiff12nc.dev $(DD)tiff24nc.dev $(DD)tiffgray.dev $(DD)tiff32nc.dev $(DD)tiffsep.dev 255DEVICE_DEVS12=$(DD)psmono.dev $(DD)psgray.dev $(DD)psrgb.dev $(DD)bit.dev $(DD)bitrgb.dev $(DD)bitcmyk.dev 256DEVICE_DEVS13=$(DD)pngmono.dev $(DD)pnggray.dev $(DD)png16.dev $(DD)png256.dev $(DD)png16m.dev 257DEVICE_DEVS14=$(DD)jpeg.dev $(DD)jpeggray.dev $(DD)jpegcmyk.dev 258DEVICE_DEVS15=$(DD)pdfwrite.dev $(DD)pswrite.dev $(DD)ps2write.dev $(DD)epswrite.dev $(DD)pxlmono.dev $(DD)pxlcolor.dev 259 260DEVICE_DEVS16=$(DD)bbox.dev 261DEVICE_DEVS17= 262DEVICE_DEVS18= 263DEVICE_DEVS19= 264DEVICE_DEVS20=$(DD)cljet5.dev $(DD)cljet5c.dev 265 266# ---------------------------- End of options --------------------------- # 267 268# Define the name of the partial makefile that specifies options -- 269# used in dependencies. 270 271MAKEFILE=$(GLSRCDIR)/macos-mcp.mak 272TOP_MAKEFILES= 273 274 275# Define the auxilary program dependency. (we don't have any) 276 277AK= 278 279# Define the compilation rules and flags. 280 281CCFLAGS=$(GENOPT) $(CFLAGS) 282CC_=$(CC) $(CCFLAGS) 283# define CCAUX as the real cc compiler, we use this to build the code generation tools 284CCAUX=cc 285# These are the specific warnings we have to turn off to compile those 286# specific few files that need this. We may turn off others in the future. 287CC_NO_WARN=$(CC_) -Wno-cast-qual -Wno-traditional 288 289# ---------------- End of platform-specific section ---------------- # 290 291include $(GLSRCDIR)/unixhead.mak 292 293# Redefine the platform name before going on 294PLATFORM=macos_ 295 296include $(GLSRCDIR)/gs.mak 297include $(GLSRCDIR)/lib.mak 298include $(PSSRCDIR)/int.mak 299include $(PSSRCDIR)/cfonts.mak 300include $(GLSRCDIR)/jpeg.mak 301# zlib.mak must precede libpng.mak 302include $(GLSRCDIR)/zlib.mak 303include $(GLSRCDIR)/libpng.mak 304include $(GLSRCDIR)/jbig2.mak 305include $(GLSRCDIR)/jasper.mak 306include $(GLSRCDIR)/icclib.mak 307include $(GLSRCDIR)/devs.mak 308include $(GLSRCDIR)/contrib.mak 309#include $(GLSRCDIR)/unix-aux.mak 310#include $(GLSRCDIR)/unixlink.mak 311#include $(GLSRCDIR)/unix-dll.mak 312include $(GLSRCDIR)/unix-end.mak 313#include $(GLSRCDIR)/unixinst.mak 314 315 316 317# ------------------------------------------------------------------- # 318# ------------------------------------------------------------------- # 319 320 321 322# --------------- mac device sources (move to devs.mak??) ----------- # 323 324gdevmac_h=$(GLSRC)gdevmac.h 325gdevmacttf_h=$(GLSRC)gdevmacttf.h 326 327macos_=$(GLOBJ)gdevmac.$(OBJ) 328 329$(GLD)macos.dev: $(macos_) $(GLOBJ)gdevemap.$(OBJ) 330 $(SETDEV) $(PSD)macos $(macos_) 331 332$(GLOBJ)gdevmac.$(OBJ): $(GLSRC)gdevmac.c $(gp_mac_h) $(gdevmac_h) 333$(GLOBJ)gdevemap.$(OBJ): $(GLSRC)gdevemap.c 334$(GLOBJ)gdevmacxf.$(OBJ): $(GLSRC)gdevmacxf.c 335 336# -------------------- Platform specific sources -------------------- # 337 338gp_mac_h=$(GLSRC)gp_mac.h 339gconfig_h=$(GLOBJ)gconfig.h 340gconfigv_h=$(GLOBJ)gconfigv.h 341 342macsystypes_h=$(GLSRC)macsystypes.h 343systypes_h=$(GLOBJ)sys/types.h 344 345$(GLOBJ)gp_mac.$(OBJ): $(GLSRC)gp_mac.c 346$(GLOBJ)gp_macio.$(OBJ): $(GLSRC)gp_macio.c $(gx_h) $(gp_h) $(gpmisc_h) 347$(GLOBJ)gp_stdin.$(OBJ): $(GLSRC)gp_stdin.c $(AK) $(stdio__h) $(gx_h) $(gp_h) 348 349# ------------------------------------------------------------------- # 350 351MAC1=$(GLOBJ)gp_macio.$(OBJ) $(GLOBJ)gp_mac.$(OBJ) $(GLOBJ)gdevmacxf.$(OBJ) $(GLOBJ)gp_stdin.$(OBJ) 352MAC2=$(GLOBJ)gp_getnv.$(OBJ) $(GLOBJ)gp_nsync.$(OBJ) $(GLOBJ)gdevemap.$(OBJ) $(GLOBJ)gsdll.$(OBJ) 353 354$(GLD)macos_.dev: $(MAC1) 355 $(SETMOD) $(DD)macos_ $(MAC1) $(MAC) 356 $(ADDMOD) $(DD)macos_ -obj $(MAC2) 357 # uncomment the line below if you need the legacy macstdio device 358 #$(ADDMOD) $(DD)macos_ -iodev macstdio # macstdio does not work with MSL!!! 359 360# Define polling as a separable feature because it is not needed by the gslib. 361macpoll_=$(GLOBJ)gp_macpoll.$(OBJ) 362$(GLD)macpoll.dev: $(ECHOGS_XE) $(macpoll_) 363 $(SETMOD) $(GLD)macpoll $(macpoll_) 364 365$(GLOBJ)gp_macpoll.$(OBJ): $(GLSRC)gp_macpoll.c $(AK)\ 366 $(gx_h) $(gp_h) $(gpcheck_h) $(iapi_h) $(iref_h) $(iminst_h) $(imain_h) 367 368 369# ------------------------------------------------------------------- # 370 371# -------------------------- Auxiliary files ------------------------ # 372 373# No special gconfig_.h is needed. 374$(gconfig__h): 375 echo "/* This file deliberately left blank. */" > $(gconfig__h) 376 377$(ECHOGS_XE): $(GLSRC)echogs.c $(AK) $(ECHOGS_DEPS) 378 $(CCAUX) $(I_)$(GLSRCDIR)$(_I) $(O_)$(ECHOGS_XE) $(GLSRC)echogs.c 379 380$(GENARCH_XE): $(GLSRC)genarch.c $(AK) $(GENARCH_DEPS) 381 $(CCAUX) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENARCH_XE) $(GLSRC)genarch.c 382 383$(GENCONF_XE): $(GLSRC)genconf.c $(AK) $(GENCONF_DEPS) 384 $(CCAUX) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENCONF_XE) $(GLSRC)genconf.c 385 386$(GENDEV_XE): $(GLSRC)gendev.c $(AK) $(GENDEV_DEPS) 387 $(CCAUX) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENDEV_XE) $(GLSRC)gendev.c 388 389$(GENHT_XE): $(GLSRC)genht.c $(AK) $(GENHT_DEPS) 390 $(CCAUX) $(GENHT_CFLAGS) $(O_)$(GENHT_XE) $(GLSRC)genht.c 391 392$(GENINIT_XE): $(GLSRC)geninit.c $(AK) $(GENINIT_DEPS) 393 $(CCAUX) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENINIT_XE) $(GLSRC)geninit.c 394 395 396# ---------------------- CW XML Project file ------------------------ # 397 398ldt_tr=$(PSOBJ)ldt.tr 399CWPROJ_XML=./ghostscript.mcp.xml 400 401$(CWPROJ_XML): $(gconfigd_h) 402 -mkdir -p obj/sys 403 $(CP_) $(macsystypes_h) $(systypes_h) 404 $(SH) $(GLSRC)macgenmcpxml.sh `$(CAT) $(ld_tr)` > $(CWPROJ_XML) 405 $(CP_) $(GLSRC)gconf.c $(GLOBJ)gconfig.c 406 $(CP_) $(GLSRC)iconf.c $(GLOBJ)iconfig.c 407 $(CP_) $(GLSRC)gscdef.c $(GLOBJ)gscdefs.c 408 /Developer/Tools/SetFile -c CWIE -t TEXT $(CWPROJ_XML) 409 410$(GS_XE): $(ld_tr) $(ECHOGS_XE) $(XE_ALL) $(CWPROJ_XML) 411 412# ------------------------------------------------------------------- # 413 414# This has to come last so it won't be taken as the default target. 415$(AK): 416 if ( $(CCAUX) --version | egrep "^2\.7\.([01]|2(\.[^1-9]|$$))" >/dev/null ); then echo -Dconst= >$(AK); else echo -Wcast-qual -Wwrite-strings >$(AK); fi 417 418