~ubuntu-branches/ubuntu/precise/tidy/precise-security

« back to all changes in this revision

Viewing changes to build/gmake/Makefile

  • Committer: Bazaar Package Importer
  • Author(s): Jason Thomas
  • Date: 2005-04-20 11:22:49 UTC
  • mto: (3.1.1 lenny)
  • mto: This revision was merged to the branch mainline in revision 2.
  • Revision ID: james.westby@ubuntu.com-20050420112249-epdnkgi03ubep83z
Tags: upstream-20050415
ImportĀ upstreamĀ versionĀ 20050415

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Makefile - for tidy - HTML parser and pretty printer
 
2
#
 
3
#  CVS Info :
 
4
#
 
5
#     $Author: arnaud02 $ 
 
6
#     $Date: 2005/04/14 16:02:35 $ 
 
7
#     $Revision: 1.18 $ 
 
8
#
 
9
#  Copyright (c) 1998-2005 World Wide Web Consortium
 
10
#  (Massachusetts Institute of Technology, European Research 
 
11
#  Consortium for Informatics and Mathematics, Keio University).
 
12
#  All Rights Reserved.
 
13
#
 
14
#  Contributing Author(s):
 
15
#
 
16
#     Dave Raggett <dsr@w3.org>
 
17
#     Terry Teague <terry_teague@users.sourceforge.net>
 
18
#     Pradeep Padala<ppadala@users.sourceforge.net>
 
19
#
 
20
#  The contributing author(s) would like to thank all those who
 
21
#  helped with testing, bug fixes, and patience.  This wouldn't
 
22
#  have been possible without all of you.
 
23
#
 
24
#  COPYRIGHT NOTICE:
 
25
#
 
26
#  This software and documentation is provided "as is," and
 
27
#  the copyright holders and contributing author(s) make no
 
28
#  representations or warranties, express or implied, including
 
29
#  but not limited to, warranties of merchantability or fitness
 
30
#  for any particular purpose or that the use of the software or
 
31
#  documentation will not infringe any third party patents,
 
32
#  copyrights, trademarks or other rights. 
 
33
#
 
34
#  The copyright holders and contributing author(s) will not be
 
35
#  liable for any direct, indirect, special or consequential damages
 
36
#  arising out of any use of the software or documentation, even if
 
37
#  advised of the possibility of such damage.
 
38
#
 
39
#  Permission is hereby granted to use, copy, modify, and distribute
 
40
#  this source code, or portions hereof, documentation and executables,
 
41
#  for any purpose, without fee, subject to the following restrictions:
 
42
#
 
43
#  1. The origin of this source code must not be misrepresented.
 
44
#  2. Altered versions must be plainly marked as such and must
 
45
#     not be misrepresented as being the original source.
 
46
#  3. This Copyright notice may not be removed or altered from any
 
47
#     source or altered source distribution.
 
48
 
49
#  The copyright holders and contributing author(s) specifically
 
50
#  permit, without fee, and encourage the use of this source code
 
51
#  as a component for supporting the Hypertext Markup Language in
 
52
#  commercial products. If you use this source code in a product,
 
53
#  acknowledgment is not required but would be appreciated.
 
54
#
 
55
 
 
56
SHELL=/bin/sh
 
57
 
 
58
PROJECT=tidy
 
59
 
 
60
# Installation variables.  Spaces OK, only dir create and file copy operations.
 
61
runinst_prefix=/usr/local
 
62
devinst_prefix=/usr/local
 
63
 
 
64
bininst = ${runinst_prefix}/bin
 
65
libinst = ${devinst_prefix}/lib
 
66
incinst = ${devinst_prefix}/include/$(PROJECT)
 
67
maninst = ${devinst_prefix}/man
 
68
 
 
69
# Internal variables. - No spaces allowed: libtool chokes on spaces in directory names.
 
70
TOPDIR = ../..
 
71
INCDIR = ${TOPDIR}/include
 
72
APPDIR = ${TOPDIR}/console
 
73
SRCDIR = ${TOPDIR}/src
 
74
OBJDIR = ./obj
 
75
LIBDIR = ${TOPDIR}/lib
 
76
BINDIR = ${TOPDIR}/bin
 
77
DOCDIR = ${TOPDIR}/htmldoc
 
78
 
 
79
# CFLAGS etc..
 
80
# For optimised builds, flags such as "-O2" should be added and -D_DEBUG=1
 
81
# disabled.
 
82
CC= gcc
 
83
CFLAGS= -g -Wall -Wno-switch -Wno-parentheses -I $(INCDIR)
 
84
# flags only supported with gcc 3.x
 
85
# CFLAGS += -Wunused-parameter
 
86
 
 
87
OTHERCFLAGS=
 
88
OTHERCFLAGS+= -D_DEBUG=1
 
89
# OTHERCFLAGS+= -DSUPPORT_ACCESSIBILITY_CHECKS=1 -DSUPPORT_UTF16_ENCODINGS=1 -DSUPPORT_ASIAN_ENCODINGS=1
 
90
ifdef SUPPORT_UTF16_ENCODINGS
 
91
CFLAGS += -DSUPPORT_UTF16_ENCODINGS=$(SUPPORT_UTF16_ENCODINGS)
 
92
endif
 
93
ifdef SUPPORT_ASIAN_ENCODINGS
 
94
CFLAGS += -DSUPPORT_ASIAN_ENCODINGS=$(SUPPORT_ASIAN_ENCODINGS)
 
95
endif
 
96
ifdef SUPPORT_ACCESSIBILITY_CHECKS
 
97
CFLAGS += -DSUPPORT_ACCESSIBILITY_CHECKS=$(SUPPORT_ACCESSIBILITY_CHECKS)
 
98
endif
 
99
 
 
100
DEBUGFLAGS=-g
 
101
ifdef DMALLOC
 
102
DEBUGFLAGS += -DDMALLOC
 
103
endif
 
104
 
 
105
LIBS=-lc
 
106
DEBUGLIBS=-ldmalloc
 
107
 
 
108
# Tidy lib related variables
 
109
TIDY_MAJOR = 1
 
110
TIDY_MINOR = 0
 
111
 
 
112
# This will come from autoconf again
 
113
LIBPREFIX = lib
 
114
LIBSUFFIX = .a
 
115
OBJSUF = .o
 
116
 
 
117
LIBRARY = $(LIBDIR)/$(LIBPREFIX)$(PROJECT)$(LIBSUFFIX)
 
118
AR=ar -r
 
119
 
 
120
XSLTPROC = xsltproc
 
121
 
 
122
EXES = $(BINDIR)/$(PROJECT) $(BINDIR)/tab2space
 
123
 
 
124
DOCS = $(DOCDIR)/quickref.html $(DOCDIR)/tidy.1 $(DOCDIR)/tidy-config.7
 
125
 
 
126
CONFIGXML = $(DOCDIR)/tidy-config.xml
 
127
HELPXML = $(DOCDIR)/tidy-help.xml
 
128
 
 
129
OBJFILES=\
 
130
        $(OBJDIR)/access$(OBJSUF)     $(OBJDIR)/attrs$(OBJSUF)      $(OBJDIR)/istack$(OBJSUF) \
 
131
        $(OBJDIR)/parser$(OBJSUF)     $(OBJDIR)/tags$(OBJSUF)       $(OBJDIR)/entities$(OBJSUF) \
 
132
        $(OBJDIR)/lexer$(OBJSUF)      $(OBJDIR)/pprint$(OBJSUF)     $(OBJDIR)/clean$(OBJSUF) \
 
133
        $(OBJDIR)/localize$(OBJSUF)   $(OBJDIR)/config$(OBJSUF)     $(OBJDIR)/alloc$(OBJSUF) \
 
134
        $(OBJDIR)/attrask$(OBJSUF)    $(OBJDIR)/attrdict$(OBJSUF)   $(OBJDIR)/attrget$(OBJSUF) \
 
135
        $(OBJDIR)/buffio$(OBJSUF)     $(OBJDIR)/fileio$(OBJSUF)     $(OBJDIR)/streamio$(OBJSUF) \
 
136
        $(OBJDIR)/tagask$(OBJSUF)     $(OBJDIR)/tmbstr$(OBJSUF)     $(OBJDIR)/utf8$(OBJSUF) \
 
137
        $(OBJDIR)/tidylib$(OBJSUF)
 
138
 
 
139
CFILES= \
 
140
        $(SRCDIR)/access.c       $(SRCDIR)/attrs.c        $(SRCDIR)/istack.c \
 
141
        $(SRCDIR)/parser.c       $(SRCDIR)/tags.c         $(SRCDIR)/entities.c \
 
142
        $(SRCDIR)/lexer.c        $(SRCDIR)/pprint.c       $(SRCDIR)/clean.c \
 
143
        $(SRCDIR)/localize.c     $(SRCDIR)/config.c       $(SRCDIR)/alloc.c \
 
144
        $(SRCDIR)/attrask.c      $(SRCDIR)/attrdict.c     $(SRCDIR)/attrget.c \
 
145
        $(SRCDIR)/buffio.c       $(SRCDIR)/fileio.c       $(SRCDIR)/streamio.c \
 
146
        $(SRCDIR)/tagask.c       $(SRCDIR)/tmbstr.c       $(SRCDIR)/utf8.c \
 
147
        $(SRCDIR)/tidylib.c
 
148
 
 
149
HFILES= $(INCDIR)/platform.h     $(INCDIR)/tidy.h         $(INCDIR)/tidyenum.h \
 
150
        $(INCDIR)/fileio.h       $(INCDIR)/buffio.h
 
151
 
 
152
LIBHFILES= \
 
153
        $(SRCDIR)/access.h       $(SRCDIR)/attrs.h        $(SRCDIR)/attrdict.h \
 
154
        $(SRCDIR)/clean.h        $(SRCDIR)/config.h       $(SRCDIR)/entities.h \
 
155
        $(SRCDIR)/forward.h      $(SRCDIR)/lexer.h        $(SRCDIR)/message.h \
 
156
        $(SRCDIR)/parser.h       $(SRCDIR)/pprint.h       $(SRCDIR)/streamio.h \
 
157
        $(SRCDIR)/tags.h         $(SRCDIR)/tmbstr.h       $(SRCDIR)/utf8.h \
 
158
        $(SRCDIR)/tidy-int.h
 
159
 
 
160
 
 
161
all:    $(LIBRARY) $(EXES)
 
162
 
 
163
doc:    $(DOCS)
 
164
 
 
165
$(LIBRARY): $(OBJFILES)
 
166
        if [ ! -d $(LIBDIR) ]; then mkdir $(LIBDIR); fi
 
167
        $(AR) $@ $(OBJFILES)
 
168
ifdef RANLIB
 
169
        $(RANLIB) $@
 
170
endif
 
171
 
 
172
$(OBJDIR)/%$(OBJSUF):   $(SRCDIR)/%.c $(HFILES) $(LIBHFILES) Makefile
 
173
        if [ ! -d $(OBJDIR) ]; then mkdir $(OBJDIR); fi
 
174
        $(CC) $(CFLAGS) $(OTHERCFLAGS) -o $@ -c $<
 
175
 
 
176
$(BINDIR)/$(PROJECT):   $(APPDIR)/tidy.c $(HFILES) $(LIBRARY)
 
177
        if [ ! -d $(BINDIR) ]; then mkdir $(BINDIR); fi
 
178
        $(CC) $(CFLAGS) $(OTHERCFLAGS) -o $@ $(APPDIR)/tidy.c -I$(INCDIR) -L$(LIBDIR) -l$(PROJECT)
 
179
 
 
180
$(BINDIR)/tab2space: $(APPDIR)/tab2space.c
 
181
        if [ ! -d $(BINDIR) ]; then mkdir $(BINDIR); fi
 
182
        $(CC) $(CFLAGS) $(OTHERCFLAGS) -o $@ $(APPDIR)/tab2space.c $(LIBS)
 
183
 
 
184
$(HELPXML): $(BINDIR)/$(PROJECT)
 
185
        $(BINDIR)/$(PROJECT) -xml-help > $@
 
186
 
 
187
$(CONFIGXML): $(BINDIR)/$(PROJECT)
 
188
        $(BINDIR)/$(PROJECT) -xml-config > $@
 
189
 
 
190
$(DOCDIR)/quickref.html: $(DOCDIR)/quickref-html.xsl $(CONFIGXML)
 
191
        $(XSLTPROC) -o $@ $(DOCDIR)/quickref-html.xsl $(CONFIGXML)
 
192
 
 
193
$(DOCDIR)/tidy.1: $(DOCDIR)/tidy1.xsl $(HELPXML)
 
194
        $(XSLTPROC) -o $@ $(DOCDIR)/tidy1.xsl $(HELPXML)
 
195
 
 
196
$(DOCDIR)/tidy-config.7: $(DOCDIR)/quickref-man.xsl $(CONFIGXML)
 
197
        $(XSLTPROC) -o $@ $(DOCDIR)/quickref-man.xsl $(CONFIGXML)
 
198
 
 
199
debug:
 
200
        @$(MAKE) CFLAGS='$(CFLAGS) $(DEBUGFLAGS)' LIBS='$(LIBS) $(DEBUGLIBS)' all
 
201
 
 
202
clean:
 
203
        rm -f $(OBJFILES) $(EXES) $(LIBRARY) $(DOCS) $(HELPXML) $(CONFIGXML) $(OBJDIR)/*.lo
 
204
        if [ -d $(OBJDIR)/.libs ]; then rmdir $(OBJDIR)/.libs; fi
 
205
        if [ -d $(LIBDIR)/.libs ]; then rmdir $(LIBDIR)/.libs; fi
 
206
        if [ "$(OBJDIR)" != "$(TOPDIR)" -a -d $(OBJDIR) ]; then rmdir $(OBJDIR); fi
 
207
        if [ "$(LIBDIR)" != "$(TOPDIR)" -a -d $(LIBDIR) ]; then rmdir $(LIBDIR); fi
 
208
        if [ "$(BINDIR)" != "$(TOPDIR)" -a -d $(BINDIR) ]; then rmdir $(BINDIR); fi
 
209
 
 
210
installhdrs: $(HFILES)
 
211
        if [ ! -d "$(incinst)" ]; then mkdir -p "$(incinst)"; fi
 
212
        cp -f $(HFILES) "$(incinst)/"
 
213
 
 
214
installib: $(LIBRARY)
 
215
        if [ ! -d "$(libinst)" ]; then mkdir -p "$(libinst)"; fi
 
216
        cp -f $(LIBRARY) "$(libinst)/"
 
217
 
 
218
installexes: $(EXES)
 
219
        if [ ! -d "$(bininst)" ]; then mkdir -p "$(bininst)"; fi
 
220
        cp -f $(EXES) "$(bininst)/"
 
221
 
 
222
installmanpage: $(DOCDIR)/tidy.1 $(DOCDIR)/tidy-config.7
 
223
        if [ ! -d "$(maninst)/man1" ]; then mkdir -p "$(maninst)/man1"; fi;
 
224
        if [ ! -d "$(maninst)/man7" ]; then mkdir -p "$(maninst)/man7"; fi;
 
225
        cp -f $(DOCDIR)/tidy.1 "$(maninst)/man1/tidy.1";
 
226
        cp -f $(DOCDIR)/tidy-config.7 "$(maninst)/man7/tidy-config.7";
 
227
 
 
228
install: installhdrs installib installmanpage installexes