No empty .Rs/.Re
[netbsd-mini2440.git] / sys / compat / common / Makefile.inc
blobb62b5fa5ed482320ff3b8984a84317d1b2600d84
1 #       $NetBSD: Makefile.inc,v 1.19 2002/11/02 07:49:57 perry Exp $
3 #       Configuration variables (default values are below):
5 #       S       must be set to the top of the 'sys' tree.
6 #       COMPATDST
7 #               may be set to the location of the directory where library
8 #               objects are to be built.  Defaults to ${.OBJDIR}/lib/compat.
9 #       COMPAT_AS
10 #               may be set to 'obj' to build a object from the library's
11 #               object files.  (Otherwise, a library will be built.)
12 #               Defaults to 'library'.
13 #       COMPATMISCMAKEFLAGS
14 #               Miscellaneous flags to be passed to the library's Makefile when
15 #               building.  See library's Makefile for more details about
16 #               supported flags and their default values.
18 # Default values:
19 COMPATDST?=             ${.OBJDIR}/lib/compat
20 COMPAT_AS?=             library
21 COMPATDOTDIR?= ../../.
23 COMPATDIR=              ${S:S@^.@${COMPATDOTDIR}@:Q}/compat/common
24 .if (${COMPAT_AS} == "obj")
25 COMPATLIB=              ${COMPATDST}/libcompat.o
26 COMPATLIB_PROF= ${COMPATDST}/libcompat.po
27 .else
28 COMPATLIB=              ${COMPATDST}/libcompat.a
29 COMPATLIB_PROF= ${COMPATDST}/libcompat_p.a
30 .endif
32 LIBCOMPATLNBN=  llib-lcompat.ln
33 COMPATLIBLN=    ${COMPATDST}/${LIBCOMPATLNBN}
35 COMPATMAKE= \
36         cd ${COMPATDST} && ${MAKE} -f ${COMPATDIR:Q}/Makefile \
37             COMPATDIR=${COMPATDIR:Q} \
38             CC=${CC:Q} CFLAGS=${CFLAGS:Q} \
39             AS=${AS:Q} AFLAGS=${AFLAGS:Q} \
40             AR=${AR:Q} NM=${NM:Q} \
41             LORDER=${LORDER:Q} \
42             TSORT=${TSORT:Q} \
43             RANLIB=${RANLIB:Q} \
44             LD=${LD:Q} LDFLAGS=${LDFLAGS:Q} \
45             STRIP=${STRIP:Q} \
46             MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH:Q} \
47             COMPATCPPFLAGS=${CPPFLAGS:S@^-I.@-I${COMPATDOTDIR}@g:Q} \
48             LINTFLAGS=${KERNLINTFLAGS:Q} \
49             ${COMPATMISCMAKEFLAGS}
51 ${COMPATLIB}:           .NOTMAIN .MAKE __always_make_compatlib
52         @echo making sure the compat library is up to date...
53 .if (${COMPAT_AS} == "library")
54         @${COMPATMAKE} libcompat.a
55 .else
56         @${COMPATMAKE} libcompat.o
57 .endif
59 ${COMPATLIB_PROF}:      .NOTMAIN .MAKE __always_make_compatlib
60         @echo making sure the profiled compat library is up to date...
61 .if (${COMPAT_AS} == "library")
62         @${COMPATMAKE} libcompat_p.a
63 .else
64         @${COMPATMAKE} libcompat.po
65 .endif
67 ${COMPATLIBLN}:         .NOTMAIN .MAKE __always_make_compatlib
68         @echo making sure the compat lint library is up to date...
69         @${COMPATMAKE} ${LIBCOMPATLNBN}
71 clean:                  .NOTMAIN cleancompatlib
72 cleancompatlib:         .NOTMAIN .MAKE __always_make_compatlib
73         @echo cleaning the compat library objects
74         @${COMPATMAKE} clean
76 cleandir distclean:     .NOTMAIN cleandircompatlib
77 cleandircompatlib:      .NOTMAIN .MAKE  __always_make_compatlib
78         @echo cleandiring the compat library objects
79         @${COMPATMAKE} cleandir
81 depend:                 .NOTMAIN dependcompatlib
82 dependcompatlib:        .NOTMAIN .MAKE __always_make_compatlib
83         @echo depending the compat library objects
84         @${COMPATMAKE} depend
86 __always_make_compatlib: .NOTMAIN
87         @mkdir -p ${COMPATDST}
89 .PHONY: __always_make_compatlib
90 .PHONY: cleancompatlib cleandircompatlib dependcompatlib