1########################################################################
2#
3# Copyright (c) 2009, Secure Endpoints Inc.
4# All rights reserved.
5# 
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:
9# 
10# - Redistributions of source code must retain the above copyright
11#   notice, this list of conditions and the following disclaimer.
12# 
13# - Redistributions in binary form must reproduce the above copyright
14#   notice, this list of conditions and the following disclaimer in
15#   the documentation and/or other materials provided with the
16#   distribution.
17# 
18# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
28# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29# POSSIBILITY OF SUCH DAMAGE.
30# 
31
32RELDIR=lib\wind
33
34!include ../../windows/NTMakefile.w32
35
36libwind_OBJs=	\
37	$(OBJ)\bidi.obj				\
38	$(OBJ)\bidi_table.obj		\
39	$(OBJ)\combining.obj		\
40	$(OBJ)\combining_table.obj	\
41	$(OBJ)\errorlist.obj		\
42	$(OBJ)\errorlist_table.obj	\
43	$(OBJ)\map.obj				\
44	$(OBJ)\map_table.obj		\
45	$(OBJ)\ldap.obj				\
46	$(OBJ)\normalize.obj		\
47	$(OBJ)\normalize_table.obj	\
48	$(OBJ)\punycode.obj			\
49	$(OBJ)\stringprep.obj		\
50	$(OBJ)\wind_err.obj			\
51	$(OBJ)\utf8.obj
52
53$(LIBWIND): $(libwind_OBJs)
54	$(LIBCON)
55
56INCFILES=	\
57	$(INCDIR)\wind.h	\
58	$(INCDIR)\wind_err.h	\
59	$(INCDIR)\map_table.h	\
60	$(INCDIR)\errorlist_table.h	\
61	$(INCDIR)\normalize_table.h	\
62	$(INCDIR)\combining_table.h	\
63	$(INCDIR)\bidi_table.h	\
64	$(INCDIR)\punycode_examples.h
65
66$(OBJ)\map_table.h $(OBJ)\map_table.c: rfc3454.txt gen-map.py stringprep.py
67	cd $(OBJ)
68	$(PYTHON) $(SRCDIR)\gen-map.py $(SRCDIR)\rfc3454.txt $(OBJ)
69	cd $(SRCDIR)
70
71$(OBJ)\errorlist_table.h $(OBJ)\errorlist_table.c: rfc3454.txt gen-errorlist.py stringprep.py
72	cd $(OBJ)
73	$(PYTHON) $(SRCDIR)\gen-errorlist.py $(SRCDIR)\rfc3454.txt $(OBJ)
74	cd $(SRCDIR)
75
76$(OBJ)\normalize_table.h $(OBJ)\normalize_table.c: UnicodeData.txt CompositionExclusions-3.2.0.txt gen-normalize.py
77	cd $(OBJ)
78	$(PYTHON) $(SRCDIR)\gen-normalize.py $(SRCDIR)\UnicodeData.txt $(SRCDIR)\CompositionExclusions-3.2.0.txt $(OBJ)
79	cd $(SRCDIR)
80
81$(OBJ)\combining_table.h $(OBJ)\combining_table.c: UnicodeData.txt gen-combining.py
82	cd $(OBJ)
83	$(PYTHON) $(SRCDIR)\gen-combining.py $(SRCDIR)\UnicodeData.txt $(OBJ)
84	cd $(SRCDIR)
85
86$(OBJ)\bidi_table.h $(OBJ)\bidi_table.c: rfc3454.txt gen-bidi.py
87	cd $(OBJ)
88	$(PYTHON) $(SRCDIR)\gen-bidi.py $(SRCDIR)\rfc3454.txt $(OBJ)
89	cd $(SRCDIR)
90
91$(OBJ)\punycode_examples.h $(OBJ)\punycode_examples.c: gen-punycode-examples.py rfc3492.txt
92	cd $(OBJ)
93	$(PYTHON) $(SRCDIR)\gen-punycode-examples.py $(SRCDIR)\rfc3492.txt $(OBJ)
94	cd $(SRCDIR)
95
96$(OBJ)\wind_err.c $(OBJ)\wind_err.h: wind_err.et
97	cd $(OBJ)
98	$(BINDIR)\compile_et.exe $(SRCDIR)\wind_err.et
99	cd $(SRCDIR)
100
101TEST_BINARIES=\
102	$(OBJ)\test-bidi.exe	\
103	$(OBJ)\test-map.exe		\
104	$(OBJ)\test-rw.exe		\
105	$(OBJ)\test-normalize.exe	\
106	$(OBJ)\test-prohibited.exe	\
107	$(OBJ)\test-punycode.exe	\
108	$(OBJ)\test-ldap.exe	\
109	$(OBJ)\test-utf8.exe
110
111{$(OBJ)}.c{$(OBJ)}.obj::
112	$(C2OBJ_P) -I$(SRCDIR)
113
114{$(OBJ)}.obj{$(OBJ)}.exe:
115	$(EXECONLINK) $(LIBHEIMDAL) $(LIBROKEN)
116	$(EXEPREP_NODIST)
117
118$(OBJ)\test-bidi.exe: $(OBJ)\test-bidi.obj
119
120$(OBJ)\test-map.exe: $(OBJ)\test-map.obj
121
122$(OBJ)\test-rw.exe: $(OBJ)\test-rw.obj
123
124$(OBJ)\test-normalize.exe: $(OBJ)\test-normalize.obj
125
126$(OBJ)\test-prohibited.exe: $(OBJ)\test-prohibited.obj
127
128$(OBJ)\test-punycode.exe: $(OBJ)\test-punycode.obj $(OBJ)\punycode_examples.obj
129
130$(OBJ)\test-ldap.exe: $(OBJ)\test-ldap.obj
131
132$(OBJ)\test-utf8.exe: $(OBJ)\test-utf8.obj
133
134test-binaries: $(TEST_BINARIES)
135
136test-run:
137	cd $(OBJ)
138	test-bidi.exe
139	test-map.exe
140	test-rw.exe
141	test-normalize.exe $(SRCDIR)\NormalizationTest.txt
142	test-prohibited.exe
143	test-punycode.exe
144	test-ldap.exe
145	test-utf8.exe
146	cd $(SRCDIR)
147
148all:: $(INCFILES) $(LIBWIND)
149
150clean::
151	-$(RM) $(LIBWIND)
152	-$(RM) $(INCFILES)
153
154test:: test-binaries test-run
155
156test-exports:
157	$(PERL) ..\..\cf\w32-check-exported-symbols.pl --vs version-script.map --def libwind-exports.def
158
159test:: test-exports
160