Initial release of Maemo 5 port of gnuplot
[gnuplot] / config / makefile.dj2
1 # Hello, emacs: this is a -*- Makefile -*-
2 # $Id: makefile.dj2,v 1.10.2.2 2008/02/23 11:20:21 mikulik Exp $
3 #
4 # GNUPLOT Makefile for DJGPP version 2 on DOS
5 #
6 # Usage:
7 #       from the main gnuplot directory, do:
8 #       make -C src -f ../config/makefile.dj2
9 #
10 #
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 $
14 #
15
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
23 #
24 # install target added : will copy the executable + helpfile in a given
25 # directory ; customize it, see FINALDEST
26 #
27 #
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
31 FINALDEST=c:\bin
32
33 # here customize the name of the executable
34 # exe file will be  gnuplot.exe:
35 EXENAME = gnuplot
36
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
40 HELPDEST =.
41
42 # name of the helpfile
43 HELPFILE =gnuplot.gih
44
45 # Where to install the PostScript prologue files, relatively to the executable
46 # gnuplot.exe
47 GNUPLOT_PS_DIR = share/PostScript
48
49 # compiler
50 CC = gcc
51
52 # include directory
53 INCLUDE = -I.
54
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
60
61 # HBB : added $(OPTS) so user can
62 #   change CFLAGS easily, without having to change makefile
63 CFLAGS = -DHAVE_CONFIG_H \
64         -O2 -g $(OPTS)
65
66 LINKOPT = $(LDFLAGS) $(TERMLIBS) -lm -lpc
67
68 # abbreviations for relative directory names (NB: target 'clean' will
69 #   still need manual change if this is changed...)
70 T=../term/
71 D=../docs/
72 M=../demo/
73 O=o
74
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
92
93 CSOURCES = $(CSOURCE5) $(CSOURCE6) $(CSOURCE7)
94 #OBJS =  $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4)
95 # use makefile.all, instead:
96 include makefile.all
97
98 OBJS = $(COREOBJS) version.$(O)
99
100 .c.o:  
101         $(CC) -c $(CFLAGS) $(INCLUDE) $<
102
103 %:: RCS/%
104         $(patsubst $@-noexist,$(CO) $(COFLAGS) $< $@, \
105                 $(filter-out $@,$(firstword $(wildcard $@) $@-noexist)))
106
107 all: $(EXENAME).exe  $(HELPDEST)/$(HELPFILE)  $(M)binary?
108
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
118
119 config.h: ../config/config.dj2
120         copy ..\config\config.dj2 config.h
121
122 command.o: command.c plot.h setshow.h help.h
123         $(CC) -c $(CFLAGS) $(INCLUDE) -DHELPFILE=\"$(HELPFILE)\" command.c
124
125 show.o: show.c plot.h setshow.h
126         $(CC) -c $(CFLAGS) $(INCLUDE) -DHELPFILE=\"$(HELPFILE)\" $<
127
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
130
131 $(OBJS): plot.h config.h
132
133 command.o help.o misc.o: help.h
134
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
136
137 command.o fit.o matrix.o: fit.h
138
139 fit.o matrix.o: matrix.h
140
141 bitmap.o term.o: bitmap.h
142
143 variable.o: variable.c plot.h variable.h
144
145 EMAIL=gnuplot-info@lists.sourceforge.net
146 version.o: version.c
147         $(CC) -c -DCONTACT=\"$(EMAIL)\" $(CFLAGS) $(INCLUDE) version.c
148
149 # convert gnuplot.doc to gnuplot.gih
150 $(HELPDEST)/$(HELPFILE): doc2gih.exe $(D)gnuplot.doc
151         ./doc2gih.exe  $(D)gnuplot.doc > $@
152
153 doc2gih.exe: $(D)doc2gih.c $(D)termdoc.c $(CSOURCES)
154         $(CC) $(CFLAGS) $(INCLUDE) $(TERMFLAGS) -I$(T) -o $@ $(D)doc2gih.c $(D)termdoc.c
155
156 # now for the demo bin
157 $(M)binary?: bf_test.exe
158         ./bf_test.exe
159         copy binary? ..\demo
160         del binary?
161
162 bf_test.o:
163         $(CC) $(CFLAGS) -c bf_test.c
164
165 bf_test.exe: bf_test.o binary.o alloc.o
166         $(CC) $(CFLAGS) bf_test.o binary.o alloc.o -lm -o $@
167
168 # now install things and create a .bat file to make things easier
169 install: all
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
175 #a foo.bat
176 #       del  $(EXENAME).bat
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)
184
185
186 # clean target - remove all temp files, but leave executable intact
187 clean:
188         del *.o
189         rem del config.h
190         del $(EXENAME)
191         del doc2gih
192         del doc2gih.exe
193         del bf_test
194         del bf_test.exe
195
196 # realclean target - remove all files created by the makefile
197 realclean: clean
198         del $(EXENAME).exe
199         del $(HELPDEST)\$(HELPFILE)
200         del ..\demo\binary1
201         del ..\demo\binary2
202         del ..\demo\binary3
203         del ..\demo\fit.log
204         del ..\demo\soundfit.par
205 #####
206 ##     END OF GNUPLOT MAKEFILE FOR DJGPP V2
207 #####