xref: /plan9/sys/src/cmd/gs/src/winlib.mak (revision 593dc095aefb2a85c828727bbfa9da139a49bdf4)
1#    Copyright (C) 1991-1999, 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: winlib.mak,v 1.24 2004/12/01 20:02:11 ray Exp $
17# Common makefile section for 32-bit MS Windows.
18
19# This makefile must be acceptable to Microsoft Visual C++, Watcom C++,
20# and Borland C++.  For this reason, the only conditional directives
21# allowed are !if[n]def, !else, and !endif.
22
23
24# Note that built-in third-party libraries aren't available.
25
26SHARE_JPEG=0
27SHARE_LIBPNG=0
28SHARE_ZLIB=0
29SHARE_JBIG2=0
30SHARE_JASPER=0
31
32# Define the platform name.
33
34!ifndef PLATFORM
35PLATFORM=mswin32_
36!endif
37
38# Define the auxiliary program dependency. We use this to
39# preconstruct ccf32.tr to get around the limit on the maximum
40# length of a command line.
41
42AK=$(GLGENDIR)\ccf32.tr
43
44# Define the syntax for command, object, and executable files.
45
46NULL=
47
48CMD=.bat
49D_=-D
50_D_=$(NULL)=
51_D=
52I_=-I
53II=-I
54_I=
55NO_OP=@rem
56# O_ and XE_ are defined separately for each compiler.
57OBJ=obj
58Q=
59XE=.exe
60XEAUX=.exe
61
62# Define generic commands.
63
64# We have to use a batch file for the equivalent of cp,
65# because the DOS COPY command copies the file write time, like cp -p.
66# We also have to use a batch file for for the equivalent of rm -f,
67# because the DOS ERASE command returns an error status if the file
68# doesn't exist.
69CP_=call $(GLSRCDIR)\cp.bat
70RM_=call $(GLSRCDIR)\rm.bat
71RMN_=call $(GLSRCDIR)\rm.bat
72
73# Define the generic compilation flags.
74
75PLATOPT=
76
77INTASM=
78PCFBASM=
79
80# Define conditinal name for UFST bridge :
81!ifdef UFST_ROOT
82UFST_BRIDGE = 1
83UFST_LIB_EXT=.lib
84!endif
85
86# Define conditinal name for FreeType bridge :
87!ifdef FT_ROOT
88FT_BRIDGE = 1
89FT_LIB_EXT=.lib
90!endif
91
92# Define the files to be removed by `make clean'.
93# nmake expands macros when encountered, not when used,
94# so this must precede the !include statements.
95
96BEGINFILES=$(GLGENDIR)\ccf32.tr\
97 $(GLOBJDIR)\*.res $(GLOBJDIR)\*.ico\
98 $(BINDIR)\$(GSDLL).dll $(BINDIR)\$(GSCONSOLE).exe\
99 $(BINDIR)\setupgs.exe $(BINDIR)\uninstgs.exe\
100 $(BEGINFILES2)
101
102# Include the generic makefiles.
103#!include $(COMMONDIR)/pcdefs.mak
104#!include $(COMMONDIR)/generic.mak
105!include $(GLSRCDIR)\gs.mak
106!include $(GLSRCDIR)\lib.mak
107!include $(GLSRCDIR)\jpeg.mak
108# zlib.mak must precede libpng.mak
109!include $(GLSRCDIR)\zlib.mak
110!include $(GLSRCDIR)\libpng.mak
111!include $(GLSRCDIR)\jbig2.mak
112!include $(GLSRCDIR)\jasper.mak
113!include $(GLSRCDIR)\icclib.mak
114!include $(GLSRCDIR)\ijs.mak
115!include $(GLSRCDIR)\devs.mak
116!include $(GLSRCDIR)\contrib.mak
117
118# Define the compilation rule for Windows devices.
119# This requires GL*_ to be defined, so it has to come after lib.mak.
120GLCCWIN=$(CC_WX) $(CCWINFLAGS) $(I_)$(GLI_)$(_I) $(GLF_)
121
122!include $(GLSRCDIR)\winplat.mak
123!include $(GLSRCDIR)\pcwin.mak
124
125# Define abbreviations for the executable and DLL files.
126GS_OBJ=$(GLOBJ)$(GS)
127GSDLL_SRC=$(GLSRC)$(GSDLL)
128GSDLL_OBJ=$(GLOBJ)$(GSDLL)
129
130# -------------------------- Auxiliary files --------------------------- #
131
132# No special gconfig_.h is needed.	/* This file deliberately left blank. */
133$(gconfig__h): $(TOP_MAKEFILES)
134	$(ECHOGS_XE) -w $(gconfig__h) -x 2f2a20 This file deliberately left blank. -x 2a2f
135
136$(gconfigv_h): $(TOP_MAKEFILES) $(ECHOGS_XE)
137	$(ECHOGS_XE) -w $(gconfigv_h) -x 23 define USE_ASM -x 2028 -q $(USE_ASM)-0 -x 29
138	$(ECHOGS_XE) -a $(gconfigv_h) -x 23 define USE_FPU -x 2028 -q $(FPU_TYPE)-0 -x 29
139	$(ECHOGS_XE) -a $(gconfigv_h) -x 23 define EXTEND_NAMES 0$(EXTEND_NAMES)
140	$(ECHOGS_XE) -a $(gconfigv_h) -x 23 define SYSTEM_CONSTANTS_ARE_WRITABLE 0$(SYSTEM_CONSTANTS_ARE_WRITABLE)
141
142# -------------------------------- Library -------------------------------- #
143
144# The Windows Win32 platform
145
146mswin32__=$(GLOBJ)gp_mswin.$(OBJ) $(GLOBJ)gp_wgetv.$(OBJ) $(GLOBJ)gp_stdia.$(OBJ)
147mswin32_inc=$(GLD)nosync.dev $(GLD)winplat.dev
148
149$(GLGEN)mswin32_.dev:  $(mswin32__) $(ECHOGS_XE) $(mswin32_inc)
150	$(SETMOD) $(GLGEN)mswin32_ $(mswin32__)
151	$(ADDMOD) $(GLGEN)mswin32_ -include $(mswin32_inc)
152
153$(GLOBJ)gp_mswin.$(OBJ): $(GLSRC)gp_mswin.c $(AK) $(gp_mswin_h) \
154 $(ctype__h) $(dos__h) $(malloc__h) $(memory__h) $(pipe__h) \
155 $(stdio__h) $(string__h) $(windows__h) \
156 $(gx_h) $(gp_h) $(gpcheck_h) $(gpmisc_h) $(gserrors_h) $(gsexit_h)
157	$(GLCCWIN) $(GLO_)gp_mswin.$(OBJ) $(C_) $(GLSRC)gp_mswin.c
158
159$(GLOBJ)gp_wgetv.$(OBJ): $(GLSRC)gp_wgetv.c $(AK) $(gscdefs_h)
160	$(GLCCWIN) $(GLO_)gp_wgetv.$(OBJ) $(C_) $(GLSRC)gp_wgetv.c
161
162$(GLOBJ)gp_stdia.$(OBJ): $(GLSRC)gp_stdia.c $(AK)\
163  $(stdio__h) $(time__h) $(unistd__h) $(gx_h) $(gp_h)
164	$(GLCCWIN) $(GLO_)gp_stdia.$(OBJ) $(C_) $(GLSRC)gp_stdia.c
165
166# Define MS-Windows handles (file system) as a separable feature.
167
168mshandle_=$(GLOBJ)gp_mshdl.$(OBJ)
169$(GLD)mshandle.dev: $(ECHOGS_XE) $(mshandle_)
170	$(SETMOD) $(GLD)mshandle $(mshandle_)
171	$(ADDMOD) $(GLD)mshandle -iodev handle
172
173$(GLOBJ)gp_mshdl.$(OBJ): $(GLSRC)gp_mshdl.c $(AK)\
174 $(ctype__h) $(errno__h) $(stdio__h) $(string__h)\
175 $(gserror_h) $(gsmemory_h) $(gstypes_h) $(gxiodev_h)
176	$(GLCC) $(GLO_)gp_mshdl.$(OBJ) $(C_) $(GLSRC)gp_mshdl.c
177
178# Define MS-Windows printer (file system) as a separable feature.
179
180msprinter_=$(GLOBJ)gp_msprn.$(OBJ)
181$(GLD)msprinter.dev: $(ECHOGS_XE) $(msprinter_)
182	$(SETMOD) $(GLD)msprinter $(msprinter_)
183	$(ADDMOD) $(GLD)msprinter -iodev printer
184
185$(GLOBJ)gp_msprn.$(OBJ): $(GLSRC)gp_msprn.c $(AK)\
186 $(ctype__h) $(errno__h) $(stdio__h) $(string__h)\
187 $(gserror_h) $(gsmemory_h) $(gstypes_h) $(gxiodev_h)
188	$(GLCCWIN) $(GLO_)gp_msprn.$(OBJ) $(C_) $(GLSRC)gp_msprn.c
189
190# Define MS-Windows polling as a separable feature
191# because it is not needed by the gslib.
192mspoll_=$(GLOBJ)gp_mspol.$(OBJ)
193$(GLD)mspoll.dev: $(ECHOGS_XE) $(mspoll_)
194	$(SETMOD) $(GLD)mspoll $(mspoll_)
195
196$(GLOBJ)gp_mspol.$(OBJ): $(GLSRC)gp_mspol.c $(AK)\
197 $(gx_h) $(gp_h) $(gpcheck_h) $(iapi_h) $(iref_h) $(iminst_h) $(imain_h)
198	$(GLCCWIN) $(GLO_)gp_mspol.$(OBJ) $(C_) $(GLSRC)gp_mspol.c
199
200# end of winlib.mak
201