File: makefile.dj2

package info (click to toggle)
gnuplot 4.6.6-1~bpo70%2B1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 15,640 kB
  • sloc: ansic: 85,383; cpp: 6,743; lisp: 3,999; makefile: 2,126; sh: 976; objc: 647; asm: 539; perl: 310; awk: 235; pascal: 194; csh: 179; tcl: 88; python: 46
file content (215 lines) | stat: -rw-r--r-- 6,702 bytes parent folder | download | duplicates (3)
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
213
214
215
# Hello, emacs: this is a -*- Makefile -*-
# $Id: makefile.dj2,v 1.19 2011/06/01 03:44:36 sfeam Exp $
#
# GNUPLOT Makefile for DJGPP version 2 on DOS
#
# Usage:
#       from the main gnuplot directory, do:
#       make -C src -f ../config/makefile.dj2
#
#
# AUTHORS : several ... including Edzer Pebesma <pebesma@metoor.frw.uva.nl>
#           last mod. by Hans-Bernhard Broeker <broeker@physik.rwth-aachen.de>
# DATE of last mod: $Date: 2011/06/01 03:44:36 $
#
# 
# 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  gnuplot.exe:
EXENAME = gnuplot

# where to place gnuplot.gih helpfile upon MAKE
# note it will be built inside gnuplot\$(HELPDEST)
# and eventually copied to FINALDEST when install
HELPDEST =.

# name of the helpfile
HELPFILE =gnuplot.gih

# Where to install the PostScript prologue files, relatively to the executable
# gnuplot.exe
GNUPLOT_PS_DIR = share/PostScript

# Similarly for javascript files for the canvas terminal:
GNUPLOT_JS_DIR = share/js

# Similarly for lua scripts used by the lua terminal
GNUPLOT_LUA_DIR = share/lua

# compiler
CC = gcc

# include directory
INCLUDE = -I.

# for svga term driver
# HBB NEW 20050715: you can disable the DJSVGA driver by -DDJSVGA=0
TERMFLAGS = -DDJSVGA=1 -Ic:/djgpp/contrib/grx246/include \
	-DGNUPLOT_PS_DIR=\"$(GNUPLOT_PS_DIR)\" \
        -DGNUPLOT_LUA_DIR=\"$(GNUPLOT_LUA_DIR)\"

TERMLIBS = -Lc:/djgpp/contrib/grx246/lib/dj2 -lgrx20 # -lgd

# HBB : added $(OPTS) so user can
#   change CFLAGS easily, without having to change makefile
CFLAGS = -DHAVE_CONFIG_H \
	-O2 -g $(OPTS)

LINKOPT = $(LDFLAGS) $(TERMLIBS) -lm -lpc

# abbreviations for relative directory names (NB: target 'clean' will
#   still need manual change if this is changed...)
T=../term/
D=../docs/
M=../demo/
O=o

CSOURCE5 = $(T)ai.trm $(T)aed.trm \
	$(T)cgi.trm $(T)djsvga.trm $(T)dumb.trm \
	$(T)dxf.trm $(T)dxy.trm \
	$(T)debug.trm $(T)eepic.trm $(T)epson.trm $(T)fig.trm  \
	$(T)hp26.trm $(T)hp2648.trm $(T)hpgl.trm  \
	$(T)hpljii.trm $(T)metafont.trm\
	$(T)hppj.trm
CSOURCE6 = $(T)impcodes.h $(T)imagen.trm $(T)next.trm $(T)object.h \
	$(T)kyo.trm $(T)latex.trm $(T)mif.trm \
	$(T)pbm.trm $(T)pc.trm 
CSOURCE7 = $(T)post.trm $(T)qms.trm $(T)regis.trm $(T)sun.trm \
	$(T)t410x.trm $(T)tek.trm $(T)texdraw.trm $(T)unixpc.trm \
	$(T)v384.trm $(T)vws.trm $(T)x11.trm $(T)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 variable.o

CSOURCES = $(CSOURCE5) $(CSOURCE6) $(CSOURCE7)
#OBJS =  $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4)
# use makefile.all, instead:
include makefile.all

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

.c.o:  
	$(CC) -c $(CFLAGS) $(INCLUDE) $<

%:: RCS/%
	$(patsubst $@-noexist,$(CO) $(COFLAGS) $< $@, \
		$(filter-out $@,$(firstword $(wildcard $@) $@-noexist)))

all: $(EXENAME).exe  $(HELPDEST)/$(HELPFILE)  $(M)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 gnuplot, but a stripped gnuplot.exe
$(EXENAME).exe : $(OBJS)
	$(CC) -o $(EXENAME) $(OBJS) $(LINKOPT)
	objcopy --strip-all $(EXENAME) $(EXENAME).exe
	stubify $(EXENAME).exe

config.h: ../config/config.dj2
	copy ..\config\config.dj2 config.h

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) -I$(T) term.c

$(OBJS): plot.h config.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

variable.o: variable.c plot.h variable.h

EMAIL=gnuplot-info@lists.sourceforge.net
version.o: version.c
	$(CC) -c -DCONTACT=\"$(EMAIL)\" $(CFLAGS) $(INCLUDE) version.c

# convert gnuplot.doc to gnuplot.gih
$(HELPDEST)/$(HELPFILE): doc2gih.exe $(D)gnuplot.doc
	./doc2gih.exe  $(D)gnuplot.doc > $@

doc2gih.exe: $(D)doc2gih.c $(D)termdoc.c $(CSOURCES)
	$(CC) $(CFLAGS) $(INCLUDE) $(TERMFLAGS) -I$(T) -o $@ $(D)doc2gih.c $(D)termdoc.c

# now for the demo bin
$(M)binary?: bf_test.exe
	./bf_test.exe
	copy binary? ..\demo
	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 $@

# 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
	rem del config.h
	del $(EXENAME)
	del doc2gih
	del 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
	del ..\demo\fit.log
	del ..\demo\soundfit.par
#####
##     END OF GNUPLOT MAKEFILE FOR DJGPP V2
#####