Initial release of Maemo 5 port of gnuplot
[gnuplot] / config / makefile.win
1 #
2 # $Id: makefile.win,v 1.14 2005/08/07 09:43:27 mikulik Exp $
3 #
4 # GNUPLOT Makefile for Borland C++ 3.1 Windows version
5 # and Win32 using Borland C++ 4 (or 5? --- 4.52 is known to work)
6 # or Borland C++ Builder 1 (newer versions may work as well)
7 #
8 # Cd to the 'src' directory, and 'make -f ../config/makefile.win'
9 # To compile for win32, pass option '-DWIN32=1' to 'make'.
10 #
11 # This makefile may need some editing before it can be used. Check
12 # BCC installation path, the WIN32 and RUNTIME_LIB flags, in particular.
13 #
14 # The compile and link includes debug flags.  Take them out if you
15 # do not want them included  (-y -v -M, /m /s /v /l)
16 #
17 # New 991003: WIN32=1 build makes the helpers (doc2rtf, bf_test) as Win32
18 #             console applications, instead of plain DOS programs. This
19 #             way, it also works with those compilers missing a DOS option.
20 #
21 # CAVEAT for the 16bit Windows (BC 3.1) version:
22 # You will also need to edit term.h to not include some of the
23 # terminal types which you are not going to use, otherwise you will get a
24 # message about too much global data defined in term.c. A working example
25 # is 'config/term_pc.h'.
26
27 # directory names, like for use with makefile.all:
28 T=..\\term\\
29 D=..\\docs\\
30 M=..\\demo\\
31
32
33 # where to place wgnuplot.hlp helpfile
34 HELPFILE = wgnuplot.hlp
35
36 # location of Borland C compiler
37 TC = e:\borl\cbuilder
38
39 # location of TLINK.EXE and BCC.EXE
40 BIN = $(TC)\bin\\
41
42 #The full path name of the help compiler. For BC++:
43 #HC = $(BIN)\hc
44 # this comes with C++ Builder 1.0 (but doesn't seem to work):
45 #HC = $(TC)\help\tools\hcw /c /e
46 # or you can use the 'help workshop' available directly from MS:
47 HC = h:\mssdk\bin\hcw /c/e
48
49 # WIN32=1 for Win32s or Win32 (--> '95 or NT)
50 # new: allow '-DWIN32=1' on make command line to take effect:
51 !if "$(WIN32)"==""
52 WIN32=0
53 !endif
54
55 # Uncomment _this_ for BC++ 4.52 (or others that give linker errors for
56 # the 'errno' variable)... :
57 #RUNTIME_LIBRARY=cw32.lib
58
59 # ... or this for more modern ones (like C++Builder 1.0) -- it's the
60 # properly multithreading one:
61 RUNTIME_LIBRARY=cw32mt.lib
62
63 !if $(WIN32)
64
65 # 32bit Windows compilation.
66 CC = bcc32
67 PROCESSOR_OPT =
68 DEFINE_HELPFILE = -DHELPFILE=\"$(HELPFILE)\"
69
70 # For BC++ 4.52, you may try this version with Pentium scheduling
71 # optimization. NB: bcc32a in 4.52 increased in bugginess quite
72 # a bit more than in program speed :-(
73 #CC = bcc32a
74 #PROCESSOR_OPT = -5
75
76 !else
77
78 # 16bit Windows compiler
79 CC = bcc
80 DEFINE_HELPFILE = -DHELPFILE="$(HELPFILE)"
81
82 !endif
83
84 # -c means don't link
85 # -ml means use large model (large code, large data)
86 # -M means produce link map
87 # -y means include line numbers for debugger
88 # -v means include debug info
89 # -w- means ignore warnings and do not report them
90 # -w-rvl ignore function must return a value error
91 # -Ff=128 means make data object > 128 FAR
92 # -W means window application
93 # -DREADLINE to use the history/line editing capability. If you want this 
94 #    capability add -DREADLINE to CFLAGS then add 'readline' to the /o
95 #    section of the linker call.
96 !if $(WIN32)
97 CFLAGS = -c -W -M -G -y -v -w-rvl -w-use -w-par -w-aus -w-pro $(PROCESSOR_OPT) -I$(TC)\include -Iwin -DREADLINE=1 -DHAVE_STRNICMP -DWIN32 -DHAVE_STRERROR -DNO_GIH -DWIN32_LEAN_AND_MEAN -DPROTOTYPES -DHAVE_VFPRINTF -DHAVE_GETCWD -DHAVE_STPCPY -DUSE_MOUSE=1 -DWIN_IPC -DHAVE_STRINGIZE -DGP_MATHERR=_matherr -DGP_EXCEPTION=_exception -DHAVE_STRUCT_EXCEPTION_IN_MATH_H=1
98 CAUXFLAGS = -tWC -w-par -w-use -w-aus -f -N -M -y -v -d -I$(TC)\include -DWIN32 -DWINDOWS_NO_GUI -DHAVE_STRNICMP -DPROTOTYPES -DHAVE_STRINGIZE
99 !else
100 CFLAGS = -c -W -ml -w-par -w-use -w-aus -f -h -N -M -y -v -d -Ff=32 -I$(TC)\include -Iwin -DREADLINE=1 -zEGPFAR_DATA -DHAVE_STRNICMP -DMSDOS=1 -DNO_GIH -DPROTOTYPES -DHAVE_GETCWD -DHAVE_VFPRINTF -DNDEBUG -DHAVE_STRINGIZE
101 CAUXFLAGS = -ml -w-par -w-use -w-aus -f -N -M -y -v -d -I$(TC)\include -DMSDOS=1 -DHAVE_STRNICMP -DPROTOTYPES -DHAVE_VFPRINTF -DHAVE_STRINGIZE
102 !endif
103
104 OBJS =  alloc.obj axis.obj binary.obj bitmap.obj color.obj command.obj contour.obj datafile.obj \
105         dynarray.obj eval.obj fit.obj gadgets.obj getcolor.obj graphics.obj graph3d.obj help.obj \
106         hidden3d.obj history.obj internal.obj interpol.obj matrix.obj misc.obj mouse.obj parse.obj \
107         plot.obj plot2d.obj plot3d.obj pm3d.obj readline.obj save.obj scanner.obj \
108         set.obj show.obj specfun.obj standard.obj stdfn.obj tables.obj \
109         term.obj time.obj unset.obj util.obj util3d.obj variable.obj \
110         history.obj version.obj winmain.obj
111
112 DLLOBJS = gpexecute.obj wgnuplib.obj wtext.obj wmenu.obj wpause.obj wgraph.obj wprinter.obj
113
114 CSOURCE5 = $(T)aed.trm $(T)cgi.trm $(T)cgm.trm $(T)debug.trm \
115         $(T)dumb.trm $(T)dxy.trm \
116         $(T)eepic.trm $(T)epson.trm $(T)fig.trm $(T)hp26.trm \
117         $(T)hp2648.trm $(T)hpgl.trm $(T)hpljii.trm
118 CSOURCE6 = $(T)impcodes.h $(T)imagen.trm $(T)object.h \
119         $(T)iris4d.trm $(T)kyo.trm $(T)latex.trm $(T)pbm.trm $(T)win.trm
120 CSOURCE7 = $(T)post.trm $(T)qms.trm $(T)regis.trm $(T)sun.trm \
121         $(T)t410x.trm $(T)tek.trm $(T)unixpc.trm $(T)unixplot.trm \
122         $(T)v384.trm $(T)x11.trm
123 CSOURCE8 = contour.c specfun.c binary.c interpol.obj
124 WINDOWS = makefile.win makefile.msw README.win win\wcommon.h \
125         win\wgnuplib.c win\wgnuplib.def win\wgnuplib.h win\wgnuplib.rc\
126         win\wgnuplot.def win\wgnuplot.hpj win\wgnuplot.mnu win\wgnuplot.rc \
127         win\wgraph.c win\winmain.c win\wmenu.c win\wpause.c \
128         win\wprinter.c win\wresourc.h win\wtext.c win\wtext.h \
129         win\geticon.c $(D)doc2rtf.c $(T)win.trm win\wgnupl32.def
130
131 !if $(WIN32)
132 all: wgnupl32.exe $(HELPFILE) wgnuplot.mnu $(M)bf_test.exe
133 !else
134 all: wgnuplot.exe wgnuplot.dll $(HELPFILE) wgnuplot.mnu $(M)bf_test.exe
135 !endif
136
137 wgnuplot.exe: $(OBJS) win\wgnuplot.def win\wgnuplot.rc winmain.obj wgnuplot.lib
138 #       $(BIN)tlink /Twe /c @&&!
139         $(BIN)tlink /Twe /c /s /v /l @&&!
140 $(TC)\lib\C0Wl +
141 bitmap command eval graphics graph3d help internal misc parse +
142 plot plot2d plot3d scanner set show specfun standard stdfn term util version contour +
143 binary interpol variable +
144 axis gadgets color getcolor pm3d mouse +
145 winmain +
146 readline history +
147 fit matrix datafile alloc util3d hidden3d dynarray time +
148 ,wgnuplot,wgnuplot, +
149 wgnuplot.lib +
150 $(TC)\lib\import +
151 $(TC)\lib\mathwl +
152 $(TC)\lib\cwl, +
153 win\wgnuplot.def
154 !
155         $(BIN)brc -30 -k -i$(TC)\include win\wgnuplot.rc wgnuplot.exe
156
157 # gnuplot.opt contains a list of the 'core' files, in case that's of
158 # any use...
159
160 wgnupl32.exe: $(OBJS) $(DLLOBJS) win\wgnupl32.def wgnupl32.res winmain.obj
161 #       $(BIN)tlink32 /Tpe /c @&&!
162         $(BIN)tlink32 /Tpe /c /m /s /v @&&!
163 $(TC)\lib\C0W32 +
164 bitmap command eval graphics graph3d help internal misc parse +
165 plot plot2d plot3d scanner set show specfun standard stdfn term util version contour +
166 wgnuplib wtext wmenu wpause wgraph wprinter gpexecute +
167 binary interpol +
168 axis gadgets color getcolor pm3d mouse +
169 winmain +
170 readline history +
171 fit matrix datafile alloc util3d hidden3d dynarray time +
172 save unset variable tables +
173 ,wgnupl32,wgnupl32, +
174 $(TC)\lib\import32 +
175 $(TC)\lib\$(RUNTIME_LIBRARY), +
176 win\wgnupl32.def, wgnupl32.res
177 !
178
179 wgnupl32.res: win\wgnuplot.rc win\wgnuplib.rc
180         $(BIN)brcc32 -DWIN32 -i$(TC)\include -r -fowgnupl32 win\wgnuplot.rc
181
182 # default rules
183
184 .c.obj:
185         $(BIN)$(CC) @&&!
186 $(CFLAGS)
187 ! $<
188
189 # rules
190
191 bitmap.obj: bitmap.c bitmap.h plot.h
192
193 command.obj: command.c plot.h setshow.h fit.h
194         $(BIN)$(CC) $(DEFINE_HELPFILE) @&&!
195 $(CFLAGS)
196 ! command.c
197
198 contour.obj: contour.c plot.h
199
200 eval.obj: eval.c plot.h
201
202 graphics.obj: graphics.c plot.h setshow.h
203
204 graph3d.obj: graphics.c plot.h setshow.h
205
206 fit.obj: fit.c fit.h matrix.h plot.h
207
208 matrix.obj: matrix.c matrix.h fit.h
209
210 internal.obj: internal.c plot.h
211
212 misc.obj: misc.c plot.h setshow.h 
213
214 parse.obj: parse.c plot.h
215         $(BIN)$(CC) @&&!
216 $(CFLAGS)
217 ! parse.c
218
219 plot.obj: plot.c plot.h setshow.h
220         $(BIN)$(CC) @&&!
221 $(CFLAGS)
222 ! plot.c
223
224 hidden3d.obj: hidden3d.c plot.h setshow.h
225
226 plot3d.obj: plot3d.c plot.h setshow.h
227
228 plot2d.obj: plot2d.c plot.h setshow.h
229
230 readline.obj: readline.c plot.h
231
232 scanner.obj: scanner.c plot.h
233
234 set.obj: set.c plot.h setshow.h
235
236 show.obj: show.c plot.h setshow.h
237         $(BIN)$(CC) $(DEFINE_HELPFILE) @&&!
238 $(CFLAGS)
239 ! show.c
240
241 specfun.obj: specfun.c
242
243 standard.obj: standard.c plot.h
244
245 stdfn.obj: stdfn.c stdfn.h
246
247 interpol.obj: interpol.c plot.h setshow.h
248
249 term.obj: term.c term.h plot.h set.c show.c bitmap.h $(CSOURCE5) $(CSOURCE6) $(CSOURCE7) win\wgnuplib.h
250         $(BIN)$(CC) @&&!
251 $(CFLAGS)
252 ! $(TERMFLAGS) -I$(T) -I. term.c
253
254 util.obj: util.c plot.h
255
256 util3d.obj: util3d.c plot.h setshow.h
257
258 variable.obj: variable.c plot.h variable.h
259
260 version.obj: version.c
261
262 winmain.obj: win\winmain.c win\wgnuplib.h win\wtext.h plot.h
263         $(BIN)$(CC) $(DEFINE_HELPFILE) @&&!
264 $(CFLAGS)
265 ! win\winmain.c
266
267 wgnuplot.mnu: win\wgnuplot.mnu
268         copy win\wgnuplot.mnu wgnuplot.mnu
269
270
271 # different compiler options for DLL's */
272 !if $(WIN32)
273 DLLCC = $(BIN)$(CC) -DWIN32 -c -M -y -v -WE -I$(TC)\include -Iwin -DPROTOTYPES -DUSE_MOUSE=1 -DWIN_IPC -DHAVE_STRINGIZE
274 !else
275 DLLCC = $(BIN)$(CC) -c -WD -ms! -w-par -f -M -y -v -w -N -I$(TC)\include -Iwin
276 !endif
277
278 wgnuplot.lib: wgnuplot.dll
279         $(BIN)implib wgnuplot.lib wgnuplot.dll
280
281 wgnuplot.dll: $(DLLOBJS) win/wgnuplib.def win/wgnuplib.rc
282         $(BIN)tlink /c /n /Twd /L$(TC)\lib /m /s /v /l @&&!
283 c0ds +
284 wgnuplib wtext wmenu wpause wgraph wprinter, +
285 wgnuplot.dll, +
286 wgnuplib.map, +
287 import mathws cws, +
288 win\wgnuplib.def
289 !
290         $(BIN)brc -30 -i$(TC)\include -t win\wgnuplib.rc wgnuplot.dll
291
292 wgnuplib.obj: win/wgnuplib.c win/wgnuplib.h win/wcommon.h win/wresourc.h
293         $(DLLCC) win/wgnuplib.c
294
295 wmenu.obj: win/wmenu.c win/wgnuplib.h win/wcommon.h win/wresourc.h
296         $(DLLCC) win/wmenu.c
297
298 wtext.obj: win/wtext.c win/wgnuplib.h win/wcommon.h win/wresourc.h
299         $(DLLCC) win/wtext.c
300
301 wpause.obj: win/wpause.c win/wgnuplib.h win/wcommon.h win/wresourc.h
302         $(DLLCC) win/wpause.c
303
304 wprinter.obj: win/wprinter.c win/wgnuplib.h win/wcommon.h win/wresourc.h
305         $(DLLCC) win/wprinter.c
306
307 wgraph.obj: win/wgraph.c win/wgnuplib.h win/wcommon.h win/wresourc.h
308         $(DLLCC) win/wgraph.c
309
310 # convert gnuplot.doc to gnuplot.rtf
311 $(HELPFILE): win\gnuplot.rtf
312         $(HC) win\wgnuplot.hpj 
313         -copy win\wgnuplot.hlp $(HELPFILE)
314
315 win\gnuplot.rtf: doc2rtf.exe $(D)gnuplot.doc win\wgnuplot.hpj
316         doc2rtf $(D)gnuplot.doc win\gnuplot.rtf
317
318 doc2rtf.exe: $(D)doc2rtf.c $(D)termdoc.c $(D)xref.c $(CSOURCE5) $(CSOURCE6) $(CSOURCE7)
319         $(BIN)$(CC) -edoc2rtf.exe @&&!
320 -D_Windows
321 -w-pro
322 $(CAUXFLAGS)
323 -I. -I$(T) -I$(D)
324 ! $(D)doc2rtf.c $(D)termdoc.c $(D)xref.c
325
326 # make binary demo files
327 $(M)bf_test.exe: bf_test.c dbinary.obj dalloc.obj
328         $(BIN)$(CC) -e$(M)bf_test.exe @&&!
329 -L$(TC)\lib
330 $(CAUXFLAGS)
331 ! bf_test.c dbinary.obj dalloc.obj
332         cd ..\demo
333         bf_test
334         cd ..\src
335
336 dalloc.obj: alloc.c
337         $(BIN)$(CC) -c @&&!
338 $(CAUXFLAGS)
339 ! -odalloc.obj alloc.c
340
341 dbinary.obj: binary.c
342         $(BIN)$(CC) -c @&&!
343 $(CAUXFLAGS)
344 ! -odbinary.obj binary.c
345
346 # clean up temporary files
347 clean:
348         del *.obj
349         del win\*.obj
350         del wgnuplot.map
351         del win\wgnuplot.res
352         del wgnupl32.map
353         del wgnupl32.res
354         del win\gnuplot.rtf
355         del doc2rtf.map
356         del doc2rtf.exe
357         del win\wgnuplib.res
358         del wgnuplib.map
359         del wgnuplot.lib
360         del bf_test.map
361         del $(M)bf_test.exe
362         del $(M)bf_test.map
363
364 realclean: veryclean
365
366 veryclean: clean
367         del wgnuplot.exe
368         del wgnuplot.hlp
369         del win\wgnuplot.hlp
370         -attrib -h wgnuplot.gid
371         del wgnuplot.gid
372         del wgnuplot.mnu
373         del wgnuplot.dll
374         del wgnupl32.exe
375         del $(M)binary1
376         del $(M)binary2
377         del $(M)binary3
378         del $(M)fit.log
379         del $(M)soundfit.par