2 # $Id: makefile.win,v 1.14 2005/08/07 09:43:27 mikulik Exp $
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)
8 # Cd to the 'src' directory, and 'make -f ../config/makefile.win'
9 # To compile for win32, pass option '-DWIN32=1' to 'make'.
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.
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)
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.
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'.
27 # directory names, like for use with makefile.all:
33 # where to place wgnuplot.hlp helpfile
34 HELPFILE = wgnuplot.hlp
36 # location of Borland C compiler
39 # location of TLINK.EXE and BCC.EXE
42 #The full path name of the help compiler. For BC++:
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
49 # WIN32=1 for Win32s or Win32 (--> '95 or NT)
50 # new: allow '-DWIN32=1' on make command line to take effect:
55 # Uncomment _this_ for BC++ 4.52 (or others that give linker errors for
56 # the 'errno' variable)... :
57 #RUNTIME_LIBRARY=cw32.lib
59 # ... or this for more modern ones (like C++Builder 1.0) -- it's the
60 # properly multithreading one:
61 RUNTIME_LIBRARY=cw32mt.lib
65 # 32bit Windows compilation.
68 DEFINE_HELPFILE = -DHELPFILE=\"$(HELPFILE)\"
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 :-(
78 # 16bit Windows compiler
80 DEFINE_HELPFILE = -DHELPFILE="$(HELPFILE)"
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.
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
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
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
112 DLLOBJS = gpexecute.obj wgnuplib.obj wtext.obj wmenu.obj wpause.obj wgraph.obj wprinter.obj
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
132 all: wgnupl32.exe $(HELPFILE) wgnuplot.mnu $(M)bf_test.exe
134 all: wgnuplot.exe wgnuplot.dll $(HELPFILE) wgnuplot.mnu $(M)bf_test.exe
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 @&&!
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 +
147 fit matrix datafile alloc util3d hidden3d dynarray time +
148 ,wgnuplot,wgnuplot, +
155 $(BIN)brc -30 -k -i$(TC)\include win\wgnuplot.rc wgnuplot.exe
157 # gnuplot.opt contains a list of the 'core' files, in case that's of
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 @&&!
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 +
168 axis gadgets color getcolor pm3d mouse +
171 fit matrix datafile alloc util3d hidden3d dynarray time +
172 save unset variable tables +
173 ,wgnupl32,wgnupl32, +
175 $(TC)\lib\$(RUNTIME_LIBRARY), +
176 win\wgnupl32.def, wgnupl32.res
179 wgnupl32.res: win\wgnuplot.rc win\wgnuplib.rc
180 $(BIN)brcc32 -DWIN32 -i$(TC)\include -r -fowgnupl32 win\wgnuplot.rc
191 bitmap.obj: bitmap.c bitmap.h plot.h
193 command.obj: command.c plot.h setshow.h fit.h
194 $(BIN)$(CC) $(DEFINE_HELPFILE) @&&!
198 contour.obj: contour.c plot.h
200 eval.obj: eval.c plot.h
202 graphics.obj: graphics.c plot.h setshow.h
204 graph3d.obj: graphics.c plot.h setshow.h
206 fit.obj: fit.c fit.h matrix.h plot.h
208 matrix.obj: matrix.c matrix.h fit.h
210 internal.obj: internal.c plot.h
212 misc.obj: misc.c plot.h setshow.h
214 parse.obj: parse.c plot.h
219 plot.obj: plot.c plot.h setshow.h
224 hidden3d.obj: hidden3d.c plot.h setshow.h
226 plot3d.obj: plot3d.c plot.h setshow.h
228 plot2d.obj: plot2d.c plot.h setshow.h
230 readline.obj: readline.c plot.h
232 scanner.obj: scanner.c plot.h
234 set.obj: set.c plot.h setshow.h
236 show.obj: show.c plot.h setshow.h
237 $(BIN)$(CC) $(DEFINE_HELPFILE) @&&!
241 specfun.obj: specfun.c
243 standard.obj: standard.c plot.h
245 stdfn.obj: stdfn.c stdfn.h
247 interpol.obj: interpol.c plot.h setshow.h
249 term.obj: term.c term.h plot.h set.c show.c bitmap.h $(CSOURCE5) $(CSOURCE6) $(CSOURCE7) win\wgnuplib.h
252 ! $(TERMFLAGS) -I$(T) -I. term.c
254 util.obj: util.c plot.h
256 util3d.obj: util3d.c plot.h setshow.h
258 variable.obj: variable.c plot.h variable.h
260 version.obj: version.c
262 winmain.obj: win\winmain.c win\wgnuplib.h win\wtext.h plot.h
263 $(BIN)$(CC) $(DEFINE_HELPFILE) @&&!
267 wgnuplot.mnu: win\wgnuplot.mnu
268 copy win\wgnuplot.mnu wgnuplot.mnu
271 # different compiler options for DLL's */
273 DLLCC = $(BIN)$(CC) -DWIN32 -c -M -y -v -WE -I$(TC)\include -Iwin -DPROTOTYPES -DUSE_MOUSE=1 -DWIN_IPC -DHAVE_STRINGIZE
275 DLLCC = $(BIN)$(CC) -c -WD -ms! -w-par -f -M -y -v -w -N -I$(TC)\include -Iwin
278 wgnuplot.lib: wgnuplot.dll
279 $(BIN)implib wgnuplot.lib wgnuplot.dll
281 wgnuplot.dll: $(DLLOBJS) win/wgnuplib.def win/wgnuplib.rc
282 $(BIN)tlink /c /n /Twd /L$(TC)\lib /m /s /v /l @&&!
284 wgnuplib wtext wmenu wpause wgraph wprinter, +
290 $(BIN)brc -30 -i$(TC)\include -t win\wgnuplib.rc wgnuplot.dll
292 wgnuplib.obj: win/wgnuplib.c win/wgnuplib.h win/wcommon.h win/wresourc.h
293 $(DLLCC) win/wgnuplib.c
295 wmenu.obj: win/wmenu.c win/wgnuplib.h win/wcommon.h win/wresourc.h
298 wtext.obj: win/wtext.c win/wgnuplib.h win/wcommon.h win/wresourc.h
301 wpause.obj: win/wpause.c win/wgnuplib.h win/wcommon.h win/wresourc.h
302 $(DLLCC) win/wpause.c
304 wprinter.obj: win/wprinter.c win/wgnuplib.h win/wcommon.h win/wresourc.h
305 $(DLLCC) win/wprinter.c
307 wgraph.obj: win/wgraph.c win/wgnuplib.h win/wcommon.h win/wresourc.h
308 $(DLLCC) win/wgraph.c
310 # convert gnuplot.doc to gnuplot.rtf
311 $(HELPFILE): win\gnuplot.rtf
312 $(HC) win\wgnuplot.hpj
313 -copy win\wgnuplot.hlp $(HELPFILE)
315 win\gnuplot.rtf: doc2rtf.exe $(D)gnuplot.doc win\wgnuplot.hpj
316 doc2rtf $(D)gnuplot.doc win\gnuplot.rtf
318 doc2rtf.exe: $(D)doc2rtf.c $(D)termdoc.c $(D)xref.c $(CSOURCE5) $(CSOURCE6) $(CSOURCE7)
319 $(BIN)$(CC) -edoc2rtf.exe @&&!
324 ! $(D)doc2rtf.c $(D)termdoc.c $(D)xref.c
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 @&&!
331 ! bf_test.c dbinary.obj dalloc.obj
339 ! -odalloc.obj alloc.c
341 dbinary.obj: binary.c
344 ! -odbinary.obj binary.c
346 # clean up temporary files
370 -attrib -h wgnuplot.gid