forked from gnuplot/gnuplot-old
/
makefile.dj2
212 lines (178 loc) · 6.86 KB
/
makefile.dj2
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
201
202
203
204
205
206
207
208
209
210
211
212
# make file for gnuplot 3.6 / DOS / DJGPP version 2
#
# compile it by make -f makefile.dj2 in the main gnuplot directory
#
#
# AUTHORS : several ... including Edzer Pebesma <pebesma@metoor.frw.uva.nl>
# last mod. by Emmanuel Bigler <bigler@lpmo.univ-fcomte.fr>
# DATE of last mod : 1996 FEB 20
#
#
# removed atari reference and added binary demo bf_test
# cleaned up the building of doc and binary test files
# gnuplot.gih will be built now inside the docs directory like under
# UNIX. The problem is that DOS does not recognize sub-shells like
# (cd dir ; do things) inside the makefile.
# solution -> assume everything is done inside gnuplot main dir, under
# a single DOS command process
#
# install target added : will copy the executable + helpfile in a given
# directory ; customize it, see FINALDEST
#
#
# here customize where you put gnuplot executable for make install
# for simplicity the helpfile will be copied in the same dir.
# convention used here : no trailing \ for directory names
FINALDEST=c:\bin
# here customize the name of the executable
# exe file will be gp36.exe:
EXENAME = gp36
# where to place gnuplot.gih helpfile upon MAKE
# note it will be built inside gnuplot\$(HELPDEST)
# and eventually copied to FINALDEST when install
HELPDEST =docs
# name of the helpfile
HELPFILE =gnuplot.gih
# compiler
CCDIR = c:\djgpp\bin\
CC = $(CCDIR)gcc
# include directory
INCLUDE = -I.
# for svga term driver
# HBB: -finline-functions bombs out on term.c, so disable it unconditionally
TERMFLAGS = -DDJSVGA -fno-inline-functions
#
#
#just for historical purpose..
## DJGPP 1.xx:
# CFLAGS = -DMSDOS -DDJGPP -DREADLINE -DHAVE_STRNICMP -O
# LINKOPT = -lm -lpc -lgrx
## DJGPP 2.0:
# HBB : added $(OPTS) so user can
# change CFLAGS easily, without having to change makefile
CFLAGS = -DMSDOS -DDOS32 \
-DANSI_C -DSTDC_HEADERS \
-DHAVE_VALUES_H -DHAVE_UNISTD_H -DRETSIGTYPE=void \
-DHAVE_ERF -DHAVE_LGAMMA -DHAVE_GAMMA \
-DHAVE_GETCWD -DHAVE_SETLINEBUF -DHAVE_SLEEP \
-DHAVE_STRNCASECMP -DHAVE_STRNICMP -DHAVE_STRERROR \
-DHAVE_SETVBUF \
-DHAVE_TEMPNAM -DPIPES -DREADLINE \
-O $(OPTS)
LINKOPT = $(LDFLAGS) -lm -lpc -lgrx20
# HBB: removed reference to no-more-existing term/bigfig.trm
CSOURCE5 = term/ai.trm term/amiga.trm term/aed.trm \
term/cgi.trm term/djsvga.trm term/dumb.trm \
term/dxf.trm term/dxy.trm \
term/debug.trm term/eepic.trm term/epson.trm term/fig.trm \
term/hp26.trm term/hp2648.trm term/hpgl.trm \
term/hpljii.trm term/metafont.trm\
term/apollo.trm term/gpr.trm term/hppj.trm term/compact.c
CSOURCE6 = term/impcodes.h term/imagen.trm term/next.trm term/object.h \
term/iris4d.trm term/kyo.trm term/latex.trm term/mif.trm \
term/pbm.trm term/pc.trm
CSOURCE7 = term/post.trm term/qms.trm term/regis.trm term/sun.trm \
term/t410x.trm term/tek.trm term/texdraw.trm term/unixpc.trm \
term/unixplot.trm term/v384.trm term/vws.trm term/x11.trm term/xlib.trm
OBJ1 = bitmap.o command.o contour.o eval.o graphics.o graph3d.o hidden3d.o util3d.o
OBJ2 = help.o internal.o misc.o parse.o plot.o plot2d.o plot3d.o readline.o
OBJ3 = scanner.o set.o show.o specfun.o standard.o stdfn.o term.o time.o util.o
OBJ4 = version.o binary.o interpol.o fit.o matrix.o datafile.o alloc.o
CSOURCES = $(CSOURCE5) $(CSOURCE6) $(CSOURCE7)
OBJS = $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4)
.c.o:
$(CC) -c $(CFLAGS) $(INCLUDE) $<
%:: RCS/%
$(patsubst $@-noexist,$(CO) $(COFLAGS) $< $@, \
$(filter-out $@,$(firstword $(wildcard $@) $@-noexist)))
all: $(EXENAME).exe $(HELPDEST)\$(HELPFILE) demo\binary?.
# -s performs the coff2exe step implicitly (?)
# HBB: that's plain wrong: -s means 'strip executable',
# and stubify (formerly called stubify) is now always done
# automatically in the link step. I changed this so you
# get a debuggable gp36, but a stripped gp36.exe
$(EXENAME).exe : $(OBJS)
$(CC) -o $(EXENAME) $(OBJS) $(LINKOPT)
objcopy --strip-all $(EXENAME) $(EXENAME).exe
stubify $(EXENAME).exe
#HBB: I think that message is superfluous, and maybe even confusing
# for new users of DJGPP V2, who never used DJGPP V1 at all.
# @echo.
# @echo Rem: with djgpp v.2, you do not need go32 any longer to run gnuplot
# @echo.
# This used to copy go32 to the exe file.. under v1.xx
# obsolete under djgpp v. 2.
#
#$(EXENAME).exe : $(OBJS)
# $(CC) -o $(EXENAME) $(OBJS) $(LINKOPT)
# strip $(EXENAME)
# copy /b $(CCDIR)\$(EXENAME).exe+$(EXENAME) $(EXENAME).exe
# del $(EXENAME)
command.o: command.c plot.h setshow.h help.h
$(CC) -c $(CFLAGS) $(INCLUDE) -DHELPFILE=\"$(HELPFILE)\" command.c
show.o: show.c plot.h setshow.h
$(CC) -c $(CFLAGS) $(INCLUDE) -DHELPFILE=\"$(HELPFILE)\" $<
term.o: term.c term.h plot.h set.c show.c bitmap.h $(CSOURCES)
$(CC) -c $(CFLAGS) $(INCLUDE) $(TERMFLAGS) -Iterm term.c
$(OBJS): plot.h
command.o help.o misc.o: help.h
command.o graphics.o graph3d.o hidden3d.o util3d.o misc.o plot.o set.o show.o term.o interpol.o: setshow.h
command.o fit.o matrix.o: fit.h
fit.o matrix.o: matrix.h
bitmap.o term.o: bitmap.h
#HBB 961201: add dependencies to trigger RCS checkout if necessary:
plot.h: protos.h
protos.h: alloc.h
EMAIL=broeker@physik.rwth-aachen.de
version.o: version.c
$(CC) -c -DCONTACT=\"$(EMAIL)\" $(CFLAGS) $(INCLUDE) version.c
# convert gnuplot.doc to gnuplot.gih
$(HELPDEST)\$(HELPFILE): .\docs\doc2gih.exe .\docs\gnuplot.doc
.\docs\doc2gih docs/gnuplot.doc > $(HELPDEST)\$(HELPFILE)
.\docs\doc2gih.exe: .\docs\doc2gih.c .\docs\termdoc.c $(CSOURCES)
$(CC) $(CFLAGS) $(INCLUDE) $(TERMFLAGS) -Iterm -o ./docs/doc2gih ./docs/doc2gih.c ./docs/termdoc.c
coff2exe ./docs/doc2gih
# now for the demo bin
demo\binary?.: bf_test.exe
bf_test
copy binary? demo\binary?
del binary?
bf_test.o:
$(CC) $(CFLAGS) -c bf_test.c
bf_test.exe: bf_test.o binary.o alloc.o
$(CC) $(CFLAGS) bf_test.o binary.o alloc.o -lm -o bf_test
coff2exe bf_test
# now install things and create a .bat file to make things easier
install: all
copy $(EXENAME).exe $(FINALDEST)
copy $(HELPDEST)\$(HELPFILE) $(FINALDEST)
#HBB: if at all, this batch-file should only be generated by a
#separate target, like 'install-bat'. Besides, it doesn't work,
#as is, because DOS always executes foo.exe before even looking for
#a foo.bat
# del $(EXENAME).bat
# echo @echo off > $(EXENAME).bat
# echo SET GNUHELP= $(FINALDEST)\$(HELPFILE) >> $(EXENAME).bat
# echo SET GNUPLOT= $(FINALDEST) >> $(EXENAME).bat
# echo $(FINALDEST)\$(EXENAME).exe %1 %2 %3 %4 %5 %6 >> $(EXENAME).bat
# echo SET GNUHELP= >> $(EXENAME).bat
# echo SET GNUPLOT= >> $(EXENAME).bat
# copy $(EXENAME).bat $(FINALDEST)
# clean target - remove all temp files, but leave executable intact
clean:
del *.o
del $(EXENAME)
del .\docs\doc2gih
del .\docs\doc2gih.exe
del bf_test
del bf_test.exe
# realclean target - remove all files created by the makefile
realclean: clean
del $(EXENAME).exe
del $(HELPDEST)\$(HELPFILE)
del .\demo\binary1
del .\demo\binary2
del .\demo\binary3
#####
## END OF GNUPLOT 3.6 MAKEFILE FOR DJGPP V2
#####