Initial import of binutils 2.22 on the new vendor branch
[dragonfly.git] / contrib / sendmail-8.14 / devtools / M4 / UNIX / all.m4
1 divert(-1)
2 #
3 # Copyright (c) 1999-2000, 2006 Sendmail, Inc. and its suppliers.
4 #       All rights reserved.
5 #
6 # By using this file, you agree to the terms and conditions set
7 # forth in the LICENSE file which can be found at the top level of
8 # the sendmail distribution.
9 #
10 #
11 #  Definitions for Makefile construction for sendmail
12 #
13 #       $Id: all.m4,v 8.21 2006/06/14 20:18:27 ca Exp $
14 #
15 divert(0)dnl
16 ALL=${BEFORE} ${LINKS} bldTARGETS
17
18 all: ${ALL}
19
20 clean: bldCLEAN_TARGETS
21
22 define(`bldADD_SRC', ${$1SRCS} )dnl
23 SRCS=bldFOREACH(`bldADD_SRC(', bldC_PRODUCTS)
24 define(`bldADD_OBJS', ${$1OBJS} )dnl
25 OBJS=bldFOREACH(`bldADD_OBJS(', bldC_PRODUCTS)
26
27 ifdef(`bldCHECK_PROGRAMS',`dnl
28 check_PROGRAMS=bldCHECK_PROGRAMS')
29
30 ifdef(`bldCHECK_TARGETS',`dnl
31 TESTS=bldCHECK_TARGETS')
32
33 VPATH=${srcdir}
34 changequote([[, ]])
35 check-TESTS: $(TESTS)
36         @failed=0; all=0; xfail=0; xpass=0; \
37         list='$(TESTS)'; \
38         srcdir=$(srcdir); export srcdir; \
39         if test -n "$$list"; then \
40           for tst in $$list; do \
41             if test -f ./$$tst; then dir=./; \
42             elif test -f $$tst; then dir=; \
43             else dir="$(srcdir)/"; fi; \
44             if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
45               all=`expr $$all + 1`; \
46               case " $(XFAIL_TESTS) " in \
47               *" $$tst "*) \
48                 xpass=`expr $$xpass + 1`; \
49                 failed=`expr $$failed + 1`; \
50                 echo "XPASS: $$tst"; \
51               ;; \
52               *) \
53                 echo "PASS: $$tst"; \
54               ;; \
55               esac; \
56             elif test $$? -ne 77; then \
57               all=`expr $$all + 1`; \
58               case " $(XFAIL_TESTS) " in \
59               *" $$tst "*) \
60                 xfail=`expr $$xfail + 1`; \
61                 echo "XFAIL: $$tst"; \
62               ;; \
63               *) \
64                 failed=`expr $$failed + 1`; \
65                 echo "FAIL: $$tst"; \
66               ;; \
67               esac; \
68             fi; \
69           done; \
70           if test "$$failed" -eq 0; then \
71             if test "$$xfail" -eq 0; then \
72               banner="All $$all tests passed"; \
73             else \
74               banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
75             fi; \
76           else \
77             if test "$$xpass" -eq 0; then \
78               banner="$$failed of $$all tests failed"; \
79             else \
80               banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
81             fi; \
82           fi; \
83           dashes=`echo "$$banner" | sed s/./=/g`; \
84           echo "$$dashes"; \
85           echo "$$banner"; \
86           echo "$$dashes"; \
87           test "$$failed" -eq 0; \
88         fi
89 changequote(`, ')
90
91 check-am: all
92         $(MAKE) $(check_PROGRAMS)
93         $(MAKE) check-TESTS
94 check: check-am
95
96
97 define(`bldADD_SRC_CHK', ${$1SRCS_CHK} )dnl
98 SRCS_CHK=bldFOREACH(`bldADD_SRC_CHK(', bldC_CHECKS)
99 define(`bldADD_OBJS_CHK', ${$1OBJS_CHK} )dnl
100 OBJS_CHK=bldFOREACH(`bldADD_OBJS(', bldC_CHECKS)
101
102 ifdef(`bldNO_INSTALL', `divert(-1)')
103 install: bldINSTALL_TARGETS
104
105 install-strip: bldINSTALL_TARGETS ifdef(`bldSTRIP_TARGETS', `bldSTRIP_TARGETS')
106 ifdef(`bldNO_INSTALL', `divert(0)')
107
108 ifdef(`confREQUIRE_SM_OS_H',`
109 ifdef(`confSM_OS_HEADER',
110 `sm_os.h: ${SRCDIR}/inc`'lude/sm/os/confSM_OS_HEADER.h
111         ${RM} ${RMOPTS} sm_os.h
112         ${LN} ${LNOPTS} ${SRCDIR}/inc`'lude/sm/os/confSM_OS_HEADER.h sm_os.h',
113 `sm_os.h:
114         ${CP} /dev/null sm_os.h')')
115
116 divert(bldDEPENDENCY_SECTION)
117 ################  Dependency scripts
118 include(confBUILDTOOLSDIR/M4/depend/ifdef(`confDEPEND_TYPE', `confDEPEND_TYPE',
119 `generic').m4)dnl
120 ################  End of dependency scripts
121 divert(0)