1# Makefile.vc6 - for tidy - HTML parser and pretty printer
2# For use with Microsoft's Visual C++ 6 nmake tool
3#
4#  CVS Info :
5#
6#     $Author$
7#     $Date$
8#     $Revision$
9#
10#  Copyright (c) 1998-2003 World Wide Web Consortium
11#  (Massachusetts Institute of Technology, European Research 
12#  Consortium for Informatics and Mathematics, Keio University).
13#  All Rights Reserved.
14#
15#  Contributing Author(s):
16#
17#     Dave Raggett    <dsr@w3.org>
18#     Terry Teague    <terry_teague@users.sourceforge.net>
19#     Mark Hale       <m.j.hale@durham.ac.uk>
20#     Philippe Lhoste <PhiLho@GMX.net>
21#
22#  The contributing author(s) would like to thank all those who
23#  helped with testing, bug fixes, and patience.  This wouldn't
24#  have been possible without all of you.
25#
26#  COPYRIGHT NOTICE:
27#
28#  This software and documentation is provided "as is," and
29#  the copyright holders and contributing author(s) make no
30#  representations or warranties, express or implied, including
31#  but not limited to, warranties of merchantability or fitness
32#  for any particular purpose or that the use of the software or
33#  documentation will not infringe any third party patents,
34#  copyrights, trademarks or other rights.
35#
36#  The copyright holders and contributing author(s) will not be
37#  liable for any direct, indirect, special or consequential damages
38#  arising out of any use of the software or documentation, even if
39#  advised of the possibility of such damage.
40#
41#  Permission is hereby granted to use, copy, modify, and distribute
42#  this source code, or portions hereof, documentation and executables,
43#  for any purpose, without fee, subject to the following restrictions:
44#
45#  1. The origin of this source code must not be misrepresented.
46#  2. Altered versions must be plainly marked as such and must
47#     not be misrepresented as being the original source.
48#  3. This Copyright notice may not be removed or altered from any
49#     source or altered source distribution.
50#
51#  The copyright holders and contributing author(s) specifically
52#  permit, without fee, and encourage the use of this source code
53#  as a component for supporting the Hypertext Markup Language in
54#  commercial products. If you use this source code in a product,
55#  acknowledgment is not required but would be appreciated.
56#
57# Usage:
58#     nmake -f Makefile.vc6
59# or
60#     nmake -f Makefile.vc6 DEBUG=1
61
62CC=cl
63RC=rc
64LD=link
65
66TOPDIR=..\..
67BINDIR=$(TOPDIR)\bin
68INCLDIR=$(TOPDIR)\include\  
69SRCDIR=$(TOPDIR)\src\  
70APPDIR=$(TOPDIR)\console\  
71TIDYEXT=/D SUPPORT_ACCESSIBILITY_CHECKS=1 /D SUPPORT_UTF16_ENCODINGS=1 /D SUPPORT_ASIAN_ENCODINGS=1
72
73## General flags for compilation
74# /W4	Sets warning level 4 (max)
75# /Za	Disables Microsoft extensions (aka ANSI)
76# /FD	Generate file dependencies
77# /c	Compiles without linking
78# In the following, replace /D "_CONSOLE" by /D "_WINDOWS" for Windows programs
79
80CFLAGS=/nologo /TC /W4 /Za /FD /c /GS /D "WIN32" /D "_CONSOLE" /D "_MBCS" $(TIDYEXT) /I $(INCLDIR) /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES
81
82## Additional flags for debug compilation
83# /Gm	Enables minimal rebuild
84# /GZ	Catch release-build errors in debug build
85# /Zi	Generates complete debugging information
86# /Od	Disables optimization
87# /MTd	Uses debug version of statically linked, multi-threaded CRT.
88# /MDd	Uses debug version of multi-threaded CRT DLL.
89
90CDEBUG=/Gm /GZ /Zi /Od /MTd /D "DEBUG" /D "_DEBUG"
91
92## Additional flags for release compilation
93# /O1	Creates small code
94# /O2	Creates fast code
95# /Ox	Uses maximum optimization (/Ob1gity /Gs)
96# /MT	Use statically linked, multi-threaded C runtime library
97# /MD 	Uses multi-threaded CRT DLL.
98
99CNDEBUG=/Ox /MT /D "NDEBUG"
100
101
102NAMEFLAG=/Fo
103## General flags for link
104# In the following, replace /subsystem:console by /subsystem:windows for Windows programs
105LDFLAGS= /nologo /subsystem:console /machine:I386 /libpath:"." /NXCOMPAT /DYNAMICBASE /SAFESEH
106LIBFLAGS= -lib
107
108## Additional flags for debug link
109LDDEBUG=/debug /pdbtype:sept /nodefaultlib:LIBC
110
111## Additional flags for release link
112LDNDEBUG=/opt:nowin98 /opt:ref /pdb:none
113
114#LIBS=KERNEL32.lib USER32.lib GDI32.lib COMDLG32.lib COMCTL32.lib ADVAPI32.lib IMM32.lib SHELL32.LIB OLE32.LIB
115LIBS=
116DEBUGLIBS=
117
118!IFDEF DEBUG
119CFLAGS=$(CFLAGS) $(CDEBUG)
120LDFLAGS=$(LDFLAGS) $(LDDEBUG)
121OBJDIR= .\debug
122!ELSE
123CFLAGS=$(CFLAGS) $(CNDEBUG)
124LDFLAGS=$(LDFLAGS) $(LDNDEBUG)
125OBJDIR= .\release
126!ENDIF
127
128
129OBJFILES=$(OBJDIR)\access.obj   $(OBJDIR)\attrs.obj    $(OBJDIR)\istack.obj\
130        $(OBJDIR)\parser.obj    $(OBJDIR)\tags.obj     $(OBJDIR)\entities.obj\
131        $(OBJDIR)\lexer.obj     $(OBJDIR)\pprint.obj   $(OBJDIR)\clean.obj\
132	$(OBJDIR)\localize.obj  $(OBJDIR)\config.obj   $(OBJDIR)\alloc.obj\
133        $(OBJDIR)\attrask.obj   $(OBJDIR)\attrget.obj  $(OBJDIR)\buffio.obj\
134        $(OBJDIR)\tagask.obj    $(OBJDIR)\fileio.obj   $(OBJDIR)\streamio.obj\
135        $(OBJDIR)\tmbstr.obj    $(OBJDIR)\utf8.obj     $(OBJDIR)\tidylib.obj\
136	$(OBJDIR)\attrdict.obj
137
138CFILES=	$(SRCDIR)access.c       $(SRCDIR)attrs.c        $(SRCDIR)istack.c \
139        $(SRCDIR)parser.c       $(SRCDIR)tags.c         $(SRCDIR)entities.c \
140        $(SRCDIR)lexer.c        $(SRCDIR)pprint.c       $(SRCDIR)clean.c \
141	$(SRCDIR)localize.c     $(SRCDIR)config.c       $(SRCDIR)alloc.c \
142        $(SRCDIR)attrask.c      $(SRCDIR)attrget.c      $(SRCDIR)buffio.c \
143        $(SRCDIR)tagask.c       $(SRCDIR)fileio.c       $(SRCDIR)streamio.c\
144        $(SRCDIR)tmbstr.c       $(SRCDIR)utf8.c         $(SRCDIR)tidylib.c\
145	$(SRCDIR)\attrdict.c
146
147HFILES=	$(INCLDIR)platform.h $(INCLDIR)buffio.h \
148        $(INCLDIR)fileio.h $(INCLDIR)tidy.h $(INCLDIR)tidyenum.h
149
150LIBHFILES= \
151        $(SRCDIR)access.h \
152        $(SRCDIR)attrs.h        $(SRCDIR)attrdict.h     $(SRCDIR)clean.h \
153        $(SRCDIR)config.h       $(SRCDIR)entities.h     \
154        $(SRCDIR)forward.h      $(SRCDIR)lexer.h        $(SRCDIR)message.h \
155        $(SRCDIR)parser.h       $(SRCDIR)pprint.h       $(SRCDIR)streamio.h \
156        $(SRCDIR)tags.h \
157        $(SRCDIR)tmbstr.h       $(SRCDIR)utf8.h         $(SRCDIR)tidy-int.h
158
159all:	$(OBJDIR)\libtidy.lib $(BINDIR)\tidy.exe $(BINDIR)\tab2space.exe
160
161$(OBJDIR) :
162		if not exist $(OBJDIR) mkdir $(OBJDIR)
163
164$(BINDIR) :
165		if not exist $(BINDIR) mkdir $(BINDIR)
166
167$(OBJDIR)\libtidy.lib:	$(OBJFILES)
168		$(LD) $(LIBFLAGS) $(OBJFILES) /OUT:$(OBJDIR)\libtidy.lib
169
170$(BINDIR)\tidy.exe: $(APPDIR)tidy.c $(HFILES) $(OBJDIR)\libtidy.lib $(BINDIR)
171		$(CC) $(CFLAGS) $(APPDIR)tidy.c $(NAMEFLAG)$(OBJDIR)\  
172		$(LD) $(LDFLAGS) $(OBJDIR)\tidy.obj $(LIBS) $(OBJDIR)\libtidy.lib /OUT:$(BINDIR)\tidy.exe
173
174$(OBJFILES):	$(HFILES) $(LIBHFILES) $(CFILES) Makefile.vc6 $(OBJDIR)
175		$(CC) $(CFLAGS) $(CFILES) $(NAMEFLAG)$(OBJDIR)\   
176
177$(BINDIR)\tab2space.exe:	$(APPDIR)tab2space.c $(BINDIR)
178		$(CC) $(CFLAGS) $(APPDIR)tab2space.c $(NAMEFLAG)$(OBJDIR)\   
179		$(LD) $(LDFLAGS) $(OBJDIR)\tab2space.obj $(LIBS) /OUT:$(BINDIR)\tab2space.exe
180
181clean:
182	-del $(OBJFILES) $(OBJDIR)\tab2space.obj $(OBJDIR)\tidy.obj $(OBJDIR)\libtidy.lib $(BINDIR)\tidy.exe $(BINDIR)\tab2space.exe
183	-rd $(OBJDIR)
184	-rd $(BINDIR)
185
186
187