1######## PLOTICUS version 2.40    Copyright 1998-2008 Stephen C. Grubb  http://ploticus.sourceforge.net
2########
3######## Use this Makefile to build pl executable or libploticus.  Root permission not required.
4######## Answer the three questions below then do:  make clean; make
5######## Note that default settings should be ready to go for most linux platforms.
6######## Problem reports and questions may be sent to  ploticus@yahoogroups.com
7
8
9# defaults..
10CC = gcc
11PLATFORM = UNIX
12RMCOM = rm -f
13NOX11 = -DNOX11
14NOSWF = -DNOSWF
15EXE = pl
16
17
18
19####################################################################
20########## First question:
21########## What do you wish to build?  pl executable?  libploticus?
22########## Select ONE option below by activating the appropriate lines...
23########## All other lines should be commented out.
24####################################################################
25
26
27############ Option 1: build the pl executable (unix), no X11 ....
28# NOX11 = -DNOX11
29
30
31############ Option 2: build the pl executable (unix), with X11 enabled ....
32# NOX11 =
33# XOBJ = x11.o interact.o
34############ If you're choosing option 2, indicate where your X11 libs and header files are.. activate lines below as appropriate..
35#### linux
36# XLIBS = -L/usr/local/lib -lX11
37# XINCLUDEDIR = -I/usr/local/include
38#### alt linux
39# XLIBS = -lX11
40# XINCLUDEDIR = -I/usr/include/X11
41#### 64bit linux
42# XLIBS = -L/usr/local/lib64 -lX11
43#### solaris
44# XLIBS = -L/usr/openwin/lib -lX11
45# XINCLUDEDIR = -I/usr/openwin/include
46#### mac osx
47# CC = cc
48# XLIBS = -L/usr/local/lib -lX11
49# XINCLUDEDIR = -I/usr/local/include
50#### cygwin
51# XLIBS = -L/usr/local/lib -lX11
52# XINCLUDEDIR = -I/usr/local/include
53# PLATFORM = WIN32
54
55
56############ Option 3: build pl executable (native win32 pl.exe)
57# PLATFORM = WIN32
58# RMCOM = del
59
60
61############ Option 4: build static libploticus (unix) with png support
62LIBEXT = a
63ARCOM = ar r
64target: libploticus-static
65
66
67############ Option 5: build shared libploticus (unix)
68############ Note: untested  ... suggestions welcome -sg
69# LIBEXT = a
70# FPIC = -fPIC
71# SONAME = libploticus.so.0
72# SHAREFLAG = -shared -Wl,-soname,$(SONAME)
73# target: libploticus-so
74
75
76
77############################################################################
78######### Second question:
79######### Ploticus uses the GD library to create PNG, GIF, JPEG images.
80######### This distribution includes GD13 (GIF), and GD16 (PNG) code.
81######### You can choose to use one of these or you can choose to use your
82######### own GD version, or you can choose to not use GD at all.
83############################################################################
84
85
86########### Option 1: use bundled GD13 (pseudoGIF only). No additional lib dependencies.
87# exetarget: pl
88# GDOBJ = $(GD) $(GD13)
89
90########### Option 2: use bundled GD16 (PNG only).  Requires libpng and zlib.
91exetarget: plpng
92# GD16LIBS = -lpng -lz
93# GD16H =
94ZFLAG = -DWZ
95GD16LIBS = /home/scg/lib/libpng.a /home/scg/lib/libz.a
96GD16H = -I/home/scg/lib
97GDOBJ = $(GD) $(GD16)
98
99########### Option 3: use your own GD resource.  Requires GD 1.84+, libpng, zlib, libjpeg
100# exetarget: plgd18
101# GD18LIBS = -lgd -lpng -lz -ljpeg
102# GD18H =
103# GDFREETYPE =
104# ZFLAG = -DWZ
105
106########### Option 4: use your own GD resource with FreeType2 fonts enabled.
107###########           Requires GD 1.84+, libpng, zlib, libjpeg and libfreetype
108# exetarget: plgd18
109# GD18LIBS = -lgd -lpng -lz -ljpeg -lfreetype
110# GD18H =
111# GDFREETYPE = -DGDFREETYPE
112# ZFLAG = -DWZ
113
114########### Option 5: don't use GD at all.
115# exetarget: plnogd
116# NOGD = -DNOGD
117
118
119
120################################################################
121######## Third question.
122######## Other various settings you may want to make.
123################################################################
124
125
126#### For SWF (flash) output capability activate the following.  If necessary change -lming to location of ming.
127#### Note, successful with ming 0.2a but not with later ming versions..
128# MING = -lming
129#optional for non-standard location:  MINGH = -I/home/scg/lib
130
131
132#### If you do a "make install", where do you want the executable(s) to be moved to?
133INSTALLBIN = /usr/local/bin
134
135
136#### For LOCALE support (non-roman alphabets & collation), uncomment the following..
137# LOCALEOBJ = localef.o
138# LOCALE_FLAG = -DLOCALE
139
140#### SVG output is always available by default.
141#### If you want compressed SVG (.svgz), and you selected GD13 or no GD above,
142#### uncomment the following.  You need to have zlib.  If necessary change -lz to location of zlib.
143# ZLIB = -lz
144# ZFLAG = -DWZ
145
146#### To completely remove PostScript / EPS output capability, uncomment the following..
147# NOPS = -DNOPS
148
149#### To completely remove SVG output capability, uncomment the following..
150# NOSVG = -DNOSVG
151
152#### To see all possible compiler warnings, uncomment the following line..
153WALL = -Wall
154
155
156
157###############################################################################
158######## Done.  Now save this file and type:  make clean; make      ###########
159########                                                            ###########
160###############################################################################
161
162######## FYI... additional Makefile statement examples:
163######## eg: GD16LIBS = /home/scg/lib/libpng.a /home/scg/lib/libz.a
164######## eg: GD16H = -I/home/scg/lib
165######## GD18LIBS = -L /home/scg/lib -lgd -lpng -lz -ljpeg -lfreetype
166######## GD18H = -I/home/scg/lib/freetype-2.0.4/include -I/home/scg/lib/gd-1.8.4
167######## eg: GD18H = -I/home/scg/lib/gd-1.8.4 -I/home/scg/lib/jpeg-6b -I/home/scg/lib -I/home/scg/lib/freetype-2.0.4/include
168######## eg: MINGH = -I/home/scg/lib
169######## eg: MING = /home/scg/lib/libming.a
170
171###############################################################################
172###############################################################################
173###############################################################################
174###############################################################################
175
176
177GD13 = grgd13.o devstuff13.o gd13.o
178GD16 = grgd16.o devstuff16.o gd16.o gd_io.o gd_io_dp.o gd_io_file.o gd_png.o
179GD = gdfontg.o gdfontl.o gdfontmb.o gdfonts.o gdfontt.o
180
181LIBS = $(XLIBS) -lm $(ADDLIBS)
182
183CFLAGS = $(FPIC) $(WALL) -DPLOTICUS -D$(PLATFORM) -DTDH_NOREC $(ZFLAG) $(LOCALE_FLAG) \
184  $(NOGD) $(NOX11) $(NOPS) $(NOSVG) $(NOSWF) $(XINCLUDEDIR) $(MINGH)
185
186OBJ = proc_annotate.o proc_areadef.o proc_axis.o proc_bars.o proc_rect.o proc_breakaxis.o \
187  proc_categories.o proc_curvefit.o proc_settings.o proc_drawcommands.o \
188  proc_getdata.o proc_image.o proc_legend.o proc_legendentry.o proc_line.o proc_lineplot.o \
189  proc_page.o proc_pie.o proc_print.o proc_boxplot.o proc_rangesweep.o proc_usedata.o \
190  proc_scatterplot.o proc_vector.o proc_symbol.o proc_processdata.o proc_tabulate.o proc_venndisk.o clickmap.o proc_tree.o proc_catlines.o \
191  plhead.o execscriptfile.o execline.o lib.o details.o parse.o units.o preliminaries.o \
192  process_arg.o plvalue_subst.o cats.o fieldnames.o autorange.o nearest.o select.o datasets.o \
193  color.o plg.o init.o arrow.o mark.o block.o pcode.o ps.o svg.o swf.o stub.o winscale.o lineclip.o smoothfit.o \
194  condex.o dates.o dbinterface.o err.o functions.o glroutines.o reslimits.o secondaryops.o  \
195  shell.o sinterp.o tdhkit.o times.o value.o value_subst.o variable.o custom.o \
196  $(LOCALEOBJ)
197
198
199# pl with gif support
200pl: pl.o $(OBJ) $(XOBJ) gd00files gd13files
201	$(CC) pl.o $(OBJ) $(GD13) $(GD) $(XOBJ) $(LIBS) $(ZLIB) $(MING) -o $(EXE)
202
203# pl with png support
204plpng: pl.o $(OBJ) $(XOBJ) gd00files gd16files
205	$(CC) pl.o $(OBJ) $(GD16) $(GD) $(XOBJ) $(GD16LIBS) $(LIBS) $(MING) -o $(EXE)
206
207# pl with jpeg support (user must supply gd 1.8+)
208plgd18: pl.o $(OBJ) $(XOBJ) gd18files
209	$(CC) pl.o grgd.o devstuff.o $(OBJ) $(XOBJ) $(GD18LIBS) $(LIBS) $(MING) -o $(EXE)
210
211# pl with no GD support
212plnogd: pl.o $(OBJ) $(XOBJ) nogdfiles
213	$(CC) pl.o devstuff.o $(OBJ) $(XOBJ) $(LIBS) $(ZLIB) $(MING) -o $(EXE)
214
215# libploticus.a with png
216libploticus-static: $(OBJ) api.o gd00files gd16files
217	$(RMCOM) libploticus.$(LIBEXT)
218	$(ARCOM) libploticus.$(LIBEXT) $(OBJ) api.o $(GD16) $(GD)
219
220# this one needs work... suggestions welcome
221libploticus-so: $(OBJ) $(GDOBJ)
222	$(RMCOM) libploticus.$(LIBEXT)
223	$(CC) $(SHAREFLAG) -o libploticus.$(LIBEXT) $(OBJ) $(GDOBJ)
224
225
226gd00files:
227	$(CC) -I./gd13 -I./ -c gdfontg.c gdfontl.c gdfontmb.c gdfonts.c gdfontt.c
228	echo "done with gd00files" > gd00files
229
230gd13files:
231	$(CC) -c $(WALL) grgd.c -DGD13 -DPLOTICUS -I./gd13 -o grgd13.o
232	$(CC) -c $(CFLAGS) devstuff.c -DGD13 -o devstuff13.o
233	$(CC) -c gd13.c -I./gd13
234	echo "done with gd13files" > gd13files
235
236gd16files:
237	$(CC) -c $(WALL) grgd.c -DGD16 -DPLOTICUS -I./ -I./gd16 -o grgd16.o
238	$(CC) -c $(CFLAGS) devstuff.c -DGD16 -o devstuff16.o
239	$(CC) -c -I./gd16 -I./ $(GD16H) gd16.c gd_io.c gd_io_dp.c gd_io_file.c gd_png.c
240	echo "done with gd16files" > gd16files
241
242gd18files:
243	$(CC) -c grgd.c devstuff.c -DGD18 $(GDFREETYPE) $(GD18H) $(CFLAGS)
244
245nogdfiles:
246	$(CC) -c devstuff.c $(CFLAGS)
247
248devgrgd:
249	$(CC) -c $(WALL) grgd.c -DGD13 -DPLOTICUS -I./gd13 -o grgd13.o
250	touch pcode.c
251	make
252
253
254
255install:
256	cp $(EXE) $(INSTALLBIN)
257
258clean:
259	$(RMCOM) *.o gd??files
260
261distclean:  clean
262	$(RMCOM) $(EXE)
263
264