]> git.saurik.com Git - apple/icu.git/blob - icuSources/test/hdrtst/Makefile.in
ICU-6.2.4.tar.gz
[apple/icu.git] / icuSources / test / hdrtst / Makefile.in
1 ##
2 ## Copyright (c) 1999-2004, International Business Machines Corporation and
3 ## others. All Rights Reserved.
4 ##
5 ##
6 ## THE PURPOSE OF THIS TEST
7 ##
8 ## This tests all public header files (
9 ##
10 ## To run it simply type 'make check'. You SHOULD see:
11 ##
12 ## unicode/uchar.h - 0
13 ## unicode/uchriter.h - 0
14 ## unicode/ucnv.h - 0
15 ##
16 ## .. etc. Anything other than zero is an error. (except for the deprecation tests, where '1' is the correct value)
17 ##
18 ##
19 ## If a header fails the C compile because it's a C++ header, add it to the
20 ## file named 'cxxfiles.txt' in this directory.
21 ##
22 ## If a header fails because it is deprecated, add it to the 'dfiles.txt'
23 ##
24 ##
25
26
27 include $(shell icu-config --incfile)
28 srcdir=@srcdir@
29 DIRS=$(prefix)/include/unicode
30 LDIRS=$(prefix)/include/layout
31
32 all:
33 @echo Please read this Makefile for more information.
34 @echo run \'$(MAKE) check\' to run the test
35
36 check: dtest ctest cpptest lotest doclean
37 @echo "All header tests have finished. If deprecation #errors appeared, "
38 @echo " add files to hdrtst/dfiles.txt"
39 @echo "#################################################################"
40 @echo
41
42 # break dependency
43 doclean:
44 make clean
45
46 cpptest:
47 @echo "C++ test #######################################################"
48 @rm -f Makefile.sub
49 @echo 'Testing all header files under C++'
50 @echo 'the number after the hyphen (-) refers to the exit code - should be zero!'
51 @for file in `ls $(prefix)/include/unicode/*.h | fgrep -v -f $(srcdir)/pfiles.txt`; do \
52 incfile=`basename $$file .h` ; \
53 echo -n "C++ unicode/$$incfile.h - " ; \
54 echo '#include "'unicode/$$incfile'.h"' > ht_$$incfile.cpp ; \
55 echo 'void junk(){}' >> ht_$$incfile.cpp ; \
56 $(COMPILE.cc) -c $(cppflags) ht_$$incfile.cpp ; \
57 echo $$? ; \
58 done
59
60 lotest:
61 @echo "Layout test #######################################################"
62 @rm -f Makefile.sub
63 @echo 'Testing all layout files under C++'
64 @echo 'the number after the hyphen (-) refers to the exit code - should be zero!'
65 @for file in $(prefix)/include/layout/*.h; do \
66 incfile=`basename $$file .h` ; \
67 echo -n "C++ layout/$$incfile.h - " ; \
68 echo '#include "'layout/$$incfile'.h"' > ht_$$incfile.cpp ; \
69 echo 'void junk(){}' >> ht_$$incfile.cpp ; \
70 $(COMPILE.cc) -c $(cppflags) -I$(prefix)/include/layout ht_$$incfile.cpp ; \
71 echo $$? ; \
72 done
73
74 dtest:
75 @rm -f Makefile.sub
76 @echo "Deprecation #######################################################"
77 @echo 'Should be 1 in each case if file is properly obsoleted.'
78 @for stub in `cat $(srcdir)/dfiles.txt | grep -v '^#'` ; do \
79 file=unicode/$$stub \
80 incfile=`basename $$file .h` ; \
81 echo -n "C++ unicode/$$incfile.h - " ; \
82 echo '#include "'unicode/$$incfile'.h"' > ht_$$incfile.cpp ; \
83 echo 'void junk(){}' >> ht_$$incfile.cpp ; \
84 echo > ht_dep.junk ; \
85 $(COMPILE.cc) -c $(cppflags) ht_$$incfile.cpp 2>&1 | sed -e 's/^.*#error[^"]*"//' | fgrep -v ht_ | tee ht_dep.junk | fgrep -v "$$incfile.h header is obsolete" ; \
86 RES=$$? ; \
87 echo $$RES ; \
88 fgrep -q "$$incfile.h header is obsolete" ht_dep.junk || echo "** FAIL Header unicode/$$incfile.h is not obsoleted properly" ; \
89 rm -f unicode/$$stub ; \
90 done
91
92 # < ht_dep.junk && ; \
93
94
95 ctest:
96 @echo "C Test #######################################################"
97 @echo " (if any C++ files show up here, stop the test and add them to hdrtst/cxxfiles.txt) "
98 @rm -f Makefile.sub
99 @echo Building test harness for header files in ../../common and ../../i18n
100 @echo 'the number after the hyphen (-) refers to the exit code - should be zero!'
101 @for file in `ls $(prefix)/include/unicode/*.h | fgrep -v -f $(srcdir)/cxxfiles.txt | tee cfiles.txt`; do \
102 incfile=`basename $$file .h` ; \
103 echo -n "C unicode/$$incfile.h - " ; \
104 echo '#include "'unicode/$$incfile'.h"' > ht_$$incfile.c ; \
105 echo 'void junk(void);' >> ht_$$incfile.c ; \
106 echo 'void junk(){}' >> ht_$$incfile.c ; \
107 $(COMPILE.c) -c $(cppflags) ht_$$incfile.c ; \
108 RES=$$? ; \
109 echo $$RES ; \
110 done
111
112 clean:
113 -@rm -f *.h *.c *.cpp *.o *.junk
114
115 distclean: clean
116 -@rm -f Makefile
117