File: makefile.mgw

package info (click to toggle)
gnuplot 3.7.2-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 6,212 kB
  • ctags: 4,635
  • sloc: ansic: 43,538; cpp: 970; makefile: 883; lisp: 661; sh: 578; asm: 539; objc: 379; csh: 297; pascal: 192; perl: 138
file content (200 lines) | stat: -rw-r--r-- 5,510 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# To compile gnuplot for WinNT and Win95
#
# Changed for use with Cygwin/MinGW32 by HBB
# compile the package with make -f makefile.mgw
# the make utility for MinGW32 can be obtained the MinGW sites
#
# you need Cygwin's windres as of Mingw32-egcs-1.1b
# this makefile was tested with Ming32egcs-1.1b and 
# Microsoft Help Workshop 4.03
#
#

# where to place gnuplot.gih helpfile
HELPFILE = wgnuplot.hlp
TOP = .

DESTDIR=/Progra~1/Gnuplot3.7

# give here the path to your compiler (preferrably MinGW's one)
GCCPATH=/mingw32/bin/

# -c  means don't link
# -I  means extra include directory
# -O2 means optimize for speed
# -g  means prepare for debugging
# -mpentium means optimise for Pentium processor
# -mpentiumpro means optimize for Pentium II and Pro procesors

CC = $(GCCPATH)gcc
LD = $(GCCPATH)gcc
CFLAGS = -g -O2 -I$(TOP) -D_Windows -DNO_GIH -DHAVE_STRNICMP \
	-DREADLINE -DGP_INLINE=inline -DHAVE_SLEEP -DANSI_C \
	-DHAVE_GETCWD -DNEAR=
LDFLAGS = -g 

RM = rm -f
CP = cp -p

#
# to compile the .hlp file you need hcw
# either out of Microsoft SDK or
# Microsoft Help Workshop
# the latter can be obtained at www.helpmaster.com/help/devaids.htm
# put the path to hcw here
#
# the followind switches are for HCW 4.03
#
HCWPATH=/Program\ Files/Help\ Workshop/
HCW = $(HCWPATH)hcw
HCWFLAG=

# 
# it seems for the moment that we need cygwin's windres
# as the one shipped with mingw32/egcs 1.1b is buggy
# the one with cygwin b20.1 is ok, so give here the complete path
#
RCPATH = /cygnus/cygwin-b20/H-i586-cygwin32/bin
RC  = windres
RCFLAGS=--include-dir /mingw32/include \
	--define __WIN32__ --define __WIN95__ --define MSRC \
	--define __GNUWIN32__
RCOUT=wgplt_res.o
RES2COFF=echo wgplt_res.o

#
# you can also use MS SDK's 
#
#MSSDK=f:/mssdk/
#RC=$(MSSDK)/bin/rc
#RCFLAGS=-v -i$(MSSDK)/include -iwin \
#	-dWIN32 -dMSRC
#RCOUT=-fowgnuplot.res
#RES2COFF=res2coff -i wgnuplot.res -o wgplt_res.o


# see other terminal defines in term.h
TERMFLAGS = -I$(TOP)/term

# There shouldn't be anything to be changed below this line
#=======================================================================

# macros for makefile.all
O=o
T=term/
D=docs/
L=docs/latex/
M=demo/


default: wgnuplot.exe $(HELPFILE) wgnuplot.mnu $(M)bf_test.exe

# include the 'core makefile template'
include makefile.all

OBJS = $(COREOBJS) version.$(O)

WINOBJS = winmain.$(O) wgnuplib.$(O) wgraph.$(O) wprinter.$(O) wtext.$(O) wpause.$(O) wmenu.$(O)

WINDOWS = makefile.win makefile.nt README.win win/wcommon.h \
	win/wgnuplib.c win/wgnuplib.def win/wgnuplib.h win/wgnuplib.rc \
	win/wgnuplot.def win/wgnuplot.hpj win/wgnuplot.mnu win/wgraph.c \
	win/winmain.c win/wmenu.c win/wpause.c win/wprinter.c \
	win/wresourc.h win/wtext.c win/wtext.h win/geticon.c \
	docs/doc2rtf.c term/win.trm win/grpicon.ico win/texticon.ico


# default rules
.SUFFIXES: .exe .o .c
.c.o:
	$(CC) -c $(CFLAGS) $*.c

LDLIBS = -lkernel32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -ladvapi32

wgnuplot.exe: $(OBJS) $(WINOBJS) win/wgnuplot.def wgplt_res.o texticon.ico grpicon.ico
	$(LD) $(LDFLAGS) -mwindows -o $@ $(OBJS) $(WINOBJS) wgplt_res.o $(LDLIBS)

# rules

wgplt_res.o :  win/wgnuplot.rc win/wgnuplib.rc win/wresourc.h texticon.ico grpicon.ico
	$(RC) $(RCFLAGS) win/wgnuplot.rc $(RCOUT)
	$(RES2COFF)

show.o: show.c plot.h setshow.h
	$(CC) -c $(CFLAGS) -DHELPFILE=\"$(HELPFILE)\" -DGNUPLOT_BINDIR=\"$(bindir)\" -c $<

term.$(O): term.c term.h plot.h setshow.h bitmap.h $(CSOURCE5) $(CSOURCE6) $(CSOURCE7)
	$(CC) -c $(CFLAGS) $(TERMFLAGS) term.c

version.$(O): version.c

WINDEPS = win/wgnuplib.h win/wcommon.h win/wresourc.h

winmain.$(O): win/winmain.c win/wgnuplib.h win/wtext.h plot.h
	$(CC) -c $(CFLAGS) -DHELPFILE=\"$(HELPFILE)\"  win/winmain.c

wgnuplib.$(O): win/wgnuplib.c $(WINDEPS)
	$(CC) -c $(CFLAGS) win/wgnuplib.c

wmenu.$(O): win/wmenu.c $(WINDEPS)
	$(CC) -c $(CFLAGS) win/wmenu.c

wtext.$(O): win/wtext.c $(WINDEPS)
	$(CC) -c $(CFLAGS) win/wtext.c

wpause.$(O): win/wpause.c $(WINDEPS)
	$(CC) -c $(CFLAGS) win/wpause.c

wprinter.$(O): win/wprinter.c $(WINDEPS)
	$(CC) -c $(CFLAGS) win/wprinter.c

wgraph.$(O): win/wgraph.c $(WINDEPS)
	$(CC) -c $(CFLAGS) win/wgraph.c

wgnuplot.mnu: win/wgnuplot.mnu
	$(CP) $^ $@

# extract icons from wgnuplot.rc
texticon.ico: grpicon.ico

grpicon.ico: geticon.exe win/wgnuplot.rc
	./geticon win/wgnuplot.rc

geticon.exe: win/geticon.c
	$(LD) $(LDFLAGS) -o $@ win/geticon.c

# convert gnuplot.doc to gnuplot.rtf
$(HELPFILE): doc2rtf.exe docs/gnuplot.doc win/wgnuplot.hpj
	./doc2rtf docs/gnuplot.doc win/gnuplot.rtf
	$(HCW) \/c \/e win/wgnuplot.hpj

doc2rtf.exe: docs/doc2rtf.c docs/termdoc.c docs/xref.c
	$(LD) $(LDFLAGS) -o $@ $(CFLAGS) -I. -Idocs -Iterm $^

#make binary demo files
$(M)bf_test.exe : bf_test.c dbinary.$(O) alloc.$(O)
	$(LD) $(LDFLAGS) $(CFLAGS) -U_Windows -o $@ $^
	(cd demo ; ./bf_test.exe )
#	cd ..

# _Windows causes wtext.h to define fread() etc
dbinary.$(O): binary.c
	$(CC) -c $(CFLAGS) -U_Windows -o $@ $^

# clean up temporary files
clean:
	$(RM) *.$(O) wgnuplot.map wgnuplot.res win/gnuplot.rtf
	$(RM) doc2rtf.exe win/wgnuplib.res wgnuplib.map wgnuplot.lib
	$(RM) demo/bf_test.exe *.ico geticon.exe

realclean: veryclean
veryclean: clean
	$(RM) wgnuplot.exe wgnuplot.hlp wgnuplot.mnu wgnuplot.gid
	$(RM) demo/binary[123] demo/fit.log demo/soundfit.par

# now move the whole stuff to its destination
install: default
	-mkdir -p $(DESTDIR)
	cp wgnuplot.exe $(DESTDIR)/wgnuplot.exe
	cp win/wgnuplot.mnu $(DESTDIR)/wgnuplot.mnu
	cp wgnuplot.hlp $(DESTDIR)/wgnuplot.hlp