Initial release of Maemo 5 port of gnuplot
[gnuplot] / config / makefile.oww
1 # Hello, emacs: this is a -*- Makefile -*-
2 # $Id: makefile.oww,v 1.8.2.1 2006/10/22 12:10:31 broeker Exp $
3 #
4 # GNUPLOT Makefile OpenWatcom 1.3 on Win32
5
6 # To compile:
7 #       Either, from ..\src:
8 #         wmake -f ..\config\makefile.oww
9 #       or copy this file to ..\src, edit it to your liking, then
10 #       from ..\src:
11 #         wmake -f makefile.oww
12
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)
17 #
18
19 # where to place gnuplot.gih helpfile
20 # NOTE: compiled-in location governed by config.oww!
21 HELPFILE = wgnuplot.hlp
22
23 TOP = .
24
25 # Programs: 
26 # The Microsoft Help compiler:
27 HCW = "c:\program files\help workshop\hcw.exe"
28
29 # OpenWatcom programs:
30 WCL = wcl386
31 WCC = wcc386
32 WLD = wlink
33 WRC = wrc
34
35 # Speed up compilation a bit by running the compiler as a DLL from
36 # inside wmake:
37 !ifdef __LOADDLL__
38 !  loaddll wcc      wccd
39 !  loaddll wccaxp   wccdaxp
40 !  loaddll wcc386   wccd386
41 !  loaddll wpp      wppdi86
42 !  loaddll wppaxp   wppdaxp
43 !  loaddll wpp386   wppd386
44 !  loaddll wlink    wlink
45 !  loaddll wlib     wlibd
46 !endif
47
48 # Where to install the PostScript prologue files, relatively to the executable
49 # wgnuplot.exe
50 GNUPLOT_PS_DIR = share/PostScript
51
52
53
54 # compiler flags: 
55 #
56 # Defines
57
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 
61
62
63 # compiler flags, determined from MS ones by OW's "cl /showwopts"
64
65 # -c  : don't link
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
79 # -j  : char is signed
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)
83
84
85 # paths for external libs added here... 
86 LDLIBS = 
87 # ...and here.
88 # see other terminal defines in term.h
89 TERMFLAGS = -DGNUPLOT_PS_DIR="$(GNUPLOT_PS_DIR)" -I..\term 
90
91 # macros for makefile.all
92 O=obj
93 T=..\term\
94 D=..\docs\
95 M=..\demo\
96
97 BINARYFILES=$(M)binary1 $(M)binary2 $(M)binary3
98
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
102
103 default: wgnuplot.exe $(HELPFILE) wgnuplot.mnu &
104          $(BINARYFILES) pgnuplot.exe .SYMBOLIC
105
106 OBJS = $(COREOBJS) version.obj
107
108 WINOBJS = winmain.obj wgnuplib.obj wgraph.obj wprinter.obj wtext.obj &
109         wpause.obj wmenu.obj gpexecute.obj
110
111
112 # default rule
113 .c.obj: .AUTODEPEND
114         $(WCC) $(WCFLAGS) $*.c
115
116 $(OBJS): config.h .AUTODEPEND
117
118 # file-specific rules
119 config.h: ..\config\config.oww
120         copy ..\config\config.oww config.h
121
122 wgnuplot.exe: $(OBJS) $(WINOBJS) wgnuplot.res texticon.ico grpicon.ico
123         $(WLD) @<<linkopt1.oww $(LDLIBS)
124 RUNTIME windows=4.0
125 SYSTEM nt_win
126 DEBUG ALL
127 OPTION quiet
128 FILE {
129  $(OBJS)
130  $(WINOBJS)
131 }
132 LIBRARY kernel32.lib,user32.lib,gdi32.lib,winspool.lib,comdlg32.lib
133 LIBRARY advapi32.lib,shell32.lib
134 OPTION map
135 OPTION SYMFILE
136 NAME wgnuplot.exe
137 OPTION stack=1M
138 OPTION resource=wgnuplot.res
139 OPTION ELIMINATE
140 REFERENCE _wstart_ 
141 OPTION START=_wstart_
142 <<
143
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
149
150 term.obj: term.c term.h plot.h setshow.h bitmap.h $(CORETERM)
151         $(WCC) $(WCFLAGS) $(TERMFLAGS) term.c
152
153 winmain.obj: win\winmain.c win\wgnuplib.h win\wtext.h plot.h
154         $(WCC) $(WCFLAGS) win\winmain.c
155
156 wgnuplib.obj: win\wgnuplib.c .AUTODEPEND
157         $(WCC) $(WCFLAGS) win\wgnuplib.c
158
159 wmenu.obj: win\wmenu.c .AUTODEPEND
160         $(WCC) $(WCFLAGS) win\wmenu.c
161
162 wtext.obj: win\wtext.c .AUTODEPEND
163         $(WCC) $(WCFLAGS) win\wtext.c
164
165 wpause.obj: win\wpause.c .AUTODEPEND
166         $(WCC) $(WCFLAGS) win\wpause.c
167
168 wprinter.obj: win\wprinter.c .AUTODEPEND
169         $(WCC) $(WCFLAGS) win\wprinter.c
170
171 wgraph.obj: win\wgraph.c .AUTODEPEND .AUTODEPEND
172         $(WCC) $(WCFLAGS) win\wgraph.c
173
174 wgnuplot.mnu: win\wgnuplot.mnu
175         copy win\wgnuplot.mnu wgnuplot.mnu
176
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
180
181
182 # extract icons from wgnuplot.rc
183 texticon.ico: geticon.exe win\wgnuplot.rc
184         geticon win\wgnuplot.rc
185
186 grpicon.ico: geticon.exe win\wgnuplot.rc
187         geticon win\wgnuplot.rc
188
189 geticon.exe: win\geticon.c
190         $(WCL) -zq -bt=nt -fe=geticon.exe win\geticon.c
191
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 .
197
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
200
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
204
205 $(BINARYFILES): bf_test.exe
206         .\bf_test
207         move binary? $(M).
208         
209 # _Windows causes wtext.h to define fread() etc
210 dbinary.obj: binary.c
211         $(WCC) $(WCFLAGS) /U_Windows -w1 -fodbinary.obj binary.c
212
213 # clean up temporary files
214 clean: .SYMBOLIC
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
219         
220
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
224         rm -f config.h