Initial release of Maemo 5 port of gnuplot
[gnuplot] / config / makefile.nt
1 #
2 # $Id: makefile.nt,v 1.20.2.1 2008/02/23 11:22:28 mikulik Exp $
3 #
4 # GNUPLOT Makefile Microsoft Visual C++ and nmake on WinNT and Win95/98/..
5
6 # John Bollinger bbands@yahoo.com, 4 March 2002:
7 #   Added png support with zlib and libpng as subs of .\src
8 #     libpng and zlib can be downloaded from ftp://ftp.uu.net/graphics/png
9 #   Added pdf support with pdflib as a sub of .\src
10 #     pdflib can be downloaded from http://www.pdflib.com
11 #   Added MSC multi-thread support for compatibility with pdflib
12 # Bastian Maerkisch bmaerkisch@web.de:
13 #   Added support for binary version of the GD library (bgd.dll) 
14 #     gdlib can be downloaded from http://www.boutell.com/gd
15 #   Removed zlib and libpng again as they're already included in bgd.dll
16
17 #
18 # To compile with Visual C: 
19 #       Download gdlib to ..\src\gdwin32
20 #       Download pdflib to ..\src\pdflib and compile it if you choose the source
21 #
22 #       Find and run VCVARS32.BAT (or maybe VSVARS32.BAT)
23 #       change to the gnuplot\src directory
24 #       Now run: 
25 #         nmake -f ..\config\makefile.nt
26 #       You can also do it like this: 
27 #         copy ..\config\makefile.nt makefile.nt
28 #         edit the copy to your liking
29 #         nmake -f makefile.nt
30
31 # where to place gnuplot.gih helpfile
32 HELPFILE = wgnuplot.hlp
33
34 # directory for PostScript prolog and associated files
35 GNUPLOT_PS_DIR = share\\PostScript
36
37 TOP = .
38
39 # /c  means don't link
40 # /I  means extra include directory
41 # /Fm means produce link map
42 # /Od means suppress optimizations (esp. for debug)
43 # /O2 mans optimize for speed
44 # /Zi mean prepare for codeview
45 # /G6 means optimize code for pentium pro
46 # /G5 means optimize code for pentium
47 # /G4 means optimize code for 486
48 # /G3 means optimize code for 386
49 # /MT means include multi-thread support
50 # /MD means include multi-thread support (DLL)
51
52 CC = cl /c
53 LD = link
54
55 # compiler flags
56 OPTIONS = /DUSE_MOUSE
57 OPTIONS = $(OPTIONS) /DHAVE_LIBGD /DHAVE_GD_GIF /DGIF_ANIMATION /DHAVE_GD_PNG /DHAVE_GD_JPEG /DHAVE_GD_TTF
58 OPTIONS = $(OPTIONS) /DHAVE_LIBPDF
59 OPTIONS = $(OPTIONS) /DGNUPLOT_HISTORY
60 CBASEFLAGS = /G5 /GX /GR /MD /O2 /nologo
61 CFLAGS = $(CBASEFLAGS) /I$(TOP) /D_Windows /DWIN32 /DHAVE_CONFIG_H /D__MSC__ /DHELPFILE=\"$(HELPFILE)\" $(OPTIONS)
62
63 !IF "$(PROCESSOR_ARCHITECTURE)" == "ALPHA"
64 MACHINE = $(PROCESSOR_ARCHITECTURE)
65 !ELSE
66 MACHINE = IX86
67 !ENDIF
68
69 # paths for external libs added here... 
70 LDFLAGS = /subsystem:windows /nologo /MACHINE:$(MACHINE) /MAP:GNUPLOT /libpath:..\src\pdflib\pdflib /libpath:..\src\gdwin32 
71
72 # ...and here.
73 # see other terminal defines in term.h
74 TERMFLAGS = /I..\\term /I..\\src\\pdflib\\pdflib /I..\\src\\gdwin32 /DGNUPLOT_PS_DIR=\"$(GNUPLOT_PS_DIR)\"
75
76 # macros for makefile.all
77 O=obj
78 T=..\\term\\
79 D=..\\docs\\
80 M=..\\demo\\
81
82 default: wgnuplot.exe $(HELPFILE) wgnuplot.mnu $(M)bf_test.exe pgnuplot.exe
83
84 !INCLUDE makefile.all
85
86 OBJS = $(COREOBJS) version.obj
87
88 WINOBJS = winmain.obj wgnuplib.obj wgraph.obj wprinter.obj wtext.obj \
89         wpause.obj wmenu.obj gpexecute.obj
90
91 WINDOWS = makefile.win makefile.nt README.win win\wcommon.h \
92         win\wgnuplib.c win\wgnuplib.def win\wgnuplib.h win\wgnuplib.rc \
93         win\wgnuplot.def win\wgnuplot.hpj win\wgnuplot.mnu win\wgraph.c \
94         win\winmain.c win\wmenu.c win\wpause.c win\wprinter.c \
95         win\wresourc.h win\wtext.c win\wtext.h win\geticon.c \
96         $(D)doc2rtf.c $(T)win.trm win\grpicon.ico win\texticon.ico
97
98 # default rules
99 .c.obj:
100         $(CC) $(CFLAGS) $*.c
101
102 $(OBJS): config.h
103
104 linkopt1.msw: makefile.nt
105         copy gnuplot.opt linkopt1.msw
106         echo winmain >> linkopt1.msw
107         echo gpexecute >> linkopt1.msw
108         echo readline >> linkopt1.msw
109         echo wgnuplib >> linkopt1.msw
110         echo wtext >> linkopt1.msw
111         echo wmenu >> linkopt1.msw
112         echo wpause >> linkopt1.msw
113         echo wgraph >> linkopt1.msw
114         echo wprinter >> linkopt1.msw
115         echo kernel32.lib >> linkopt1.msw
116         echo user32.lib >> linkopt1.msw
117         echo gdi32.lib >> linkopt1.msw
118         echo winspool.lib >> linkopt1.msw
119         echo comdlg32.lib >> linkopt1.msw
120         echo advapi32.lib >> linkopt1.msw
121         echo shell32.lib >> linkopt1.msw
122         echo pdflib.lib >> linkopt1.msw
123         echo bgd.lib >> linkopt1.msw
124         echo wgnuplot.res >> linkopt1.msw
125
126 makefile.nt: ..\config\makefile.nt
127         copy ..\config\makefile.nt makefile.nt
128
129 config.h: ..\config\config.nt
130         copy ..\config\config.nt config.h
131
132 wgnuplot.exe: $(OBJS) $(WINOBJS) win\wgnuplot.def wgnuplot.res linkopt1.msw texticon.ico grpicon.ico
133         $(LD) $(LDFLAGS) /out:wgnuplot.exe @linkopt1.msw
134
135 # rules
136
137 wgnuplot.res :  win\wgnuplot.rc win\wgnuplib.rc win\wresourc.h texticon.ico grpicon.ico
138         rc /l 0x409 /fowgnuplot.res /i "win" /d "NDEBUG" /d WIN32 /d MSRC win\wgnuplot.rc
139
140 term.obj: term.c term.h plot.h setshow.h bitmap.h $(CORETERM)
141         $(CC) $(CFLAGS) $(TERMFLAGS) term.c
142
143 winmain.obj: win\winmain.c win\wgnuplib.h win\wtext.h plot.h
144         $(CC) $(CFLAGS) win\winmain.c
145
146 WINDEPS = win\wgnuplib.h win\wcommon.h win\wresourc.h
147
148 wgnuplib.obj: win\wgnuplib.c $(WINDEPS)
149         $(CC) $(CFLAGS) win\wgnuplib.c
150
151 wmenu.obj: win\wmenu.c $(WINDEPS)
152         $(CC) $(CFLAGS) win\wmenu.c
153
154 wtext.obj: win\wtext.c $(WINDEPS)
155         $(CC) $(CFLAGS) win\wtext.c
156
157 wpause.obj: win\wpause.c $(WINDEPS)
158         $(CC) $(CFLAGS) win\wpause.c
159
160 wprinter.obj: win\wprinter.c $(WINDEPS)
161         $(CC) $(CFLAGS) win\wprinter.c
162
163 wgraph.obj: win\wgraph.c $(WINDEPS)
164         $(CC) $(CFLAGS) win\wgraph.c
165
166 wgnuplot.mnu: win\wgnuplot.mnu
167         copy win\wgnuplot.mnu wgnuplot.mnu
168
169 pgnuplot.exe: win\pgnuplot.c
170         cl $(CBASEFLAGS) /I$(TOP) win\pgnuplot.c /link version.obj user32.lib
171
172 # extract icons from wgnuplot.rc
173 texticon.ico: grpicon.ico
174
175 grpicon.ico: geticon.exe win\wgnuplot.rc
176         geticon win\wgnuplot.rc
177
178 geticon.exe: win\geticon.c
179         cl /DMSDOS /F 5000 /W1 win\geticon.c
180
181 # convert gnuplot.doc to gnuplot.rtf
182 $(HELPFILE): doc2rtf.exe $(D)gnuplot.doc win\wgnuplot.hpj
183         doc2rtf $(D)gnuplot.doc win\gnuplot.rtf
184         hcw /c /e win\wgnuplot.hpj
185         if exist win\wgnuplot.hlp copy win\wgnuplot.hlp .
186
187 doc2rtf.exe: $(D)doc2rtf.c $(D)termdoc.c $(D)xref.c
188         cl $(CFLAGS) /F 5000 /W1 /I. /DWINDOWS_NO_GUI /I$(D) /I$(T) -Fedoc2rtf.exe $(D)doc2rtf.c $(D)termdoc.c $(D)xref.c
189
190 #make binary demo files
191 $(M)bf_test.exe : bf_test.c dbinary.obj alloc.obj
192         cl $(CFLAGS) /F 5000 /W1 /DWINDOWS_NO_GUI /Fe$(M)bf_test.exe bf_test.c dbinary.obj alloc.obj
193         cd ..\demo
194         bf_test
195         cd ..\src
196
197 # _Windows causes wtext.h to define fread() etc
198 dbinary.obj: binary.c
199                 $(CC) $(CFLAGS) /U_Windows /F 5000 /W1 /Fodbinary.obj binary.c
200
201 # clean up temporary files
202 clean:
203         if exist *.obj del *.obj
204         if exist *.ico del *.ico
205         if exist wgnuplot.res del wgnuplot.res
206         if exist win\gnuplot.rtf del win\gnuplot.rtf
207         if exist win\wgnuplot.hlp del win\wgnuplot.hlp
208         if exist ..\demo\bf_test.exe del ..\demo\bf_test.exe
209         if exist linkopt1.msw del linkopt1.msw
210         if exist doc2rtf.exe del doc2rtf.exe
211         if exist geticon.exe del geticon.exe
212         if exist GNUPLOT del GNUPLOT
213
214 veryclean: clean
215         if exist wgnuplot.exe del wgnuplot.exe
216         if exist wgnuplot.hlp del wgnuplot.hlp
217         if exist wgnuplot.mnu del wgnuplot.mnu
218         if exist pgnuplot.exe del pgnuplot.exe
219         if exist ..\demo\binary1 del ..\demo\binary1
220         if exist ..\demo\binary2 del ..\demo\binary2
221         if exist ..\demo\binary3 del ..\demo\binary3
222         if exist ..\demo\fit.log del ..\demo\fit.log
223         if exist ..\demo\soundfit.par del ..\demo\soundfit.par
224         if exist config.h del config.h
225         if exist makefile.nt del makefile.nt