3 # Copyright (c) 1999-2000, 2006 Sendmail, Inc. and its suppliers.
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.
11 # Definitions for Makefile construction for sendmail
13 # $Id: all.m4,v 8.21 2006/06/14 20:18:27 ca Exp $
16 ALL=${BEFORE} ${LINKS} bldTARGETS
20 clean: bldCLEAN_TARGETS
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)
27 ifdef(`bldCHECK_PROGRAMS',`dnl
28 check_PROGRAMS=bldCHECK_PROGRAMS')
30 ifdef(`bldCHECK_TARGETS',`dnl
31 TESTS=bldCHECK_TARGETS')
36 @failed=0; all=0; xfail=0; xpass=0; \
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 \
48 xpass=`expr $$xpass + 1`; \
49 failed=`expr $$failed + 1`; \
50 echo "XPASS: $$tst"; \
56 elif test $$? -ne 77; then \
57 all=`expr $$all + 1`; \
58 case " $(XFAIL_TESTS) " in \
60 xfail=`expr $$xfail + 1`; \
61 echo "XFAIL: $$tst"; \
64 failed=`expr $$failed + 1`; \
70 if test "$$failed" -eq 0; then \
71 if test "$$xfail" -eq 0; then \
72 banner="All $$all tests passed"; \
74 banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
77 if test "$$xpass" -eq 0; then \
78 banner="$$failed of $$all tests failed"; \
80 banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
83 dashes=`echo "$$banner" | sed s/./=/g`; \
87 test "$$failed" -eq 0; \
92 $(MAKE) $(check_PROGRAMS)
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)
102 ifdef(`bldNO_INSTALL', `divert(-1)')
103 install: bldINSTALL_TARGETS
105 install-strip: bldINSTALL_TARGETS ifdef(`bldSTRIP_TARGETS', `bldSTRIP_TARGETS')
106 ifdef(`bldNO_INSTALL', `divert(0)')
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',
114 ${CP} /dev/null sm_os.h')')
116 divert(bldDEPENDENCY_SECTION)
117 ################ Dependency scripts
118 include(confBUILDTOOLSDIR/M4/depend/ifdef(`confDEPEND_TYPE', `confDEPEND_TYPE',
120 ################ End of dependency scripts