File: Imakefile

package info (click to toggle)
xmhtml 1.1.7-18
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 6,576 kB
  • sloc: ansic: 68,174; makefile: 438; sh: 158; perl: 36
file content (327 lines) | stat: -rw-r--r-- 9,414 bytes parent folder | download | duplicates (5)
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
XCOMM
XCOMM Imakefile for XmHTML
XCOMM
XCOMM (C)Copyright 1995-1997 Ripley Software Development
XCOMM All Rights Reserved
XCOMM
XCOMM This file is part of the XmHTML Widget Library.
XCOMM
XCOMM See the file LICENSE for the full copyright statement.
XCOMM
XCOMM Note: this Imakefile is becoming increasingly complex.

XCOMM Include the XmHTML configuration file
#include "../XmHTML.cf"

XCOMM No need to change anything below this line
XCOMM

XCOMM SGI requires a specification file for shared library that we don't have
XCOMM (Irix below 6.2)
#if defined(SGIArchitecture) && !SystemV4 && HasSharedLibraries && \
	(OSMajorVersion <= 6) && (OSMinorVersion <= 4)
# undef SharedLibXmHTML
# undef NormalLibXmHTML
# define SharedLibXmHTML NO
# define NormalLibXmHTML YES
#endif

XCOMM Linux requires a specification file for a.out shared libraries that we
XCOMM don't have.
XCOMM
#if defined(LinuxArchitecture) && defined(UseElfFormat) && (UseElfFormat == NO)
# undef SharedLibXmHTML
# undef NormalLibXmHTML
# define SharedLibXmHTML NO
# define NormalLibXmHTML YES
#endif 

XMHTMLLIBDIR = XmHTMLLibDir
XMHTMLINCDIR = XmHTMLIncDir
      INCDIR = XmHTMLIncDir

XCOMM Get version numbering for shared libraries from the XmHTML include file
#define _LIBRARY
#include "XmHTML.h"

XCOMM Make translation from make variables to Imake variables
XCOMM (convention is that all uppercase are Make variables, mixed case are
XCOMM Imake variables)
#ifndef XmHTMLVERSION 
#define XmHTMLVERSION 1
#endif
#ifndef XmHTMLREVISION 
#define XmHTMLREVISION 1
#endif
#ifndef XmHTMLUPDATE_LEVEL
#define XmHTMLUPDATE_LEVEL 2
#endif

XmHTMLVersionNum = XmHTMLVERSION
XmHTMLRevision = XmHTMLREVISION
XmHTMLUpdateLevel = XmHTMLUPDATE_LEVEL

XCOMM I don't know whether or not X11R5/R4 image has got a Concat3.
XCOMM This works.
XCOMM Warning: Project X can be 603 (for X11R6.3), which while still passing
XCOMM the following test maybe something to keep track of -- offer
#if (ProjectX < 6)
SOXMHTMLLIBREV = $(XmHTMLVersionNum)./**/$(XmHTMLRevision)./**/$(XmHTMLUpdateLevel)

#elif defined (SGIArchitecture)
SOXMHTMLLIBREV = Concat3(.$(XmHTMLVersionNum).,$(XmHTMLRevision).,$(XmHTMLUpdateLevel))

XCOMM setting this variable should stop warnings during link, and adds code 
XCOMM to automatically pull in these libs whenever -lXmHTML is seen. 
XCOMM --- offer (tested on Irix 6.5 but is needed for all versions of Irix)
XCOMM
LDREQLIBS = $(XMLIB) $(XTOOLLIB) $(XLIB) $(EXTENSIONLIB) SharedX11Reqs $(IMAGELIBS) 

XCOMM Not X11R6 and not running on an SGI.
# else
SOXMHTMLLIBREV = Concat3($(XmHTMLVersionNum).,$(XmHTMLRevision).,$(XmHTMLUpdateLevel))

XCOMM Setting this variable adds code to automatically pull in the image
XCOMM libraries whenever -lXmHTML is seen. This should work on at least Linux
XCOMM and a number of BSD variants. The only way to find out if your system
XCOMM supports this is to try and build a simple program (any of the programs
XCOMM in books/ will do) and exclude the image libraries on the link line.
XCOMM If you get unresolved errors about jpeg, png and/or zlib functions
XCOMM you're out of luck.
XCOMM
XCOMM On at least Linux, adding the X libraries as well leads to a link
XCOMM error when -lXmHTML is used.
XCOMM
XCOMM Fuck me, Imake should be portable. It's bloody far from that. Sigh.
#  if defined (AIXArchitecture)
REQUIREDLIBS = $(IMAGELIBS) XmClientLibs
#    else
REQUIREDLIBS = $(IMAGELIBS)
#  endif /* AIXArchitecture
XCOMM # endif /* SGIArchitecture */
#endif /* X < X11R6 */

XCOMM
XCOMM Public header files
BASEHDRS = XmHTML.h XmHTMLP.h XmHTMLI.h HTML.h Balloon.h BalloonP.h

XCOMM
XCOMM Header files used by various other targets in the XmHTML source tree
PUBHDRS  = XmHTMLfuncs.h LZWStream.h XCC.h miniparse.h stack.h

XCOMM
XCOMM Header files generated during compilation (via mkStrings)
GENHDRS  = HTMLStrings.h HTMLWarnings.h

XCOMM
XCOMM List of headers to be installed
INSTHDRS = $(BASEHDRS) HTMLStrings.h

XCOMM List of all headers
HEADERS  = $(BASEHDRS) $(GENHDRS) $(PUBHDRS)

XCOMM
XCOMM All source files that make up the XmHTML Widget Set
BASESRCS = XmHTML.c Balloon.c XmImage.c fonts.c callbacks.c frames.c \
forms.c StringUtil.c parse.c format.c layout.c paint.c colors.c \
images.c readBitmap.c readFLG.c readGIF.c readGIFplc.c readXPM.c readJPEG.c \
readJPEGplc.c readPNG.c map.c XCC.c quantize.c LZWStream.c plc.c \
error.c events.c textsel.c output.c motif.c stack.c \
public.c private.c

BASEOBJS = XmHTML.o Balloon.o XmImage.o fonts.o callbacks.o frames.o \
forms.o StringUtil.o parse.o format.o layout.o paint.o colors.o \
images.o readBitmap.o readFLG.o readGIF.o readGIFplc.o readXPM.o readJPEG.o \
readJPEGplc.o readPNG.o map.o XCC.o quantize.o LZWStream.o plc.o \
error.o events.o textsel.o output.o motif.o stack.o \
public.o private.o

XCOMM
XCOMM Source files generated during compilation (via mkStrings)
GENSRCS  = strings.c warnings.c
GENOBJS  = strings.o warnings.o

#if (IHavePosixRegex)
EXTRASRC =
EXTRAOBJ =
#else
EXTRASRC = regex.c
EXTRAOBJ = regex.o
#endif

#if (IWantDebug)
DEBSRC = debug.c debug_menu.c
DEBOBJ = debug.o debug_menu.o
#else
DEBSRC =
DEBOBJ =
#endif

SRCS = $(BASESRCS) $(GENSRCS) $(EXTRASRC) $(DEBSRC)
OBJS = $(BASEOBJS) $(GENOBJS) $(EXTRAOBJ) $(DEBOBJ)

INSTALLFLAGS = $(INSTINCFLAGS)

#define DoSharedLib SharedLibXmHTML
#define DoNormalLib NormalLibXmHTML
#define DoDebugLib  DebugLibXmHTML

#if (ProjectX < 5)
STD_DEFINES = LibraryDefines
CDEBUGFLAGS = LibraryCDebugFlags
#else
# define LibName XmHTML
# define SoRev SOXMHTMLLIBREV
XCOMM dumb stuff to prevent generation of bad includes:: rule
# define LibHeaders foo
# include <Library.tmpl>
#endif

XCOMM
XCOMM Ruleset for doing make includes
XCOMM
XCOMM First a collection of rules to build strings.c, warnings.c,
XCOMM HTMLStrings.h and HTMLWarnings.h
XCOMM We don't want this installed so we need to define our own compilation
XCOMM and link rules for mkStrings.
XCOMM
SpecialObjectRule(mkStrings.o, mkStrings.c,)

XCOMM Fixup for pre-R6 imake configs (Solaris 2.5 misses this)
XCOMM Rohan Korde <rohan@ics.com>

#ifndef RunProgram
#define RunProgram(progvar,options) $(progvar) options
#endif

#ifndef CCLINK
CCLINK = $(CC)
#endif

/*
* LinkRule - link a program
*/
#ifndef LinkRule
#define LinkRule(program,options,objects,libraries) \
$(CCLINK) -o program options objects libraries $(EXTRA_LOAD_FLAGS)
#endif /* LinkRule */

mkStrings:: mkStrings.o
	LinkRule(mkStrings,,mkStrings.o,)

XCOMM
XCOMM Generate the resource & warning string tables.
strings: mkStrings strings.lst warnings.lst
	RunProgram(,./mkStrings XmHTML c < strings.lst > strings.c)
	RunProgram(,./mkStrings XmHTML h < strings.lst > HTMLStrings.h)
	RunProgram(,./mkStrings XmHTML c w < warnings.lst > warnings.c)
	RunProgram(,./mkStrings XmHTML h w < warnings.lst > HTMLWarnings.h)
	touch $@

LinkFileList(link-includes,$(HEADERS), ../include/XmHTML,../../src)

#if (IHavePosixRegex)
stamp-includes: strings link-includes
	touch link-includes
	touch $@
#else
XCOMM
XCOMM Additional rules for proper building of compat/regex.c
XCOMM Links the files in compat to the current directory and introduces
XCOMM a dependency rule for GNUregex.h
XCOMM
LinkSourceFile(regex.c,compat)
LinkSourceFile(GNUregex.h,compat)

compat: regex.c GNUregex.h

stamp-includes: strings compat link-includes
	touch link-includes
	touch $@
#endif

includes:: stamp-includes

XCOMM No stuff required when X revision >= 6, Library.tmpl does it for us
XCOMM

#if (ProjectX < 6)
# if (ProjectX < 5)

#  if DoSharedLib
SharedLibraryObjectRule()
NormalSharedLibraryTarget(XmHTML,$(SOXMHTMLLIBREV),$(OBJS))
InstallSharedLibrary(XmHTML,$(SOXMHTMLLIBREV),$(XMHTMLLIBDIR))
#   else /* No shared libs */
NormalLibraryObjectRule()
#  endif /* DoSharedLib */
NormalLibraryTarget(XmHTML,$(OBJS))
InstallLibrary(XmHTML,$(XPMLIBDIR))

#  if DoDebugLib
DebuggedLibObjCompile()
DebuggedLibraryTarget(XmHTML,$(OBJS))
#  endif /* DoDebugLib */

# else /* ProjectX == 5 */
LibraryObjectRule()

#  if DoSharedLib
SharedLibraryTarget(XmHTML,$(SOXMHTMLLIBREV),$(OBJS),shared,..)
InstallSharedLibrary(XmHTML,$(SOXMHTMLLIBREV),$(XMHTMLLIBDIR))
#  endif /* DoSharedLib */

#  if DoNormalLib
NormalLibraryTarget(XmHTML,$(OBJS))
InstallLibrary(XmHTML,$(XMHTMLLIBDIR))
#  endif /* DoNormalLib */

#  if DoDebugLib
DebuggedLibraryTarget(XmHTML,$(OBJS))
InstallLibrary(XmHTML_d,$(XMHTMLLIBDIR))
#  endif /* DoDebugLib */

# endif /* ProjectX < 5 */

#else /* X11R6 */
XCOMM make a compiler friendly target libXmHTML.so

#if DoSharedLib
install all:: lib$(LIBNAME).so 

#ifdef SGIArchitecture
XCOMM Matches previous hack of SOXMHTMLLIBREV above. SOXMHTMLLIBREV now 
XCOMM contains a leading dot ('.')  --- offer
lib$(LIBNAME).so: lib$(LIBNAME).so$(SOXMHTMLLIBREV)
	$(RM) $@
	ln -s $@$(SOXMHTMLLIBREV) $@
#else
lib$(LIBNAME).so: lib$(LIBNAME).so.$(SOXMHTMLLIBREV)
	$(RM) $@
	ln -s $@$(SOXMHTMLLIBREV) $@
#endif /* SGIArchitecture */

clean::
	$(RM) lib$(LIBNAME).so 
#endif /* DoSharedLib */

#endif /* ProjectX < 6 */

XCOMM rule to install header files
InstallMultiple($(INSTHDRS),$(XMHTMLINCDIR))

depend:: $(SRCS)

DependTarget()

XCOMM Special rule for creating a distribution with the barebone makefiles
XCOMM
distclean:: clean 
	$(RM) libXmHTML.so.*
	$(RM) mkStrings strings $(GENSRCS) $(GENHDRS)
	$(RM) -r debugger shared unshared
	$(RM) -r regex.c GNUregex.h
	$(RM) core *.out make.world *.bak *.last *.auto
	$(RM) stamp-includes link-includes
	$(CP) Makefile.org Makefile