File: Makefile

package info (click to toggle)
xmhtml 1.1.7-7
  • links: PTS
  • area: main
  • in suites: woody
  • size: 6,104 kB
  • ctags: 8,347
  • sloc: ansic: 68,063; makefile: 496; sh: 161; perl: 36
file content (323 lines) | stat: -rw-r--r-- 10,651 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
##############################################################################
#                                                                            #
# Makefile.org: default XmHTML makefile.                                     #
# Adjust at will                                                             #
#                                                                            #
##############################################################################
#                                                                            #
# (C)Copyright 1995-1997 Ripley Software Development                         #
# All Rights Reserved                                                        #
#                                                                            #
# This file is part of the XmHTML Widget Library.                            #
#                                                                            #
# This library is free software; you can redistribute it and/or              #
# modify it under the terms of the GNU Library General Public                #
# License as published by the Free Software Foundation; either               #
# version 2 of the License, or (at your option) any later version.           #
#                                                                            #
# This library is distributed in the hope that it will be useful,            #
# but WITHOUT ANY WARRANTY; without even the implied warranty of             #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU          #
# Library General Public License for more details.                           #
#                                                                            #
# You should have received a copy of the GNU Library General Public          #
# License along with this library; if not, write to the Free                 #
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.         #
##############################################################################
#
# The defaults in this Makefile are for Linux.

# Don't change this number!
VERSION = 1107
ARCHIVE = 1.1.7

# Target toolkit
# Possible choices: Motif, gtk
# Both targets might require you to adjust the LIBS and LIBDIR directives.
PLATFORM=Motif

# Directories in which to build. If you don't want the examples build,
# remove the examples directory from this line.
# If you want to build the XmHTML tutorial examples, add the book directory.

SUBDIRS= lib http examples tools

# some common definitions
#
CP    = cp
RM    = rm -f
MV    = mv
LN    = ln -sf

# for building the library. 
AR    = ar cq 
# replace with echo or /bin/true if you system doesn't have/need ranlib
RANLIB= ranlib

SHELL     = /bin/sh
MAKE      = make 
# change this to makedepend if your system doesn't have gcc
MAKEDEPEND= gccmakedep

#####################
#                   #
# Compiler Settings #
#                   #
#####################
CC       = gcc
CFLAGS   = -g -funroll-loops -Wall -pipe -ansi $(EXTRA_CFLAGS)
LDFLAGS  = 

# The following flags are *very* usefull if you are getting unresolved
# references to functions in libraries that you *know* to exist.
# When used, they cause ld to list its search for libraries, the object
# files it is considering for linking and a bunch of other information.
# It helped me to track down an incorrect version of libz that was
# lingering around in a directory where I never expected it to be.
# Note: these flags are for gcc!
# LDFLAGS  = -Wl,-t -Wl,--verbose

# Image Support
# libXpm *is* required
# JPEG images (jpeglib.h and libjpeg)          => -DHAVE_LIBJPEG
# PNG images  (png.h, zlib.h, libz and libpng) => -DHAVE_LIBPNG
# GZF images  (zlib.h and libz)                => -DHAVE_LIBZ or -DHAVE_LIBPNG
#
# You can configure the Progressive Image Loading to use either timeouts or
# work procedures. The default is to use timeouts (XmHTML will cycle through
# each image that is to be loaded progressively using a dynamically computed
# polling interval). If you want XmHTML to use work procedures, you need to 
# define PLC_WORKPROCS
# The differences between the two methods are:
# timeouts:  XmHTML is quite responsive to user-input, image loading not
#            really fast (but neither really slow). Polling interval is
#            computed dynamically depending on the state of each PLC (suspended
#            versus active); 
# workprocs: XmHTML not really responsive, image loading quite fast.
#
# Dithering: there are two algorithms available that allow XmHTML to construct
# a default palette if none has been specified.
# default: the default algorithm constructs an evenly distributed palette in
#          RGB space but is not always able to match the requested number of
#          colors and requires a minumum of 8 colors.
# simple:  this is the alternative, which always creates a palette with the
#          requested number of colors but does not always succeed in creating
#          an evenly distributed palette. It is selected by defining
#          DITHER_SIMPLE_COLORMAP.

IMAGEDEFINES = -DHAVE_LIBJPEG -DHAVE_LIBPNG

# Header file locations. Add path to xpm.h if it isn't in the X11 include
# directory. Depending on the selected image support, the compiler needs to
# be able to find the following header files:
# HAVE_LIBJPEG => jpeglib.h
# HAVE_LIBPNG  => png.h and zlib.h
# HAVE_LIBZ => zlib.h

ZLIBINC       =
IMAGEINCLUDES = $(ZLIBINC)

# Image libraries
# No need to add -lXpm if you need to include it with LIBS below
# Depending on selected image support your linker needs to find the following
# libraries:
# HAVE_LIBJPEG => libjpeg
# HAVE_LIBPNG  => libpng and libz (and possibly libm)
# HAVE_LIBZ => libz (and possibly libm)

ZLIBLIB   = -lz -lm
IMAGELIBS = -ljpeg -lpng $(ZLIBLIB)

# It might be troublesome to know what the correct defines are for your
# system. A possible set of defines for some OS's is given below. Pick
# your choice.
#
# HPUX:
# 	-D_HPUX_SOURCE -D_POSIX_SOURCE
#
# Linux:
#	-D_BSD_SOURCE -D_GNU_SOURCE -D_POSIX_SOURCE -DHAVE_REGEX_H
#
# AIX 4.1.5:
#	-DHAVE_STRINGS_H -DHAVE_REGEX_H
#
#	(AIX 4.1.5 has str[n]casecmp, but it's defined in strings.h)
#
# Unixware 1.1.2
#	-DNEED_STRCASECMP -DNEED_STRERROR -DSVR4 -DHAVE_MEMCPY
#
# Unixware 2.1.1
#	-DNEED_STRCASECMP -D_POSIX_SOURCE
#
# LynxOS
#	-DNEED_STRCASECMP
#
# SCO 3.2
#	-DNEED_STRCASECMP -D_POSIX_SOURCE
#
# If you have dmalloc, you might wish to add -DDMALLOC
#
# If your system does not have str[n]casecmp, add -DNEED_STRCASECMP (unixware)
# If your system does not have strerror, add -DNEED_STRERROR
# If your system has POSIX regex.h, add -DHAVE_REGEX_H
#
# Add -DI18N for internationalization and multilingual support.
# Add -DPEDANTIC to get warnings about bad html and unsupported features.
# Add -DDEBUG to enable selective debug output (see the file DEBUGGING for more
# info).
#
CPPFLAGS = -DDEBUG -D_GNU_SOURCE -D_BSD_SOURCE -D_POSIX_SOURCE -DHAVE_REGEX_H $(IMAGEDEFINES) 

# Various include directories
LIBINC=-I. -I../include -I../include/common -I../../include -I../../include/common

# Platform specific includes
ifeq ($(PLATFORM),Motif)
PLATFORMINC=-I../../include/XmHTML -I/usr/X11R6/include
else
ifeq ($(PLATFORM),gtk)
PLATFORMINC=-I../../include/gtk-xmhtml -I/usr/local/include
endif
endif

# include directories
# If using dmalloc, add the path where the dmalloc.h include file can be 
# found. On my system it's in /usr/local/include
INCLUDES = $(LIBINC) $(PLATFORMINC) $(IMAGEINCLUDES) 

# linker flags
# Uncomment if you're building libXmHTML with dmalloc support
# DMALLOCLIB = -ldmalloc

# Motif version (default)
ifeq ($(PLATFORM),Motif)

LIBDIR = -L/usr/X11R6/lib
# This is what is required under Linux (Motif 2.0.1).
# Your mileage may vary.
LIBS   = -lXm -lXpm -lXmu -lXt -lXext -lX11 -lSM -lICE

else

# gtk version (only supported port for now)
ifeq($(PLATFORM),gtk)

LIBDIR = -L/usr/local/lib
LIBS   = -lgdk -lgtk -lX11

# endif gtk
endif

# Uncomment if you're building libXmHTML with dmalloc support
# DMALLOCLIB = -ldmalloc

# final line fed to the linker 
LOADLIBES = $(LIBDIR) $(LIBS) $(IMAGELIBS)

OBJENDING = o

### End of User configurable section ###

pass_flags = SHELL='$(SHELL)' \
	VERSION='$(VERSION)' \
	CC='$(CC)' \
	RM='$(RM)' \
	AR='$(AR)' \
	MV='$(MV)' \
	CP='$(CP)' \
	LN='$(LN)' \
	RANLIB='$(RANLIB)' \
	MAKEDEPEND='$(MAKEDEPEND)' \
	CFLAGS='$(CFLAGS)' \
	LDFLAGS='$(LDFLAGS)' \
	CPPFLAGS='$(CPPFLAGS) -D$(PLATFORM)' \
	INCLUDES='$(INCLUDES)' \
	LOADLIBES='$(LOADLIBES)' \
	DMALLOCLIB='$(DMALLOCLIB)' \
	ZLIBLIB='$(ZLIBLIB)' \
	PLATFORM='$(PLATFORM)' \
	OBJENDING='$(OBJENDING)'

DESTDIR=/usr/local/lib

all::
	@( for dir in $(SUBDIRS) ; do \
		(set -x ; cd $$dir ; $(MAKE) all $(pass_flags) ) ; \
	done)

# Separate rules for all targets 
lib::
	@(set -x; cd lib; $(MAKE) all $(pass_flags) )

http::
	@(set -x; cd http; $(MAKE) all $(pass_flags) )

examples::
	@(set -x; cd lib; $(MAKE) all $(pass_flags) )
	@(set -x; cd http; $(MAKE) all $(pass_flags) )
	@(set -x; cd examples; $(MAKE) all $(pass_flags) )

tools::
	@(set -x; cd http; $(MAKE) all $(pass_flags) )
	@(set -x; cd tools; $(MAKE) all $(pass_flags) )

contrib::
	@(set -x; cd lib; $(MAKE) all $(pass_flags) )
	@(set -x; cd contrib; $(MAKE) all $(pass_flags) )

book::
	@(set -x; cd lib; $(MAKE) all $(pass_flags) )
	@(set -x; cd book; $(MAKE) all $(pass_flags) )

# Global target for building everything
World::
	$(MAKE) clean
	$(MAKE) includes
	$(MAKE) depend
	$(MAKE) lib
	$(MAKE) http
	$(MAKE) examples
	$(MAKE) tools
	$(MAKE) book

# Global target for building everything with Imake
imake::
	xmkmf
	$(MAKE) World

depend:: 
	@( for dir in $(SUBDIRS) ; do \
		(set -x ; cd $$dir ; $(MAKE) depend $(pass_flags)) ; \
	done)

clean:: 
	@( for dir in $(SUBDIRS) ; do \
		(set -x ; cd $$dir ; $(MAKE) clean $(pass_flags) ) ; \
	done)

distclean:: 
	@( for dir in $(SUBDIRS) ; do \
		(set -x ; cd $$dir ; $(MAKE) distclean $(pass_flags) ) ; \
	done)
	@(set -x; cd book; $(MAKE) distclean $(pass_flags) )
	@(set -x; cd contrib; $(MAKE) distclean $(pass_flags) )
	$(RM) docs/sources.desc
	$(RM) core *.out *.log make.world *.bak *.last *.auto *.rej *.orig
	$(CP) Makefile.org Makefile

dist:: distclean
	$(LN) . XmHTML-$(ARCHIVE)
	tar cvf - XmHTML-$(ARCHIVE)/* | gzip -c > XmHTML-$(ARCHIVE).tar.gz

docs::
	tools/scansrc.sh ./lib/common > docs/sources.desc
	tools/scansrc.sh ./lib/Motif >> docs/sources.desc
	tools/scansrc.sh ./lib/gtk >> docs/sources.desc

install::
	install -d $(DESTDIR)/include/XmHTML
	install include/XmHTML/* $(DESTDIR)/include/XmHTML
	install -d $(DESTDIR)/lib
	install lib/libXmHTML.a $(DESTDIR)/lib