1 # Hello, emacs: this is a -*- Makefile -*-
2 # $Id: makefile.oww,v 1.8.2.1 2006/10/22 12:10:31 broeker Exp $
4 # GNUPLOT Makefile OpenWatcom 1.3 on Win32
8 # wmake -f ..\config\makefile.oww
9 # or copy this file to ..\src, edit it to your liking, then
11 # wmake -f makefile.oww
13 # History of this file:
14 # 2004-02-23: Created by massive editing of makefile.nt (and config.nt)
15 # 2004-04-25: Removed all remaining MS-isms (by peeking at how OW's
16 # MS namesake replacement tools generate their command lines)
19 # where to place gnuplot.gih helpfile
20 # NOTE: compiled-in location governed by config.oww!
21 HELPFILE = wgnuplot.hlp
26 # The Microsoft Help compiler:
27 HCW = "c:\program files\help workshop\hcw.exe"
29 # OpenWatcom programs:
35 # Speed up compilation a bit by running the compiler as a DLL from
39 ! loaddll wccaxp wccdaxp
40 ! loaddll wcc386 wccd386
42 ! loaddll wppaxp wppdaxp
43 ! loaddll wpp386 wppd386
48 # Where to install the PostScript prologue files, relatively to the executable
50 GNUPLOT_PS_DIR = share/PostScript
58 CPPFLAGS = -D_Windows -DHAVE_CONFIG_H -DUSE_MOUSE -DEAM_OBJECTS
59 # library-dependent ones may have to be added, like:
60 # -DHAVE_LIBPNG -DHAVE_LIBPDF
63 # compiler flags, determined from MS ones by OW's "cl /showwopts"
66 # -I : add directory to include search path
67 # -zq : don't show a version banner message
68 # -5r : P5-optimized, 386-compatible code, register calling convention
69 # -zm : put each function in its own section to improve dead code elimination
70 # -bm : target multi-threaded environment
71 # -sg : grow the stack if needed
72 # -zlf: store library usage in .obj files
73 # -ei : force sizeof(enum) >= sizeof(int)
74 # -o : optimization options:
75 # r: reorder for pipelining
76 # i: inline intrinsics
77 # l: loop optimizations
78 # t: optimize for speed
80 # -aa : allow non-const initializers for locals
81 # -d2 : debug information
82 WCFLAGS = -zlf -ei -zq -I. -zm -bm -5r -sg -orilt -j -za99 -aa -d2 $(CPPFLAGS)
85 # paths for external libs added here...
88 # see other terminal defines in term.h
89 TERMFLAGS = -DGNUPLOT_PS_DIR="$(GNUPLOT_PS_DIR)" -I..\term
91 # macros for makefile.all
97 BINARYFILES=$(M)binary1 $(M)binary2 $(M)binary3
99 # Note: like makefile.wc, this need the special Watcom-style version of
100 # makefile.all, because line continuation in WMake is different...
101 !INCLUDE makefile.awc
103 default: wgnuplot.exe $(HELPFILE) wgnuplot.mnu &
104 $(BINARYFILES) pgnuplot.exe .SYMBOLIC
106 OBJS = $(COREOBJS) version.obj
108 WINOBJS = winmain.obj wgnuplib.obj wgraph.obj wprinter.obj wtext.obj &
109 wpause.obj wmenu.obj gpexecute.obj
114 $(WCC) $(WCFLAGS) $*.c
116 $(OBJS): config.h .AUTODEPEND
118 # file-specific rules
119 config.h: ..\config\config.oww
120 copy ..\config\config.oww config.h
122 wgnuplot.exe: $(OBJS) $(WINOBJS) wgnuplot.res texticon.ico grpicon.ico
123 $(WLD) @<<linkopt1.oww $(LDLIBS)
132 LIBRARY kernel32.lib,user32.lib,gdi32.lib,winspool.lib,comdlg32.lib
133 LIBRARY advapi32.lib,shell32.lib
138 OPTION resource=wgnuplot.res
141 OPTION START=_wstart_
144 # NOTE: Unknown what /l 0x409 does in MS RC call --- seems to work without, though
145 wgnuplot.res : win\wgnuplot.rc win\wgnuplib.rc &
146 win\wresourc.h texticon.ico grpicon.ico
147 $(WRC) -r -q -bt=nt -fowgnuplot.res -i=win &
148 -d_WIN32 -dNDEBUG -dWIN32 -dMSRC win\wgnuplot.rc
150 term.obj: term.c term.h plot.h setshow.h bitmap.h $(CORETERM)
151 $(WCC) $(WCFLAGS) $(TERMFLAGS) term.c
153 winmain.obj: win\winmain.c win\wgnuplib.h win\wtext.h plot.h
154 $(WCC) $(WCFLAGS) win\winmain.c
156 wgnuplib.obj: win\wgnuplib.c .AUTODEPEND
157 $(WCC) $(WCFLAGS) win\wgnuplib.c
159 wmenu.obj: win\wmenu.c .AUTODEPEND
160 $(WCC) $(WCFLAGS) win\wmenu.c
162 wtext.obj: win\wtext.c .AUTODEPEND
163 $(WCC) $(WCFLAGS) win\wtext.c
165 wpause.obj: win\wpause.c .AUTODEPEND
166 $(WCC) $(WCFLAGS) win\wpause.c
168 wprinter.obj: win\wprinter.c .AUTODEPEND
169 $(WCC) $(WCFLAGS) win\wprinter.c
171 wgraph.obj: win\wgraph.c .AUTODEPEND .AUTODEPEND
172 $(WCC) $(WCFLAGS) win\wgraph.c
174 wgnuplot.mnu: win\wgnuplot.mnu
175 copy win\wgnuplot.mnu wgnuplot.mnu
177 pgnuplot.exe: win\pgnuplot.c version.obj .AUTODEPEND
178 $(WCL) -5r -zq -d2 -fm win\pgnuplot.c -fe=pgnuplot.exe -I. &
179 version.obj user32.lib
182 # extract icons from wgnuplot.rc
183 texticon.ico: geticon.exe win\wgnuplot.rc
184 geticon win\wgnuplot.rc
186 grpicon.ico: geticon.exe win\wgnuplot.rc
187 geticon win\wgnuplot.rc
189 geticon.exe: win\geticon.c
190 $(WCL) -zq -bt=nt -fe=geticon.exe win\geticon.c
192 # convert gnuplot.doc to gnuplot.rtf
193 $(HELPFILE): doc2rtf.exe $(D)gnuplot.doc win\wgnuplot.hpj
194 doc2rtf $(D)gnuplot.doc win\gnuplot.rtf
195 $(HCW) /c /e win\wgnuplot.hpj
196 if exist win\wgnuplot.hlp copy win\wgnuplot.hlp .
198 doc2rtf.exe: $(D)doc2rtf.c $(D)termdoc.c $(D)xref.c config.h
199 $(WCL) $(WCFLAGS) -w1 -DWINDOWS_NO_GUI /I..\docs;..\term -fedoc2rtf.exe $(D)doc2rtf.c $(D)termdoc.c $(D)xref.c
201 #make binary demo files
202 bf_test.exe : bf_test.c dbinary.obj alloc.obj
203 $(WCL) $(WCFLAGS) -w1 -DWINDOWS_NO_GUI -febf_test.exe bf_test.c dbinary.obj alloc.obj
205 $(BINARYFILES): bf_test.exe
209 # _Windows causes wtext.h to define fread() etc
210 dbinary.obj: binary.c
211 $(WCC) $(WCFLAGS) /U_Windows -w1 -fodbinary.obj binary.c
213 # clean up temporary files
215 rm -f *.obj *.err *.ico
216 rm -f wgnuplot.res win\gnuplot.rtf win\wgnuplot.hlp
217 rm -f bf_test.exe linkopt1.oww doc2rtf.exe geticon.exe
218 rm -f wgnuplot.map wgnuplot.sym pgnuplot.map wgnuplot.gid
221 realclean: clean .SYMBOLIC
222 rm -f wgnuplot.exe wgnuplot.hlp wgnuplot.mnu pgnuplot.exe
223 rm -f ..\demo\binary[123] ..\demo\fit.log ..\demo\soundfit.par