1# Copyright (C) 1991, 2000 Aladdin Enterprises. 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: wccommon.mak,v 1.8 2003/12/11 02:22:11 giles Exp $ 17# wccommon.mak 18# Section of Watcom C/C++ makefile common to MS-DOS and MS Windows. 19# We strongly recommend that you read the Watcom section of Make.htm 20# before attempting to build Ghostscript with the Watcom compiler. 21 22# This file is used by watc.mak, watcwin.mak, and watclib.mak. 23# Those files supply the following parameters: 24# Configuration, public: 25# GS_LIB_DEFAULT, SEARCH_HERE_FIRST, GS_INIT, FEATURE_DEVS, 26# DEVICE_DEVS*, COMPILE_INITS, BAND_LIST_* 27# Configuration, internal, generic: 28# PLATFORM, MAKEFILE, AK, CC*, DEBUG, NOPRIVATE, CP_, RM_, RMN_ 29# Configuration, internal, specific to DOS/Windows: 30# TDEBUG, USE_ASM, ASM, 31# COMPDIR, LIBPATHS, 32# CPU_TYPE, FPU_TYPE 33 34# We want Unix-compatible behavior. This is part of it. 35 36.NOCHECK 37 38# Define additional extensions to keep `make' happy 39 40.EXTENSIONS: .be .z 41 42# Define the auxiliary program dependency. We don't use this. 43 44AK= 45 46# Note that built-in third-party libraries aren't available. 47 48SHARE_JPEG=0 49SHARE_LIBPNG=0 50SHARE_ZLIB=0 51SHARE_JBIG2=0 52 53# Define the extensions for command, object, and executable files. 54 55NULL= 56 57C_= 58CMD=.bat 59D_=-D 60_D_=$(NULL)= 61_D= 62I_=-i= 63II=-i= 64_I= 65NO_OP=%null 66O_=-fo= 67OBJ=obj 68Q= 69RO_=$(O_) 70XE=.exe 71XEAUX=.exe 72 73# Define the executable and shell invocations. 74 75D=\\ 76 77EXP= 78SH= 79 80# Define generic commands. 81 82CP_=call $(GLSRCDIR)\cp.bat 83RM_=call $(GLSRCDIR)\rm.bat 84RMN_=call $(GLSRCDIR)\rm.bat 85 86# Define the arguments for genconf. 87 88# wmake interprets & as calling for background execution, and ^ fails on 89# Windows NT. 90CONFILES=-e ~ -p FILE~s~ps 91CONFLDTR=-ol 92 93# Define the names of the Watcom C files. 94# See the comments in watc.mak and watcwin.mak regarding WCVERSION. 95 96!ifeq WCVERSION 11.0 97# 11.0 is currently the same as 10.5. 98COMP=$(%WATCOM)\binw\wcc386 99LINK=$(%WATCOM)\binw\wlink 100STUB=$(%WATCOM)\binw\wstub.exe 101WRC=$(%WATCOM)\binw\wrc.exe 102!endif 103 104!ifeq WCVERSION 10.5 105COMP=$(%WATCOM)\binw\wcc386 106LINK=$(%WATCOM)\binw\wlink 107STUB=$(%WATCOM)\binw\wstub.exe 108WRC=$(%WATCOM)\binw\wrc.exe 109!endif 110 111!ifeq WCVERSION 10.0 112COMP=$(%WATCOM)\binb\wcc386 113LINK=$(%WATCOM)\bin\wlink 114STUB=$(%WATCOM)\binb\wstub.exe 115WRC=$(%WATCOM)\binb\wrc.exe 116!endif 117 118!ifeq WCVERSION 9.5 119COMP=$(%WATCOM)\bin\wcc386 120LINK=$(%WATCOM)\bin\wlinkp 121STUB=$(%WATCOM)\binb\wstub.exe 122WRC=$(%WATCOM)\binb\wrc.exe 123!endif 124 125# 95/NT Watcom compiler versions 126# 10.695 is 10.6 under Windows 95 or NT (32 bit hosted tools) 127!ifeq WCVERSION 10.695 128COMP=$(%WATCOM)\binnt\wcc386 129LINK=$(%WATCOM)\binnt\wlink 130STUB=$(%WATCOM)\binw\wstub.exe 131WRC=$(%WATCOM)\binnt\wrc.exe 132WAT32=1 133!endif 134 135# Defaults 136!ifndef COMP 137COMP=$(%WATCOM)\bin\wcc386p 138LINK=$(%WATCOM)\bin\wlinkp 139STUB=$(%WATCOM)\binb\wstub.exe 140WRC=$(%WATCOM)\binb\rc.exe 141!endif 142!ifndef WAT32 143WAT32=0 144!endif 145 146!ifeq WAT32 0 147INCDIRS=$(%WATCOM)\h 148!else 149INCDIRS=$(%WATCOM)\h;$(%WATCOM)\h\nt 150!endif 151WBIND=$(%WATCOM)\binb\wbind.exe 152 153# Define the generic compilation flags. 154 155!ifeq CPU_TYPE 586 156!ifeq FPU_TYPE 0 157FPU_TYPE=387 158!endif 159!else 160!ifeq CPU_TYPE 486 161!ifeq FPU_TYPE 0 162FPU_TYPE=387 163!endif 164!endif 165!endif 166 167!ifeq FPU_TYPE 387 168FPFLAGS=-fpi87 169!else 170!ifeq FPU_TYPE 287 171FPFLAGS=-fpi287 172!else 173!ifeq FPU_TYPE -1 174FPFLAGS=-fpc 175!else 176FPFLAGS=-fpi 177!endif 178!endif 179!endif 180 181INTASM= 182PCFBASM= 183 184# Define the generic compilation rules. 185 186.asm.obj: 187 $(ASM) $(ASMFLAGS) $<; 188 189# Make sure we get the right default target for make. 190 191dosdefault: default 192 $(NO_OP) 193 194# Define the compilation flags. 195 196# Privacy 197!ifneq NOPRIVATE 0 198CP=-dNOPRIVATE 199!else 200CP= 201!endif 202 203# Run-time debugging and stack checking 204!ifneq DEBUG 0 205CD=-dDEBUG 206CS= 207!else 208CD= 209CS=-oeilnt -s 210!endif 211 212# Debugger symbols 213!ifneq TDEBUG 0 214CT=-d2 215LCT=DEBUG ALL 216!else 217CT=-d1 218LCT=DEBUG LINES 219!endif 220 221GENOPT=$(CP) $(CD) $(CT) $(CS) 222 223CCOPT=-d+ -i=$(INCDIRS) -zq -zp8 -ei 224CCFLAGS=$(CCOPT) $(GENOPT) $(PLATOPT) $(FPFLAGS) $(CFLAGS) $(XCFLAGS) 225CC=$(COMP) -oi $(CCFLAGS) 226CCAUX=$(COMP) -oi $(CCOPT) $(FPFLAGS) 227CC_=$(CC) 228CC_D=$(CC) 229CC_INT=$(COMP) -oit $(CCFLAGS) 230CC_NO_WARN=$(CC_) 231