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 drafttest deprtest internaltest obsoletetest
@echo "All header tests have finished. If deprecation #errors appeared, "
@echo " add files to hdrtst/dfiles.txt"
@echo "#################################################################"
@echo
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 ' 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 ' 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 ' echo 'void junk(){}' >> ht_$$incfile.cpp ; \
echo > ht_dep.junk ; \
$(COMPILE.cc) -c $(cppflags) ht_$$incfile.cpp 2>&1 | sed -e 's/^.* 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
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 ' echo 'void junk(void);' >> ht_$$incfile.c ; \
echo 'void junk(){}' >> ht_$$incfile.c ; \
$(COMPILE.c) -c $(cppflags) ht_$$incfile.c ; \
RES=$$? ; \
echo $$RES ; \
done
drafttest:
@echo "U_HIDE_DRAFT_API Test #######################################################"
@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)/pfiles.txt`; do \
incfile=`basename $$file .h` ; \
echo -n " unicode/$$incfile.h - " ; \
echo ' echo ' echo 'void junk(void);' >> hd_$$incfile.c ; \
echo 'void junk(){}' >> hd_$$incfile.c ; \
$(COMPILE.cc) -c $(cppflags) hd_$$incfile.c ; \
RES=$$? ; \
echo $$RES ; \
done
deprtest:
@echo "U_HIDE_DEPRECATED_API Test #######################################################"
@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)/pfiles.txt`; do \
incfile=`basename $$file .h` ; \
echo -n " unicode/$$incfile.h - " ; \
echo ' echo ' echo 'void junk(void);' >> hdp_$$incfile.c ; \
echo 'void junk(){}' >> hdp_$$incfile.c ; \
$(COMPILE.cc) -c $(cppflags) hdp_$$incfile.c ; \
RES=$$? ; \
echo $$RES ; \
done
internaltest:
@echo "U_HIDE_INTERNAL_API Test #######################################################"
@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)/pfiles.txt`; do \
incfile=`basename $$file .h` ; \
echo -n " unicode/$$incfile.h - " ; \
echo ' echo ' echo 'void junk(void);' >> hin_$$incfile.c ; \
echo 'void junk(){}' >> hin_$$incfile.c ; \
$(COMPILE.cc) -c $(cppflags) hin_$$incfile.c ; \
RES=$$? ; \
echo $$RES ; \
done
obsoletetest:
@echo "U_HIDE_OBSOLETE_API Test #######################################################"
@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)/pfiles.txt`; do \
incfile=`basename $$file .h` ; \
echo -n " unicode/$$incfile.h - " ; \
echo ' echo ' echo 'void junk(void);' >> hob_$$incfile.c ; \
echo 'void junk(){}' >> hob_$$incfile.c ; \
$(COMPILE.cc) -c $(cppflags) hob_$$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