File: makefile.os2

package info (click to toggle)
gnuplot 3.7.1p1-4
  • links: PTS
  • area: main
  • in suites: potato
  • size: 5,808 kB
  • ctags: 4,418
  • sloc: ansic: 43,279; lisp: 661; makefile: 647; asm: 539; sh: 416; objc: 379; csh: 297; pascal: 194; perl: 138
file content (346 lines) | stat: -rw-r--r-- 10,661 bytes parent folder | download | duplicates (2)
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
#
# $Id: makefile.os2,v 1.13.2.2 1999/10/28 10:14:55 lhecking Exp $
#
# Makefile for use with emx and GNUMake
#   on OS/2 3.0 and above (might also work for OS/2 2.x)
#
# last modification date: 19991027
#

# We depend on using cmd.exe (or a compatible one)
SHELL=cmd.exe

#
# ***************** Begin of Configuration section ***************************
#

# Comment out the definition lines to disable the according features:

# X11 driver
# requires installed XFree86
X11=1

# GD (GIF) device driver
# requires GD library (not part of gnuplot)
GD=1

# PNG device driver
# requires PNG and Z libraries (not part of gnuplot)
PNG=1

# VESAkit support
# requires SVGA- and VESA Kit (not part of gnuplot)
VESA=1

# GNU_ReadLine support
# requires GNU readline library (static or DLL; not part of gnuplot)
GNU_RL=1

# DEBUGging support
# creates binaries suitable for debugging. Some bugs may come and go
# as opposed to a production build since we lower the optimization level
# DEBUG=1

# MOUSE support for PM terminal
# (not yet supported in official release)
# MOUSE=1

#
# ****************** End of Configuration section ****************************
#

#
# Miscellaneous setup
#

.PHONY: all runtime alldocs demo binaries infomin clean veryclean
.SUFFIXES: .c .trm .o .obj .exe

# seems to be a reasonable default ...
default: runtime

# a help screen
help:
	   @echo " Usage: $(MAKE) -f makefile.os2 target"
	   @echo "   target is one of:"
	   @echo "   all runtime alldocs demo binaries infomin help clean veryclean"

#
# Definitions of flags and symbols used by makefile.all and makefile.os2
#

# these definitions are used by makefile.all
T=term/
D=docs/
L=$(D)latextut/
M=demo/

#
# Definitions valid for all targets on OS/2
#

OS2DIR = os2
DOCDIR = docs
DEMODIR=demo
TERMDIR=term

OS2TERMS= $(TERMDIR)\pm.trm
ifdef X11
	OS2TERMS += $(TERMDIR)\x11.trm
endif
ifdef VESA
	OS2TERMS += $(TERMDIR)\emxvga.trm
endif


# where to place gnuplot.gih helpfile
HELPFILE = gnuplot.gih

#
# 3 sets of variables are defined and used to create
#  (1): gnuplot.exe
#   2 : gnupmdrv.exe (the PM-driver executable)
#   3 : utilities like doc2*.exe, bf_test.exe, ...
#
CC  = gcc
CC2 = gcc
CC3 = gcc
O  = o
O2 = obj
O3 = o

# Flags for compiler and linker under OS/2
OS2FLAGS = -DOS2 -DHELPFILE=\"$(HELPFILE)\"

# Flags for compiling with EMX/GCC
# Special note: -ffloat-store is necessary to avoid some
# strange behaviour (confirmed for gcc 2.7.x and graphics.c)
EMXSPECIFIC = -ffloat-store -DREADLINE -DHAVE_STRNICMP -DPIPES -DHAVE_STRERROR -DHAVE_SYS_SELECT_H -DHAVE_SYS_STAT_H
LIBS = 
ifdef GNU_RL
  EMXSPECIFIC += -DHAVE_LIBREADLINE
  LIBS += -lreadline -ltermcap
endif

#
# Choose flags suitable for a debugging or for a production build
#
ifdef DEBUG
CFLAGS  = -g $(OS2FLAGS) $(EMXSPECIFIC) -Wall -Wno-comment -O0 -Zmt
LFLAGS  = -g -Zcrtdll -Zmt
CFLAGS2 = -g $(OS2FLAGS) $(EMXSPECIFIC) -Zomf -Zsys -Zmt -Wall -O0
LFLAGS2 = -g -Zomf -Zmt -Zcrtdll
CFLAGS3 = -g $(OS2FLAGS) $(EMXSPECIFIC) -Wall -Wno-comment -O0
LFLAGS3 = -g
else
CFLAGS  = $(OS2FLAGS) $(EMXSPECIFIC) -O2 -Wall -Wno-unused -Wno-comment -Zmt
LFLAGS  = -s -Zcrtdll -Zmt
CFLAGS2 = $(OS2FLAGS) $(EMXSPECIFIC) -Zomf -Zcrtdll -Zmt -O2 -Wall -Wno-unused
LFLAGS2 = -s -Zomf -Zmt -Zsys
CFLAGS3 = $(OS2FLAGS) $(EMXSPECIFIC) -O2 -Wall -Wno-unused -Wno-comment
LFLAGS3 = -s
endif

#
# Settings for the terminals to be included
#
TERMFLAGS = -I. -I$(T)

# All terminals available via #defines should be listed below
# Some terminals can be en/disabled in the configuration at the
# beginning of this Makefile.os2 but others may still require
# changes in term.h

#
# GIF-support
ifdef GD
TERMFLAGS += -DHAVE_LIBGD
TERMLIBS  += -lgd
endif
# PNG-support
ifdef PNG
TERMFLAGS += -DHAVE_LIBPNG
TERMLIBS  += -lpng -lz
endif
# SVGA-/VESAkit support
ifdef VESA
TERMFLAGS += -DEMXVESA
TERMLIBS  += -ljmgraph -lvesa
endif
# X11 support
ifdef X11
TERMFLAGS += -DX11
endif
# MOUSE support for PM terminal
ifdef MOUSE
TERMFLAGS += -DUSE_MOUSE
endif

#
# Default Rules
#
.c.$(O):
	$(CC)  $(CFLAGS) $(TERMFLAGS) -o $*.$(O) -c $*.c
.c.obj:
	$(CC2) $(CFLAGS2) -o $*.obj -c $*.c

#
# Include dependencies valid for all platforms from makefile.all
#
include makefile.all

#
# Pre-defined sets of targets:
#
all:         runtime demo
alldocs:     gnuplot.gih gnuplot.inf gnuplot.html gnuplot.info \
             gnuplot.dvi gnuplot.ps
runtime:     binaries infomin gnuplot.inf
infomin:     gnupmdrv.hlp gnuplot.gih
demo:        $(M)binary1 $(M)binary2 $(M)binary3
ifdef X11
binaries: gnuplot.exe gnupmdrv.exe gnuplot_x11.exe
else
binaries: gnuplot.exe gnupmdrv.exe
endif

OBJS = $(COREOBJS) version.$(O)
term.$(O): $(OS2TERMS) term.h

gnuplot.exe: $(OBJS)
	$(CC) -o $@ $(OBJS) $(TERMLIBS) $(LIBS) $(LFLAGS)

#
# Build the PM outboard driver
#
$(OS2DIR)\gnupmdrv.$(O2):  $(OS2DIR)\gnupmdrv.c   $(OS2DIR)\gnupmdrv.h
$(OS2DIR)\gclient.$(O2):   $(OS2DIR)\gclient.c    $(OS2DIR)\gnupmdrv.h
$(OS2DIR)\dialogs.$(O2):   $(OS2DIR)\dialogs.c    $(OS2DIR)\gnupmdrv.h  $(OS2DIR)\dialogs.h
$(OS2DIR)\print.$(O2):     $(OS2DIR)\print.c      $(OS2DIR)\gnupmdrv.h
$(OS2DIR)\gnupmdrv.res :   $(OS2DIR)\gnupmdrv.rc  $(OS2DIR)\gnuplot.ico $(OS2DIR)\dialogs.h
	cd $(OS2DIR) & rc -r gnupmdrv.rc & cd ..
OS2OBJ = $(OS2DIR)\gnupmdrv.$(O2) $(OS2DIR)\gclient.$(O2) $(OS2DIR)\print.$(O2) \
         $(OS2DIR)\dialogs.$(O2)
gnupmdrv.exe: $(OS2OBJ) $(OS2DIR)\gnupmdrv.res $(OS2DIR)\gnupmdrv.def
	$(CC2) $(LFLAGS2) -o $@ $(OS2OBJ) $(OS2DIR)\gnupmdrv.res $(OS2DIR)\gnupmdrv.def
gnupmdrv.hlp: $(OS2DIR)\gnupmdrv.ipf
	ipfc $(OS2DIR)\gnupmdrv.ipf
	move $(OS2DIR)\gnupmdrv.hlp .

#
# Build the X11 outboard driver
#

# X11 libraries
X11LIBS = -lX11 -lsocket -Zcrtdll
# X11 includes
X11INCLUDES = -I$(X11ROOT)/xfree86/include
X11FLAGS= -Zmtd -Zsysv-signals

gnuplot_x11.exe: gplt_x11.o stdfn.o
	$(CC) $(LFLAGS) $(X11FLAGS) $(EMXSPECIFIC) -o $@ $^ $(X11LIBS)

gplt_x11.o: gplt_x11.c
	$(CC) $(CFLAGS) $(X11FLAGS) $(EMXSPECIFIC) $(X11INCLUDES) -c -o $@ $<

#
# Create documentation in various formats
#
# Change the call to LaTeX if the "latex2e" is not appropiate for you
# (and don't care about the strange way it's implemented ...)
gnuplot.dvi: gnuplot.tex
	copy gnuplot.tex $(DOCDIR)\gnuplot_2.tex
	cd $(DOCDIR) & latex gnuplot_2.tex & latex gnuplot_2.tex
	move $(DOCDIR)\gnuplot_2.dvi gnuplot.dvi
	del $(DOCDIR)\gnuplot_2*
gnuplot.tex:  $(DOCDIR)\gnuplot.doc doc2tex.exe
	doc2tex $(DOCDIR)\gnuplot.doc gnuplot.tex
gnuplot.ps: gnuplot.dvi
	dvips -o gnuplot.ps gnuplot.dvi
gnuplot.inf:  $(DOCDIR)\gnuplot.ipf
	ipfc -i $(DOCDIR)\gnuplot.ipf gnuplot.inf
gnuplot.gih:  $(DOCDIR)\gnuplot.doc doc2gih.exe
	doc2gih $(DOCDIR)\gnuplot.doc gnuplot.gih
gnuplot.html: $(DOCDIR)\gnuplot.doc doc2html.exe
	doc2html $(DOCDIR)\gnuplot.doc gnuplot.html
gnuplot.info: $(DOCDIR)\gnuplot.doc doc2info.exe
	doc2info <$(DOCDIR)\gnuplot.doc >gnuplot.info
gnuplot.texi: $(DOCDIR)\gnuplot.doc $(DOCDIR)\doc2texi.pl
	perl $(DOCDIR)\doc2texi.pl $(DOCDIR)\gnuplot.doc >$(DOCDIR)\gnuplot.texi
gnuplot.rtf:  $(DOCDIR)\gnuplot.doc doc2rtf.exe
	doc2rtf $(DOCDIR)\gnuplot.doc gnuplot.rtf
gnuplot.ms:   $(DOCDIR)\gnuplot.doc doc2ms.exe
	doc2ms $(DOCDIR)\gnuplot.doc gnuplot.ms
$(DOCDIR)\gnuplot.ipf:  $(DOCDIR)\gnuplot.doc doc2ipf.exe
	doc2ipf $(DOCDIR)\gnuplot.doc $(DOCDIR)\gnuplot.ipf
#
# Tools for converting the documentation from docs\gnuplot.doc
# in various formats
#
doc2gih.exe doc2ipf.exe doc2html.exe doc2info.exe doc2tex.exe doc2rtf.exe: \
            $(DOCDIR)\termdoc.c $(DOCDIR)\xref.c $(DOCDIR)\allterm.h
#
# To include all terminal documentations in the documentation
# uncomment the following 2 lines
# doc2gih.exe doc2ipf.exe doc2html.exe doc2info.exe doc2tex.exe doc2rtf.exe: \
#           $(DOCDIR)\termdoc.c $(DOCDIR)\xref.c $(DOCDIR)\allterm.h

$(DOCDIR)\allterm.h: $(CORETERM)
#   echo > $@
	cd $(TERMDIR) & type *.trm > ..\$@
doc2gih.exe:  $(DOCDIR)\doc2gih.c $(DOCDIR)\termdoc.c $(OS2TERMS)
	$(CC3) $(CFLAGS3) $(TERMFLAGS) -DALL_TERM_DOC -o $@ $(DOCDIR)\doc2gih.c $(DOCDIR)\termdoc.c
doc2ipf.exe:  $(DOCDIR)\doc2ipf.c $(DOCDIR)\termdoc.c $(DOCDIR)\xref.c $(OS2TERMS)
	$(CC3) $(CFLAGS3) $(TERMFLAGS) -DALL_TERM_DOC -o $@ $(DOCDIR)\doc2ipf.c $(DOCDIR)\termdoc.c $(DOCDIR)\xref.c
doc2tex.exe:  $(DOCDIR)\doc2tex.c $(DOCDIR)\termdoc.c $(OS2TERMS) $(DOCDIR)\allterm.h
	$(CC3) $(CFLAGS3) $(TERMFLAGS) -DALL_TERM_DOC -o $@ $(DOCDIR)\doc2tex.c $(DOCDIR)\termdoc.c
doc2html.exe: $(DOCDIR)\doc2html.c $(DOCDIR)\termdoc.c $(DOCDIR)\xref.c $(OS2TERMS)
	$(CC3) $(CFLAGS3) $(TERMFLAGS) -DALL_TERM_DOC -o $@ $(DOCDIR)\doc2html.c $(DOCDIR)\termdoc.c $(DOCDIR)\xref.c
doc2info.exe: $(DOCDIR)\doc2info.c $(DOCDIR)\termdoc.c $(DOCDIR)\xref.c $(OS2TERMS)
	$(CC3) $(CFLAGS3) $(TERMFLAGS) -DALL_TERM_DOC -o $@ $(DOCDIR)\doc2info.c $(DOCDIR)\termdoc.c $(DOCDIR)\xref.c
doc2rtf.exe:  $(DOCDIR)\doc2rtf.c $(DOCDIR)\termdoc.c $(DOCDIR)\xref.c $(OS2TERMS)
	$(CC3) $(CFLAGS3) $(TERMFLAGS) -DALL_TERM_DOC -o $@ $(DOCDIR)\doc2rtf.c $(DOCDIR)\termdoc.c $(DOCDIR)\xref.c
doc2ms.exe:   $(DOCDIR)\doc2ms.c $(DOCDIR)\termdoc.c $(OS2TERMS)
	$(CC3) $(CFLAGS3) $(TERMFLAGS) -DALL_TERM_DOC -o $@ $(DOCDIR)\doc2ms.c $(DOCDIR)\termdoc.c
#
# Create binary demo files
#
$(M)binary1: $(M)bf_test.exe
	cd $(DEMODIR) & bf_test.exe & cd ..
$(M)binary2: $(M)bf_test.exe
	cd $(DEMODIR) & bf_test.exe & cd ..
$(M)binary3: $(M)bf_test.exe
	cd $(DEMODIR) & bf_test.exe & cd ..
$(M)bf_test.exe : bf_test.c binary.$(O) alloc.$(O)
	$(CC3) $(CFLAGS3) -o $@ bf_test.c binary.$(O) alloc.$(O)
#
# Clean up
#

# Clean up all files temporary used
clean:
	IF EXIST *.$(O)                  DEL *.$(O)
	IF EXIST *.$(O2)                 DEL *.$(O2)
	cd $(OS2DIR) & IF EXIST *.$(O2)  DEL *.$(O2)
	IF EXIST $(OS2DIR)\gnupmdrv.res  DEL $(OS2DIR)\gnupmdrv.res
	IF EXIST demo\bf_test.exe        DEL demo\bf_test.exe
	IF EXIST doc2*.exe               DEL doc2*.exe
	IF EXIST gnuplot.ipf             DEL gnuplot.ipf
	IF EXIST core                    DEL core
	IF EXIST $(DOCDIR)\allterm.h     DEL $(DOCDIR)\allterm.h

# Clean up ALL files that were not part of the source distribution
veryclean: clean
	IF EXIST *.exe.exe               DEL gnuplot.exe
	IF EXIST gnupmdrv.hlp            DEL gnupmdrv.hlp
	IF EXIST gnuplot.gih             DEL gnuplot.gih
	IF EXIST gnuplot.inf             DEL gnuplot.inf
	IF EXIST gnuplot.dvi             DEL gnuplot.dvi
	IF EXIST gnuplot.htm             DEL gnuplot.htm
	IF EXIST gnuplot.tex             DEL gnuplot.tex
	IF EXIST gnuplot.texi            DEL gnuplot.texi
	IF EXIST gnuplot.info            DEL gnuplot.info
	IF EXIST gnuplot.ms              DEL gnuplot.ms
	IF EXIST gnuplot.rtf             DEL gnuplot.rtf
	IF EXIST gnuplot.ps              DEL gnuplot.ps
	cd demo & IF EXIST binary?       DEL binary?