Add files from parent branch HEAD:
[pkgsrc.git] / mk / check / check-headers.mk
1 # $NetBSD: check-headers.mk,v 1.4 2007/03/16 10:29:22 rillig Exp $
2 #
3 # This file checks the C and C++ header files for possible problems.
4 #
5 # User-settable variables:
6 #
7 # CHECK_HEADERS
8 #       Whether the header files should be checked.
9 #
10 #       Default value: "yes" for PKG_DEVELOPERs, "no" otherwise.
11 #
12 # Package-settable-variables:
13 #
14 # CHECK_HEADERS_SKIP
15 #       A list of filename patterns that should be skipped for this test.
16 #
17
18 _VARGROUPS+=                    check-headers
19 _USER_VARS.check-headers=       CHECK_HEADERS
20 _PKG_VARS.check-headers=        CHECK_HEADERS_SKIP
21
22 .if defined(PKG_DEVELOPER)
23 # still experimental
24 #CHECK_HEADERS?=                yes
25 .endif
26 CHECK_HEADERS?=         no
27 CHECK_HEADERS_SKIP?=    # none
28
29 .if !empty(CHECK_HEADERS:M[Yy][Ee][Ss])
30 pre-build-checks-hook: _check-headers
31 .endif
32
33 .PHONY: _check-headers
34 _check-headers:
35         @${STEP_MSG} "Checking for possible problems in header files"
36         ${RUN}                                                          \
37         [ -d ${WRKSRC}/. ] || exit 0;                                   \
38         cd ${WRKSRC};                                                   \
39         env     SKIP_FILTER=${CHECK_HEADERS_SKIP:@p@${p}) skip=yes;;@:Q} \
40                 sh ${PKGSRCDIR}/mk/check/check-headers.sh