~ubuntu-branches/ubuntu/karmic/fltk1.1/karmic

« back to all changes in this revision

Viewing changes to watcom.mif

  • Committer: Bazaar Package Importer
  • Author(s): Aaron M. Ucko
  • Date: 2005-05-22 13:57:06 UTC
  • mfrom: (2.1.1 hoary)
  • Revision ID: james.westby@ubuntu.com-20050522135706-mchag24yf42lu7bu
Tags: 1.1.6-5
* Revert previous change, which seems to have been ineffective for some
  reason, in favor of commenting out the problematic Makefile rule
  altogether.  (Closes: #310151.)
* debian/control: Go back to specifying the URL as part of the
  description rather than via a non-standard field that doesn't seem to
  have caught on.  (Closes: #310240.)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
######################################################################
 
2
#
 
3
#  Watcom C specific makefile, multiplatform
 
4
#
 
5
#
 
6
#  The following macross must be set active when this file is called
 
7
#  -D parameter, e.g. -DPROJ=fltk
 
8
#  ROOT   = root of project (e.g. FLTK directory)
 
9
#  PROJ   = project name (e.g. fltk)
 
10
#
 
11
#  The following environment variable must be set. If you have multiple
 
12
#  Watcom versions, use the setvars file in the Watcom directory to set it.
 
13
#  WATCOM = root of Watcom C
 
14
######################################################################
 
15
 
 
16
#
 
17
# The following options must be set when calling this wmake file
 
18
# (case-sensitive):
 
19
# D (debug/release mode): d for debug mode,
 
20
#                         r for release mode
 
21
# O (target environment): d = DOS 32 bits
 
22
#                         o = OS/2 32 bits
 
23
#                         w = Windows 32 bit
 
24
#                         l = Linux Intel (experimental, no graphics yet (OW 1.3))
 
25
#
 
26
#
 
27
# If not set, debug mode and target=host (that is, no cross-compiling).
 
28
# Example: wmake -h -f makefile.wat d=r o=w
 
29
#
 
30
# Following macros can be used to add/override existing macros in
 
31
# this file.
 
32
# EXTRA_INCLUDE_DIRS        # Non-Watcom (project) include dirs
 
33
# ODIR                      # Output directory if not default
 
34
# ROOT                      # Project root. If not given, .
 
35
# PROJ                      # Project name.
 
36
# LIBS                      # Extra libs to link in
 
37
# LIBDIR                    # Project library directory. Default: PROJ\LIB
 
38
# LIBNAMEROOT               # Project rootname of output library. Default: PROJ\Lib\Proj
 
39
# EXTRA_LIBS                # Target specific include libs
 
40
 
 
41
!ifndef D
 
42
MODE=d                      # default is debug mode
 
43
!else
 
44
!  ifeq D d
 
45
MODE=d
 
46
!  else ifeq D r
 
47
MODE=r
 
48
!  else
 
49
CONFIG_ERROR_MSG=Unrecognized mode: $(D)
 
50
!  endif
 
51
!endif
 
52
 
 
53
# If target is specified, check its validity; if not specified, the target is
 
54
# the host platform itself.
 
55
 
 
56
!ifdef O
 
57
!  ifeq O d
 
58
TARGET=dos
 
59
!  else ifeq O o
 
60
TARGET=os2
 
61
!  else ifeq O w
 
62
TARGET=nt
 
63
!  else ifeq O l
 
64
TARGET=linux
 
65
!  else
 
66
CONFIG_ERROR_MSG=Unrecognized target: $(O)
 
67
!  endif
 
68
!else
 
69
!  ifdef __DOS__
 
70
TARGET=dos
 
71
!  else ifdef __OS2__
 
72
TARGET=os2
 
73
!  else ifdef __NT__
 
74
TARGET=nt
 
75
!  else ifdef __LINUX__
 
76
TARGET=linux
 
77
!  endif
 
78
!endif
 
79
 
 
80
#
 
81
# Now we know the target. Determine the link target. For fltk, this
 
82
# is always GUI for Windows and OS/2. For possible link targets (aliases
 
83
# for a set of linker directives) see wlsystem.lnk in Watcom's BINW directory.
 
84
#
 
85
!ifeq TARGET dos
 
86
LINKTARGET=dos32a
 
87
!else ifeq TARGET os2
 
88
LINKTARGET=os2v2_pm
 
89
!else ifeq TARGET nt
 
90
LINKTARGET=nt_win
 
91
!else
 
92
LINKTARGET=linux
 
93
!endif
 
94
 
 
95
#
 
96
# Very important: specify the sequence of extensions. Wmake will try to make a target
 
97
# with an extension from the first file of the same name with an extension to the right.
 
98
# E.g. it tries to make hello.obj from hello.cxx, or hello.cpp etc, but never from hello.exe
 
99
#
 
100
.EXTENSIONS :
 
101
.EXTENSIONS : .exe .lib .obj .cxx .cpp .c .h .fl
 
102
 
 
103
#
 
104
# Create output directory name if not already supplied. To allow
 
105
# cross-development, must include target name.
 
106
#
 
107
!ifndef ODIR
 
108
ODIR=$(D)_$(TARGET)
 
109
!endif
 
110
 
 
111
#
 
112
# Contruct the libname from the root plus D and O macros, so that
 
113
# multiple LIBS can co-exists, e.g. FLTK_DW and FLTK_RW for Win32.
 
114
#
 
115
!ifndef LIBDIR
 
116
LIBDIR=$(ROOT)\lib\
 
117
!endif
 
118
!ifndef LIBNAMEROOT
 
119
LIBNAMEROOT=$(PROJ)
 
120
!endif
 
121
!ifndef LIBNAME
 
122
LIBNAME = $(LIBDIR)$(LIBNAMEROOT)_$(D)$(O).lib
 
123
# FLTK has other 'global' libs. Define the names here so that any application
 
124
# using FLTK can use them by just including this mif file.
 
125
LIBNAMEFL = $(LIBDIR)$(LIBNAMEROOT)_fl_$(D)$(O).lib
 
126
LIBNAMEGL = $(LIBDIR)$(LIBNAMEROOT)_gl_$(D)$(O).lib
 
127
LIBNAMEIMG = $(LIBDIR)$(LIBNAMEROOT)_img_$(D)$(O).lib
 
128
LIBS = $(LIBNAME) $(LIBNAMEFL) $(LIBNAMEGL) $(LIBNAMEIMG)
 
129
!endif
 
130
 
 
131
# Set target environment options for the project
 
132
 
 
133
!ifeqi TARGET  nt                   # WINDOWS 32 bit
 
134
SYSDEF= -DWIN32
 
135
ASYSDEF=
 
136
SYSLIBS=wsock32.lib mpr.lib glu32.lib opengl32.lib
 
137
EXEEXT=.exe
 
138
 
 
139
!else ifeqi TARGET linux            # Linux Intel 32 bit generic
 
140
SYSDEF=
 
141
ASYSDEF=
 
142
EXEEXT=.exe                         # We need some exe extension else the build won't work
 
143
 
 
144
!else ifeqi TARGET os2              # OS/2 32 bit
 
145
SYSDEF=
 
146
ASYSDEF=
 
147
EXEEXT=.exe
 
148
 
 
149
!else ifeqi TARGET dos              # DOS 32 bit
 
150
SYSDEF=
 
151
ASYSDEF=
 
152
EXEEXT=.exe
 
153
 
 
154
!endif
 
155
 
 
156
 
 
157
######################################################################
 
158
#
 
159
# End of compiler- and environment specific options
 
160
#
 
161
# Note !message will print before any actions ('PRE'processor!), and thus
 
162
#      will not reflect results of any rules (like set xxx=yyy).
 
163
#      echo is a rule itself, and will reflect results of preceding rules.
 
164
#
 
165
######################################################################
 
166
 
 
167
.BEFORE :
 
168
!ifdef CONFIG_ERROR_MSG
 
169
!   message
 
170
!   message Configuration error:
 
171
!   message $(CONFIG_ERROR_MSG)
 
172
!   message
 
173
    %abort
 
174
!endif
 
175
    @if not exist $(ODIR) mkdir $(ODIR) >nul
 
176
!ifeqi TARGET dos
 
177
   @set INCLUDE=$(%WATCOM)\H;$(EXTRA_INCLUDE_DIRS)
 
178
!else ifeqi TARGET os2
 
179
   @set INCLUDE=$(%WATCOM)\H;$(%WATCOM)\H\OS2;$(EXTRA_INCLUDE_DIRS)
 
180
!else ifeqi TARGET nt
 
181
   @set INCLUDE=$(%WATCOM)\H;$(%WATCOM)\H\NT;$(EXTRA_INCLUDE_DIRS)
 
182
!else ifeqi TARGET linux
 
183
   @set INCLUDE=$(%WATCOM)\LH;$(EXTRA_INCLUDE_DIRS)
 
184
!endif
 
185
 
 
186
#    @set LIB=$(LIBPATH)
 
187
#    @echo Top dir: $(PROJ)
 
188
    @echo Include dirs: $(%INCLUDE)
 
189
#    @echo Lib dirs: $(LIBDIRS)
 
190
#    @echo Libname=$(LIBNAME)
 
191
#    @echo extra libs: $(LIBS)
 
192
#    @echo Wmake version $(__VERSION__)
 
193
#    @echo Wmake parameters: $(__MAKEOPTS__)
 
194
#    @echo Compiler : $(CC) $(CCOPTS0) $(CCOPTS1) $(CCOPTS2) $(CCOPTS3)
 
195
#    @echo Librarian: $(LIB)
 
196
#    @echo Linker   : $(LN) $(LNOPTS)
 
197
#    @echo Project  : $(P)
 
198
 
 
199
!ifeqi D d
 
200
WCADEBUG=-d1                        # debug opts for wasm
 
201
WCCDEBUG=-d2 -s -ors                # debug opts for wcc. NOTE: -we is to make errors of all warnings
 
202
WCLDEBUG=d all                      # debug opts for wlink
 
203
# WCCTIMING=-et         # if added to CC command line will generate timing file after execution
 
204
!else
 
205
#
 
206
# WCADEBUG=                                    # debug opts for wasm
 
207
WCCDEBUG= -ors -s                              # release opts for wcc
 
208
# WCLDEBUG=                                    # release opts for wlink
 
209
!endif
 
210
 
 
211
#       Conventions Watcom
 
212
 
 
213
# Tell default paths based on extension
 
214
.fl             : .
 
215
.h              : .
 
216
#.lib            : .
 
217
.c              : .
 
218
.cpp            : .
 
219
.cxx            : .
 
220
.obj            : $(ODIR)
 
221
.exe            : $(ODIR)
 
222
 
 
223
#
 
224
# Tell wmake to use DLL versions of some commands (much quicker)
 
225
#
 
226
!loaddll wcc386 wccd386
 
227
!loaddll wpp386 wppd386
 
228
!loaddll wlink  wlink
 
229
!loaddll wlib   wlibd
 
230
 
 
231
CCOPTS0=-6r -zq
 
232
CCOPTS1=$(WCCDEBUG) -bt=$(TARGET) -fp6 -fpi87 # 1st part of Watcom opts
 
233
CCOPTS2=-mf -wce=130 -wx -zq                  # -j # 2nd part of Watcom opts
 
234
CCOPTS3=-fo$(ODIR)\$^&.obj                    # 3rd part Watcom opts
 
235
COPTS=-zm
 
236
CPPOPTS=-zmf -zv -fx
 
237
 
 
238
LNOPTS=sys $(LINKTARGET) $(WCLDEBUG) op symf,q,m,el,vfr op st=32k # linker options
 
239
LIBOPTS= -b -q -p=512 -c                     # librarian options
 
240
LN=wlink                                     # Watcom linker
 
241
AS=wasm                                      # Watcom assembler
 
242
cc=wcc386                                    # Watcom C compiler
 
243
cpp=wpp386                                   # Watcom C++ compiler
 
244
LIB=wlib                                     # Watcom librarian
 
245
 
 
246
#
 
247
# Compilation
 
248
#
 
249
.c.obj: .AUTODEPEND
 
250
    $(CC) $(SYSDEF) $(DEBUGDEF) $(CCOPTS0) $(CCOPTS1) $(CCOPTS2) $(CCOPTS3) $(COPTS) $[@
 
251
 
 
252
.cpp.obj: .AUTODEPEND
 
253
    $(CPP) $(SYSDEF) $(DEBUGDEF) $(CCOPTS0) $(CCOPTS1) $(CCOPTS2) $(CCOPTS3) $(CPPOPTS) $[@
 
254
 
 
255
.cxx.obj: .AUTODEPEND
 
256
    $(CPP) $(SYSDEF) $(DEBUGDEF) $(CCOPTS0) $(CCOPTS1) $(CCOPTS2) $(CCOPTS3) $(CPPOPTS) $[@
 
257
 
 
258
#
 
259
# Librarian stage
 
260
#
 
261
.obj.lib:
 
262
    $(LIB) $(LIBOPTS) $@ $<
 
263
 
 
264
#
 
265
# Linking stage. This implicit rule assumes the .exe is created from an object file with the
 
266
# same name, plus other object in macro OBJECTS, a number of .libs in macro LIBS etc.
 
267
# If the linking fails for some reason, the .lk1 file is not deleted and it can be
 
268
# examined.
 
269
#
 
270
.obj.exe:
 
271
    @%create $^*.lk1
 
272
    @%append $^*.lk1 F $(ODIR)/$^&
 
273
    @for %i in ($(%OBJS)) do @%append $^*.lk1 F $(ODIR)/%i
 
274
    @for %i in ($(OBJECTS)) do @%append $^*.lk1 F $(ODIR)/%i
 
275
    @for %i in ($(LIBS)) do @%append $^*.lk1 L %i
 
276
    @for %i in ($(EXTRA_LIBS)) do @%append $^*.lk1 L %i
 
277
    @for %i in ($(SYSLIBS)) do @%append $^*.lk1 L %i
 
278
    $(LN) $(LNOPTS) name $^@ op map=$^* @$^*.lk1
 
279
    @del $^*.lk1