1 # Hello, emacs: this is a -*- Makefile -*-
2 # $Id: makefile.dj2,v 1.10.2.2 2008/02/23 11:20:21 mikulik Exp $
4 # GNUPLOT Makefile for DJGPP version 2 on DOS
7 # from the main gnuplot directory, do:
8 # make -C src -f ../config/makefile.dj2
11 # AUTHORS : several ... including Edzer Pebesma <pebesma@metoor.frw.uva.nl>
12 # last mod. by Hans-Bernhard Broeker <broeker@physik.rwth-aachen.de>
13 # DATE of last mod: $Date: 2008/02/23 11:20:21 $
16 # removed atari reference and added binary demo bf_test
17 # cleaned up the building of doc and binary test files
18 # gnuplot.gih will be built now inside the docs directory like under
19 # UNIX. The problem is that DOS does not recognize sub-shells like
20 # (cd dir ; do things) inside the makefile.
21 # solution -> assume everything is done inside gnuplot main dir, under
22 # a single DOS command process
24 # install target added : will copy the executable + helpfile in a given
25 # directory ; customize it, see FINALDEST
28 # here customize where you put gnuplot executable for make install
29 # for simplicity the helpfile will be copied in the same dir.
30 # convention used here : no trailing \ for directory names
33 # here customize the name of the executable
34 # exe file will be gnuplot.exe:
37 # where to place gnuplot.gih helpfile upon MAKE
38 # note it will be built inside gnuplot\$(HELPDEST)
39 # and eventually copied to FINALDEST when install
42 # name of the helpfile
45 # Where to install the PostScript prologue files, relatively to the executable
47 GNUPLOT_PS_DIR = share/PostScript
55 # for svga term driver
56 # HBB NEW 20050715: you can disable the DJSVGA driver by -DDJSVGA=0
57 TERMFLAGS = -DDJSVGA=1 -Ic:/djgpp/contrib/grx246/include \
58 -DGNUPLOT_PS_DIR=\"$(GNUPLOT_PS_DIR)\" # -DHAVE_LIBGD
59 TERMLIBS = -Lc:/djgpp/contrib/grx246/lib/dj2 -lgrx20 # -lgd
61 # HBB : added $(OPTS) so user can
62 # change CFLAGS easily, without having to change makefile
63 CFLAGS = -DHAVE_CONFIG_H \
66 LINKOPT = $(LDFLAGS) $(TERMLIBS) -lm -lpc
68 # abbreviations for relative directory names (NB: target 'clean' will
69 # still need manual change if this is changed...)
75 CSOURCE5 = $(T)ai.trm $(T)amiga.trm $(T)aed.trm \
76 $(T)cgi.trm $(T)djsvga.trm $(T)dumb.trm \
77 $(T)dxf.trm $(T)dxy.trm \
78 $(T)debug.trm $(T)eepic.trm $(T)epson.trm $(T)fig.trm \
79 $(T)hp26.trm $(T)hp2648.trm $(T)hpgl.trm \
80 $(T)hpljii.trm $(T)metafont.trm\
81 $(T)apollo.trm $(T)gpr.trm $(T)hppj.trm
82 CSOURCE6 = $(T)impcodes.h $(T)imagen.trm $(T)next.trm $(T)object.h \
83 $(T)iris4d.trm $(T)kyo.trm $(T)latex.trm $(T)mif.trm \
84 $(T)pbm.trm $(T)pc.trm
85 CSOURCE7 = $(T)post.trm $(T)qms.trm $(T)regis.trm $(T)sun.trm \
86 $(T)t410x.trm $(T)tek.trm $(T)texdraw.trm $(T)unixpc.trm \
87 $(T)unixplot.trm $(T)v384.trm $(T)vws.trm $(T)x11.trm $(T)xlib.trm
88 #OBJ1 = bitmap.o command.o contour.o eval.o graphics.o graph3d.o hidden3d.o util3d.o
89 #OBJ2 = help.o internal.o misc.o parse.o plot.o plot2d.o plot3d.o readline.o
90 #OBJ3 = scanner.o set.o show.o specfun.o standard.o stdfn.o term.o time.o util.o
91 #OBJ4 = version.o binary.o interpol.o fit.o matrix.o datafile.o alloc.o variable.o
93 CSOURCES = $(CSOURCE5) $(CSOURCE6) $(CSOURCE7)
94 #OBJS = $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4)
95 # use makefile.all, instead:
98 OBJS = $(COREOBJS) version.$(O)
101 $(CC) -c $(CFLAGS) $(INCLUDE) $<
104 $(patsubst $@-noexist,$(CO) $(COFLAGS) $< $@, \
105 $(filter-out $@,$(firstword $(wildcard $@) $@-noexist)))
107 all: $(EXENAME).exe $(HELPDEST)/$(HELPFILE) $(M)binary?
109 # -s performs the coff2exe step implicitly (?)
110 # HBB: that's plain wrong: -s means 'strip executable',
111 # and stubify (formerly called stubify) is now always done
112 # automatically in the link step. I changed this so you
113 # get a debuggable gnuplot, but a stripped gnuplot.exe
114 $(EXENAME).exe : $(OBJS)
115 $(CC) -o $(EXENAME) $(OBJS) $(LINKOPT)
116 objcopy --strip-all $(EXENAME) $(EXENAME).exe
117 stubify $(EXENAME).exe
119 config.h: ../config/config.dj2
120 copy ..\config\config.dj2 config.h
122 command.o: command.c plot.h setshow.h help.h
123 $(CC) -c $(CFLAGS) $(INCLUDE) -DHELPFILE=\"$(HELPFILE)\" command.c
125 show.o: show.c plot.h setshow.h
126 $(CC) -c $(CFLAGS) $(INCLUDE) -DHELPFILE=\"$(HELPFILE)\" $<
128 term.o: term.c term.h plot.h set.c show.c bitmap.h $(CSOURCES)
129 $(CC) -c $(CFLAGS) $(INCLUDE) $(TERMFLAGS) -I$(T) term.c
131 $(OBJS): plot.h config.h
133 command.o help.o misc.o: help.h
135 command.o graphics.o graph3d.o hidden3d.o util3d.o misc.o plot.o set.o show.o term.o interpol.o: setshow.h
137 command.o fit.o matrix.o: fit.h
139 fit.o matrix.o: matrix.h
141 bitmap.o term.o: bitmap.h
143 variable.o: variable.c plot.h variable.h
145 EMAIL=gnuplot-info@lists.sourceforge.net
147 $(CC) -c -DCONTACT=\"$(EMAIL)\" $(CFLAGS) $(INCLUDE) version.c
149 # convert gnuplot.doc to gnuplot.gih
150 $(HELPDEST)/$(HELPFILE): doc2gih.exe $(D)gnuplot.doc
151 ./doc2gih.exe $(D)gnuplot.doc > $@
153 doc2gih.exe: $(D)doc2gih.c $(D)termdoc.c $(CSOURCES)
154 $(CC) $(CFLAGS) $(INCLUDE) $(TERMFLAGS) -I$(T) -o $@ $(D)doc2gih.c $(D)termdoc.c
156 # now for the demo bin
157 $(M)binary?: bf_test.exe
163 $(CC) $(CFLAGS) -c bf_test.c
165 bf_test.exe: bf_test.o binary.o alloc.o
166 $(CC) $(CFLAGS) bf_test.o binary.o alloc.o -lm -o $@
168 # now install things and create a .bat file to make things easier
170 copy $(EXENAME).exe $(FINALDEST)
171 copy $(HELPDEST)\$(HELPFILE) $(FINALDEST)
172 #HBB: if at all, this batch-file should only be generated by a
173 #separate target, like 'install-bat'. Besides, it doesn't work,
174 #as is, because DOS always executes foo.exe before even looking for
177 # echo @echo off > $(EXENAME).bat
178 # echo SET GNUHELP= $(FINALDEST)\$(HELPFILE) >> $(EXENAME).bat
179 # echo SET GNUPLOT= $(FINALDEST) >> $(EXENAME).bat
180 # echo $(FINALDEST)\$(EXENAME).exe %1 %2 %3 %4 %5 %6 >> $(EXENAME).bat
181 # echo SET GNUHELP= >> $(EXENAME).bat
182 # echo SET GNUPLOT= >> $(EXENAME).bat
183 # copy $(EXENAME).bat $(FINALDEST)
186 # clean target - remove all temp files, but leave executable intact
196 # realclean target - remove all files created by the makefile
199 del $(HELPDEST)\$(HELPFILE)
204 del ..\demo\soundfit.par
206 ## END OF GNUPLOT MAKEFILE FOR DJGPP V2