File: makefile.os2

package info (click to toggle)
gnuplot 3.5beta6.347-3
  • links: PTS
  • area: main
  • in suites: slink
  • size: 5,032 kB
  • ctags: 4,235
  • sloc: ansic: 42,086; makefile: 561; asm: 539; sh: 386; objc: 379; csh: 297; pascal: 194; perl: 138; lisp: 88
file content (240 lines) | stat: -rw-r--r-- 8,210 bytes parent folder | download
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
#
# $Id: makefile.os2,v 1.27 1998/04/14 00:15:54 drd Exp $
#
# Makefile for use with emx and nmake
# for compiling for OS/2 2.0 and above
#
# Authors: Roger Fearick, Rolf Niepraschk and Alexander Mai
#
# release: 19970520
#
# todo:
#   - X11-support
#   - build doc2*.exe in $(D) ?
#   - create a makefile for use with GNUMake ??
#       (ipfc from IBM Developer's Toolkit for OS/2 is required for
#        building some help files, so NMake should also be available)
#   - clean up makefile.os2
#
default:
   @echo Usage: $(MAKE) -f makefile.os2 target {defines}
   @echo ----------------------------------------------------------------
   @echo    target is one of:
   @echo       all runtime docs demo (executables infomin clean veryclean)
   @echo    possible defines are GD=  , PNG=  , VESA= ,  DEBUG=
   @echo       GD    includes the GD-library for gif support
   @echo       PNG   includes the PNG-library
   @echo       VESA  includes the SVGA/VESAkit terminal driver
   @echo       DEBUG generates binaries for debugging
#
# definitions of flags and symbols used by makefile.all and makefile.os2
#
# these definitions are used by makefile.all
SL=\ # <-- don't remove
T=term$(SL)
D=docs$(SL)
L=$(D)latextut$(SL)
M=demo$(SL)
#
# definitions valid for every target on OS/2
#
# directory where OS/2-driver is
OS2 = os2
# pre-defined sets of targets:
all:         runtime demo docs
docs:        gnuplot.gih gnuplot.inf gnuplot.html gnuplot.info gnuplot.dvi gnuplot.ps
runtime:     executables infomin gnuplot.inf
executables: gnuplot.exe gnupmdrv.exe
infomin:     gnupmdrv.hlp gnuplot.gih
demo:        $(M)binary1 $(M)binary2 $(M)binary3
#
# 3 sets of variables are defined and used to create
#  (1): files for gnuplot.exe
#   2 : files for gnupmdrv.exe (the PM-driver executable) 
#   3 : utilities (doc2*.exe, bf_test, ?)
#
CC =gcc
CC2=gcc
CC3=gcc
O =o
O2=obj
O3=o 
# generic flags for compiler and linker under OS/2
OS2FLAGS = -DOS2
# flags for compiling with EMX/GCC
EMXSPECIFIC = -DGETCWD -DREADLINE -DHAVE_STRNICMP -DPIPES
! IFDEF DEBUG
CFLAGS  = $(OS2FLAGS) -g
LFLAGS  = -Zstack 32768
CFLAGS2 = $(OS2FLAGS) -Zomf -Zsys -Zmt -g
LFLAGS2 = -Zomf -Zmt -Zsys -Zlinker /debug
CFLAGS3 = $(OS2FLAGS) $(EMXSPECIFIC) -g
LFLAGS3 = 
! ELSE
CFLAGS  = $(OS2FLAGS) -O2
LFLAGS  = -s -Zstack 32768 -Zcrtdll 
CFLAGS2 = $(OS2FLAGS) -Zomf -Zsys -Zmt -O2 
LFLAGS2 = -Zomf -Zmt -Zsys -s
CFLAGS3 = $(OS2FLAGS) $(EMXSPECIFIC) -O2
LFLAGS3 = -s
! ENDIF
#
# necessary libraries and add-ons (not terminal related)
#
LIBS = 
TERMFLAGS = -I. -I$(T)
# (some terminals have to be en/disabled in term.h)
# SVGA-/VESAkit support
! IFDEF VESA
TERMFLAGS=$(TERMFLAGS) -DEMXVESA
TERMLIBS = -ljmgraph -lvesa
! ENDIF
# GIF-support
! IFDEF GD
TERMFLAGS=$(TERMFLAGS) -DHAVE_LIBGD
TERMLIBS = $(TERMLIBS) -lgd
! ENDIF
# PNG-support
! IFDEF PNG
TERMFLAGS=$(TERMFLAGS) -DHAVE_LIBPNG
TERMLIBS = $(TERMLIBS) -lpng -lz
! ENDIF
#
# default rules
#
.c.$(O):
   $(CC)  $(CFLAGS) $(TERMFLAGS) $(EMXSPECIFIC) -o $*.$(O) -c $*.c
.c.obj:
   $(CC2) $(CFLAGS2) -o $*.obj -c $*.c
#
# include dependencies valid for all platforms from makefile.all
#
! INCLUDE makefile.all
# special rule to build graphics.o ( -O2 does not work properly here )
graphics.o: graphics.c
! IFDEF DEBUG
   $(CC) $(OS2FLAGS) $(EMXSPECIFIC) -g -o $@ -c graphics.c
! ELSE
   $(CC) $(OS2FLAGS) $(EMXSPECIFIC) -O1 -o $@ -c graphics.c
! ENDIF
OBJS = $(COREOBJS) version.$(O)
gnuplot.exe: $(OBJS)
   $(CC) -o $@ $(OBJS) $(TERMLIBS) $(LIBS) $(LFLAGS)
# we need a better way to specify dependencies of included terminals ...
OS2TERMS= $(T)\pm.trm $(T)\emxvga.trm
term.$(O): $(OS2TERMS) term.h
#
# building the PM-driver
#
$(OS2)\gnupmdrv.$(O2): $(OS2)\gnupmdrv.c $(OS2)\gnupmdrv.h
$(OS2)\gclient.$(O2):  $(OS2)\gclient.c $(OS2)\gnupmdrv.h
$(OS2)\dialogs.$(O2):  $(OS2)\dialogs.c $(OS2)\gnupmdrv.h $(OS2)\dialogs.h
$(OS2)\print.$(O2):    $(OS2)\print.c $(OS2)\gnupmdrv.h
$(OS2)\gnupmdrv.res :  $(OS2)\gnupmdrv.rc $(OS2)\gnuplot.ico $(OS2)\dialogs.h
   "cd $(OS2) && rc -r gnupmdrv.rc && cd $(MAKEDIR)"
OS2OBJ = $(OS2)\gnupmdrv.$(O2) $(OS2)\gclient.$(O2) $(OS2)\print.$(O2) \
         $(OS2)\dialogs.$(O2)
gnupmdrv.exe: $(OS2OBJ) $(OS2)\gnupmdrv.res $(OS2)\gnupmdrv.def 
   $(CC2) $(LFLAGS2) -o $@ $(OS2OBJ) $(OS2)\gnupmdrv.res $(OS2)\gnupmdrv.def
gnupmdrv.hlp: $(OS2)\gnupmdrv.ipf
   ipfc $(OS2)\gnupmdrv.ipf
   move $(OS2)\gnupmdrv.hlp .
#
# create the documentation in various formats
#
# you have to change the call to LaTeX if the following does not work
gnuplot.dvi: gnuplot.tex
   copy gnuplot.tex $(D)gnuplot_2.tex
   cd docs
   latex2e gnuplot_2.tex
   mv gnuplot_2.dvi ..\gnuplot.dvi
   rm gnuplot_2*
   cd ..
gnuplot.tex:  $(D)gnuplot.doc doc2tex.exe
   doc2tex $(D)gnuplot.doc gnuplot.tex
gnuplot.ps: gnuplot.dvi
   dvips -o gnuplot.ps gnuplot.dvi
gnuplot.inf:  doc2ipf.exe $(D)gnuplot.doc
   doc2ipf $(D)gnuplot.doc $(D)gnuplot.ipf
   ipfc -i $(D)gnuplot.ipf gnuplot.inf
gnuplot.gih:  $(D)gnuplot.doc doc2gih.exe 
   doc2gih $(D)gnuplot.doc gnuplot.gih
gnuplot.html: $(D)gnuplot.doc doc2html.exe
   doc2html $(D)gnuplot.doc gnuplot.html
gnuplot.info: $(D)gnuplot.doc doc2info.exe
   doc2info <$(D)gnuplot.doc >gnuplot.info
gnuplot.texi: $(D)gnuplot.doc $(D)doc2texi.pl
   perl $(D)doc2texi.pl $(D)gnuplot.doc >$(D)gnuplot.texi
gnuplot.rtf:  $(D)gnuplot.doc doc2rtf.exe
   doc2rtf $(D)gnuplot.doc gnuplot.rtf
gnuplot.ms:   $(D)gnuplot.doc doc2ms.exe
   doc2ms $(D)gnuplot.doc gnuplot.ms
#
# tools for converting the documentation from docs\gnuplot.doc
# in various formats
#
doc2gih.exe doc2ipf.exe doc2html.exe doc2info.exe doc2tex.exe doc2rtf.exe: \
            $(D)xref.c term.h
# Do you like to have all terminal documentations in your docs ?
# => use the line(s) below
# doc2gih.exe doc2ipf.exe doc2html.exe doc2info.exe doc2tex.exe doc2rtf.exe: \
#             $(D)xref.c $(D)allterm.h
$(D)allterm.h: $(CORETERM)
   type NUL > $@
   type $(T)*.trm >> $@
doc2gih.exe:  $(D)doc2gih.c $(OS2TERMS)
   $(CC3) $(CFLAGS3) $(TERMFLAGS) -o $@ $(D)doc2gih.c
doc2ipf.exe:  $(D)doc2ipf.c $(OS2TERMS)
   $(CC3) $(CFLAGS3) $(TERMFLAGS) -o $@ $(D)doc2ipf.c
doc2tex.exe:  $(D)doc2tex.c $(OS2TERMS) $(D)allterm.h
   $(CC3) $(CFLAGS3) $(TERMFLAGS) -o $@ $(D)doc2tex.c
doc2html.exe: $(D)doc2html.c $(OS2TERMS)
   $(CC3) $(CFLAGS3) $(TERMFLAGS) -o $@ $(D)doc2html.c
doc2info.exe: $(D)doc2info.c $(OS2TERMS)
   $(CC3) $(CFLAGS3) $(TERMFLAGS) -o $@ $(D)doc2info.c
doc2rtf.exe:  $(D)doc2rtf.c $(OS2TERMS)
   $(CC3) $(CFLAGS3) $(TERMFLAGS) -o $@ $(D)doc2rtf.c
doc2ms.exe:   $(D)doc2ms.c $(OS2TERMS)
   $(CC3) $(CFLAGS3) $(TERMFLAGS) -o $@ $(D)doc2ms.c
#
# create binary demo files
#
$(M)binary1 $(M)binary2 $(M)binary3: $(M)bf_test.exe
   "cd $(M). && bf_test && cd $(MAKEDIR)"
$(M)bf_test.exe : bf_test.c binary.$(O) alloc.$(O)
   $(CC3) $(CFLAGS3) -o $@ bf_test.c binary.$(O) alloc.$(O)
#
# clean up temporary files
#
clean:
   IF EXIST *.$(O)          DEL *.$(O)
   IF EXIST *.$(O2)         DEL *.$(O2)
   IF EXIST $(OS2)\*.$(O2)  DEL $(OS2)\*.$(O2)
   IF EXIST $(M)bf_test.exe DEL $(M)bf_test.exe
   IF EXIST doc2gih.exe     DEL doc2gih.exe
   IF EXIST doc2ipf.exe     DEL doc2ipf.exe
   IF EXIST doc2tex.exe     DEL doc2tex.exe
   IF EXIST doc2html.exe    DEL doc2html.exe
   IF EXIST doc2info.exe    DEL doc2info.exe
   IF EXIST doc2rtf.exe     DEL doc2rtf.exe
   IF EXIST gnuplot.ipf     DEL gnuplot.ipf
   IF EXIST $(D)allterm.h   DEL $(D)allterm.h
# clean up _all_ files that were not part of the source distribution
veryclean: clean
   IF EXIST gnuplot.exe     DEL gnuplot.exe
   IF EXIST gnupmdrv.exe    DEL gnupmdrv.exe
   IF EXIST gnuplot_x11.exe DEL gnuplot_x11.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
   IF EXIST $(M)binary1     DEL $(M)binary1
   IF EXIST $(M)binary2     DEL $(M)binary2
   IF EXIST $(M)binary3     DEL $(M)binary3