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
|
/*
* Library imakefile info - this contains any special redefinitions, etc.
* that Imakefiles in the various library subtrees will need.
*
* Before including this, you must set the following boolean variables:
* DoNormalLib, DoSharedLib, DoDebugLib, DoProfileLib
*
* To get automatic generation of standard rules, also set the variables:
* LibName, SoRev, HasSharedData, and optionally HugeLibrary and IncSubdir
*/
XCOMM $XConsortium: Library.tmpl,v 1.33 95/05/05 19:31:31 kaleb Exp gildea $
#ifndef LibraryCplusplusOptions
#if DoSharedLib && defined(SharedLibraryCplusplusOptions)
#define LibraryCplusplusOptions SharedLibraryCplusplusOptions
#else
#define LibraryCplusplusOptions DefaultCplusplusOptions
#endif
#endif
#ifndef LibraryDefines
#define LibraryDefines StandardDefines
#endif
#ifndef LibraryCDebugFlags
#define LibraryCDebugFlags DefaultCDebugFlags
#endif
#ifndef LibraryCplusplusDebugFlags
#define LibraryCplusplusDebugFlags DefaultCplusplusDebugFlags
#endif
#ifndef SeparateSharedCompile
#define SeparateSharedCompile YES
#endif
#ifndef CplusplusSource
#ifndef LibraryCcCmd
#if DoSharedLib && defined(SharedLibraryCcCmd)
#define LibraryCcCmd SharedLibraryCcCmd
#else
#define LibraryCcCmd CcCmd
#endif
#endif
#ifndef LibraryCCOptions
#if DoSharedLib && defined(SharedLibraryCCOptions)
#define LibraryCCOptions SharedLibraryCCOptions
#else
#define LibraryCCOptions DefaultCCOptions
#endif
#endif
CC = LibraryCcCmd
CCOPTIONS = LibraryCCOptions
STD_DEFINES = LibraryDefines
CDEBUGFLAGS = LibraryCDebugFlags
#else
#ifndef LibraryCplusplusCmd
#if DoSharedLib && defined(SharedLibraryCplusplusCmd)
#define LibraryCplusplusCmd SharedLibraryCplusplusCmd
#else
#define LibraryCplusplusCmd CplusplusCmd
#endif
#endif
#ifndef LibraryCplusplusOptions
#if DoSharedLib && defined(SharedLibraryCplusplusOptions)
#define LibraryCplusplusOptions SharedLibraryCplusplusOptions
#else
#define LibraryCplusplusOptions DefaultCplusplusOptions
#endif
#endif
CXX = LibraryCplusplusCmd
CXXOPTIONS = LibraryCplusplusOptions
STD_DEFINES = LibraryDefines
CXXDEBUGFLAGS = LibraryCplusplusDebugFlags
#endif
#if DoDebugLib
#define _DebuggedLibMkdir() LibMkdir(debugger)
#ifndef CplusplusSource
#define _DebuggedObjCompile(options) DebuggedLibObjCompile(options)
#else
#define _DebuggedObjCompile(options) DebuggedLibObjCplusplusCompile(options)
#endif
#define _DebuggedCleanDir() LibCleanDir(debugger)
#else
#define _DebuggedLibMkdir() $(_NULLCMD_)
#define _DebuggedObjCompile(options) $(_NULLCMD_)
#define _DebuggedCleanDir() $(_NULLCMD_)
#endif
#if DoProfileLib
#define _ProfiledLibMkdir() LibMkdir(profiled)
#ifndef CplusplusSource
#define _ProfiledObjCompile(options) ProfiledLibObjCompile(options)
#else
#define _ProfiledObjCompile(options) ProfiledLibObjCplusplusCompile(options)
#endif
#define _ProfiledCleanDir() LibCleanDir(profiled)
#else
#define _ProfiledLibMkdir() $(_NULLCMD_)
#define _ProfiledObjCompile(options) $(_NULLCMD_)
#define _ProfiledCleanDir() $(_NULLCMD_)
#endif
#if !DoNormalLib
#define _NormalLibMkdir() $(_NULLCMD_)
#define _NormalObjCompile(options) $(_NULLCMD_)
#define _NormalCleanDir() $(_NULLCMD_)
#else
#if DoSharedLib && SeparateSharedCompile
#define _NormalLibMkdir() LibMkdir(unshared)
#ifndef CplusplusSource
#define _NormalObjCompile(options) UnsharedLibObjCompile(options)
#else
#define _NormalObjCompile(options) UnsharedLibObjCplusplusCompile(options)
#endif
#define _NormalCleanDir() LibCleanDir(unshared)
#else
#define _NormalLibMkdir() $(_NULLCMD_)
#ifndef CplusplusSource
#define _NormalObjCompile(options) NormalLibObjCompile(options)
#else
#define _NormalObjCompile(options) NormalLibObjCplusplusCompile(options)
#endif
#define _NormalCleanDir() $(_NULLCMD_)
#endif
#endif
#if !DoSharedLib || (DoNormalLib && !SeparateSharedCompile)
#define _SharedObjCompile(options) $(_NULLCMD_)
#else
#if SeparateSharedCompile
#ifndef CplusplusSource
#define _SharedObjCompile(options) NormalSharedLibObjCompile(options)
#else
#define _SharedObjCompile(options) NormalSharedLibObjCplusplusCompile(options)
#endif
#else
#ifndef CplusplusSource
#define _SharedObjCompile(options) NormalLibObjCompile(options)
#else
#define _SharedObjCompile(options) NormalLibObjCplusplusCompile(options)
#endif
#endif
#endif
#ifndef CplusplusSource
#define SRCsuf c
#else
#define SRCsuf CCsuf
#ifdef SunArchitecture
.SUFFIXES: .CCsuf
#endif
#endif
#ifndef LibraryObjectRule
#define LibraryObjectRule() @@\
all:: @@\
_DebuggedLibMkdir() @@\
_ProfiledLibMkdir() @@\
_NormalLibMkdir() @@\
@@\
includes:: @@\
_DebuggedLibMkdir() @@\
_ProfiledLibMkdir() @@\
_NormalLibMkdir() @@\
@@\
.SRCsuf.Osuf: @@\
_DebuggedObjCompile($(_NOOP_)) @@\
_ProfiledObjCompile($(_NOOP_)) @@\
_NormalObjCompile($(_NOOP_)) @@\
_SharedObjCompile($(_NOOP_)) @@\
@@\
clean:: @@\
_DebuggedCleanDir() @@\
_ProfiledCleanDir() @@\
_NormalCleanDir() @@\
#endif /* LibraryObjectRule */
#ifndef SpecialLibObjectRule
#define SpecialLibObjectRule(objs,depends,options) @@\
objs: depends @@\
_DebuggedObjCompile(options) @@\
_ProfiledObjCompile(options) @@\
_NormalObjCompile(options) @@\
_SharedObjCompile(options) @@\
#endif /* SpecialLibObjectRule */
#ifndef SpecialCLibObjectRule
#define SpecialCLibObjectRule(basename,depends,options) @@\
SpecialLibObjectRule(basename.Osuf,basename.SRCsuf depends,options) @@\
@@\
basename.i: basename.SRCsuf depends @@\
CPPOnlyCompile(basename.SRCsuf,options) @@\
@@\
CenterLoadTarget(debug_src,basename.SRCsuf,NullParameter,$(ALLDEFINES) options)
#endif /* SpecialCLibObjectRule */
#ifndef SpecialCplusplusLibObjectRule
#define SpecialCplusplusLibObjectRule(basename,depends,options) @@\
SpecialLibObjectRule(basename.Osuf,basename.SRCsuf depends,options) @@\
@@\
CenterLoadTarget(debug_src,basename.SRCsuf,NullParameter,$(ALLDEFINES) options)
#endif /* SpecialCplusplusLibObjectRule */
/*
* ToolkitMakeStrings generates a string-table, i.e., a C source
* file and the matching header(s), e.g., Xt's StringDefs.c, StringDefs.h,
* and Shell.h files; or Motif's XmStrDefs.c and XmStrDefs.h files.
*
* The 'files' argument is the list of files that will be produced by
* this rule, e.g., for Xt they would be "Shell.h StringDefs.c StringDefs.h"
* and for Motif they would be "XmStrDefs.c XmStrDefs.h".
*
* The 'source' argument is the string-list file to be parsed, e.g., in
* Xt that would be "util/string.list". For Motif 2.0 it would be
* "../../tools/makestr/xmstring.list", and for Motif-CDE1 it would be
* "util/xmstring.list".
*
* The 'options' argument is passed by the library's Imakefile, see the
* Xt Imakefile for an example. Typically this would be nothing, -intelabi,
* or -sparcabi; there are other choices, but these are typical.
*
* The 'depends' argument names additional files the target files
* depend on. It should name the #ctmpl and #htmpl files from the
* 'source' file.
*
* The 'dest' argument is the C source output file. For Xt this should
* be "StringDefs.c", and for all versions of Motif it would be "XmStrDefs.c"
*
* Headers are generated and named according to data in the 'source'
* file.
*/
#ifndef ToolkitMakeStrings
#define ToolkitMakeStrings(files,source,options,depends,dest) @@\
MAKESTRS = $(CONFIGSRC)/util/makestrs @@\
@@\
$(MAKESTRS): $(MAKESTRS).c @@\
cd $(CONFIGSRC)/util && make makestrs @@\
@@\
files: $(MAKESTRS) source depends @@\
RemoveFiles(files) @@\
RunProgram(MAKESTRS,options < source > dest) @@\
@@\
AllTarget(files) @@\
@@\
includes:: files @@\
@@\
depend:: files
#endif /* ToolkitMakeStrings */
#ifdef LibName
LIBNAME = LibName
LibraryObjectRule()
#undef _LinkBuildLibrary
#define _LinkBuildLibrary(lib) LinkBuildLibrary(lib)
#if DoSharedLib
SharedLibraryTarget($(LIBNAME),$(SoRev),$(OBJS),.,.)
InstallSharedLibrary($(LIBNAME),$(SoRev),$(SHLIBDIR))
#if HasSharedData
SharedLibraryDataTarget($(LIBNAME),$(SoRev),$(UNSHAREDOBJS))
InstallSharedLibraryData($(LIBNAME),$(SoRev),$(SHLIBDIR))
#endif
#endif
#if DoNormalLib
#if HugeLibrary
#if DoSharedLib && SeparateSharedCompile
UnsharedLibraryTarget3($(LIBNAME),$(OBJS1),$(OBJS2),$(OBJS3),unshared,..)
#else
NormalLibraryTarget3($(LIBNAME),$(OBJS1),$(OBJS2),$(OBJS3))
#endif
#else
#if DoSharedLib && SeparateSharedCompile
UnsharedLibraryTarget($(LIBNAME),$(OBJS),unshared,..)
#else
NormalLibraryTarget($(LIBNAME),$(OBJS))
#endif
#endif
InstallLibrary($(LIBNAME),$(USRLIBDIR))
#endif
#if DoProfileLib
ProfiledLibraryTarget($(LIBNAME),$(OBJS))
InstallLibrary($(LIBNAME)_p,$(USRLIBDIR))
#endif
#if DoDebugLib
DebuggedLibraryTarget($(LIBNAME),$(OBJS))
InstallLibrary($(LIBNAME)_d,$(USRLIBDIR))
#endif
LintLibraryTarget($(LIBNAME),$(SRCS))
InstallLintLibrary($(LIBNAME),$(LINTLIBDIR))
#ifdef IncSubdir
BuildIncludes($(HEADERS),IncSubdir,..)
InstallMultipleFlags($(HEADERS),$(INCDIR)/IncSubdir,$(INSTINCFLAGS))
#else
#ifndef CplusplusSource
#if !defined(LibHeaders) || LibHeaders
BuildIncludesTop($(HEADERS))
InstallMultipleFlags($(HEADERS),$(INCDIR),$(INSTINCFLAGS))
#endif
#endif
#endif
NormalLintTarget($(SRCS))
#endif
|