summaryrefslogtreecommitdiff
path: root/Build/source/libs/icu-xetex/test/hdrtst/Makefile.in
blob: 52c2f8ea3d4752eca9ce0236e24ca748e36ac4a6 (plain)
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
##
##  Copyright (c) 1999-2005, International Business Machines Corporation and
##  others. All Rights Reserved.
##
##
##  THE PURPOSE OF THIS TEST
##
##     This tests all public header files (
##  
##     To run it simply type 'make check'. You SHOULD see:
##
##  unicode/uchar.h -	0
##  unicode/uchriter.h -	0
##  unicode/ucnv.h -	0
##
##    .. etc.  Anything other than zero is an error. (except for the deprecation tests, where '1' is the correct value)
##              
##
##  If a header fails the C compile because it's a C++ header, add it to the
##  file named 'cxxfiles.txt' in this directory.
##
##  If a header fails because it is deprecated, add it to the 'dfiles.txt'
##
##


include $(shell icu-config --incfile)
srcdir=@srcdir@
DIRS=$(prefix)/include/unicode
LDIRS=$(prefix)/include/layout

all: 
	@echo Please read this Makefile for more information.
	@echo run \'$(MAKE) check\' to run the test 

check: dtest ctest cpptest lotest doclean
	@echo "All header tests have finished. If deprecation #errors appeared, "
	@echo "       add files to hdrtst/dfiles.txt"
	@echo "#################################################################"
	@echo

# break dependency
doclean:
	make clean

cpptest:
	@echo "C++ test #######################################################"
	@rm -f Makefile.sub
	@echo 'Testing all header files under C++'
	@echo 'the number after the hyphen (-) refers to the exit code - should be zero!'
	@for file in `ls $(prefix)/include/unicode/*.h | fgrep -v -f $(srcdir)/pfiles.txt`; do \
	  incfile=`basename $$file .h` ; \
	  echo -n "C++  unicode/$$incfile.h 	- " ; \
	  echo '#include "'unicode/$$incfile'.h"' > ht_$$incfile.cpp ; \
	  echo 'void junk(){}' >> ht_$$incfile.cpp ; \
          $(COMPILE.cc) -c $(cppflags) ht_$$incfile.cpp ; \
	  echo $$? ; \
	done

lotest:
	@echo "Layout test #######################################################"
	@rm -f Makefile.sub
	@echo 'Testing all layout  files under C++'
	@echo 'the number after the hyphen (-) refers to the exit code - should be zero!'
	@for file in $(prefix)/include/layout/*.h; do \
	  incfile=`basename $$file .h` ; \
	  echo -n "C++  layout/$$incfile.h 	- " ; \
	  echo '#include "'layout/$$incfile'.h"' > ht_$$incfile.cpp ; \
	  echo 'void junk(){}' >> ht_$$incfile.cpp ; \
          $(COMPILE.cc) -c $(cppflags) -I$(prefix)/include/layout ht_$$incfile.cpp ; \
	  echo $$? ; \
	done

dtest:
	@rm -f Makefile.sub
	@echo "Deprecation #######################################################"
	@echo 'Should be 1 in each case if file is properly obsoleted.'
	@for stub in `cat $(srcdir)/dfiles.txt | grep -v '^#'` ; do \
	  file=unicode/$$stub \
	  incfile=`basename $$file .h` ; \
	  echo -n "C++  unicode/$$incfile.h 	- " ; \
	  echo '#include "'unicode/$$incfile'.h"' > ht_$$incfile.cpp ; \
	  echo 'void junk(){}' >> ht_$$incfile.cpp ; \
	  echo > ht_dep.junk ; \
          $(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" ; \
	  RES=$$? ; \
	  echo $$RES ; \
	  fgrep -q "$$incfile.h header is obsolete" ht_dep.junk || echo "** FAIL Header unicode/$$incfile.h is not obsoleted properly" ; \
	  rm -f unicode/$$stub ; \
	done

#  < ht_dep.junk &&  ; \


ctest:
	@echo "C Test #######################################################"
	@echo "  (if any C++ files show up here, stop the test and add them to hdrtst/cxxfiles.txt) "
	@rm -f Makefile.sub
	@echo Building test harness for header files in ../../common and ../../i18n
	@echo 'the number after the hyphen (-) refers to the exit code - should be zero!'
	@for file in `ls $(prefix)/include/unicode/*.h | fgrep -v -f $(srcdir)/cxxfiles.txt | tee cfiles.txt`; do \
	  incfile=`basename $$file .h` ; \
	  echo -n "C    unicode/$$incfile.h 	- " ; \
	  echo '#include "'unicode/$$incfile'.h"' > ht_$$incfile.c ; \
	  echo 'void junk(void);' >> ht_$$incfile.c ; \
	  echo 'void junk(){}' >> ht_$$incfile.c ; \
          $(COMPILE.c) -c $(cppflags) ht_$$incfile.c ; \
	  RES=$$? ; \
	  echo $$RES ; \
	done

clean:
	-@rm -f *.h *.c *.cpp *.o *.junk

distclean: clean
	-@rm -f Makefile


.PHONY:	doclean check all cpptest lotest dtest ctest clean distclean