1 # $Id: own.mk,v 1.27 2013/07/18 05:46:24 sjg Exp $
3 .if
!target
(__
${.PARSEFILE
}__
)
6 .if
!target
(__init.mk__
)
11 MAKECONF?
= /etc
/mk.conf
12 .
-include "${MAKECONF}"
15 .
include <host-target.mk
>
17 TARGET_OSNAME?
= ${_HOST_OSNAME}
18 TARGET_OSREL?
= ${_HOST_OSREL}
19 TARGET_OSTYPE?
= ${HOST_OSTYPE}
20 TARGET_HOST?
= ${HOST_TARGET}
22 # these may or may not exist
23 .
-include "${TARGET_HOST}.mk"
31 .if exists
(${prefix}/lib
)
37 # FreeBSD at least does not set this
38 MACHINE_ARCH?
=${MACHINE}
39 # we need to make sure these are defined too in case sys.mk fails to.
40 COMPILE.s?
= ${CC} ${AFLAGS} -c
41 LINK.s?
= ${CC} ${AFLAGS} ${LDFLAGS}
42 COMPILE.S?
= ${CC} ${AFLAGS} ${CPPFLAGS} -c
-traditional-cpp
43 LINK.S?
= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
44 COMPILE.c?
= ${CC} ${CFLAGS} ${CPPFLAGS} -c
45 LINK.c?
= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
47 COMPILE.
cc?
= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
48 LINK.
cc?
= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
49 COMPILE.m?
= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c
50 LINK.m?
= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS}
51 COMPILE.f?
= ${FC} ${FFLAGS} -c
52 LINK.f?
= ${FC} ${FFLAGS} ${LDFLAGS}
53 COMPILE.F?
= ${FC} ${FFLAGS} ${CPPFLAGS} -c
54 LINK.F?
= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
55 COMPILE.r?
= ${FC} ${FFLAGS} ${RFLAGS} -c
56 LINK.r?
= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
57 LEX.l?
= ${LEX} ${LFLAGS}
58 COMPILE.p?
= ${PC} ${PFLAGS} ${CPPFLAGS} -c
59 LINK.p?
= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
60 YACC.y?
= ${YACC} ${YFLAGS}
63 IMPFLAGS?
= ${COPTS.
${.IMPSRC
:T
}} ${CPUFLAGS.
${.IMPSRC
:T
}} ${CPPFLAGS.
${.IMPSRC
:T
}}
65 COMPILE.
$s += ${IMPFLAGS}
66 LINK.
$s += ${IMPFLAGS}
69 PRINT.VAR.MAKE
= MAKESYSPATH
=${MAKESYSPATH
:U
${.PARSEDIR
}} ${.MAKE
}
70 .if empty
(.MAKEFLAGS
:M-V
*)
71 .if defined
(MAKEOBJDIRPREFIX
) || defined
(MAKEOBJDIR
)
72 PRINTOBJDIR
= ${PRINT.VAR.MAKE
} -r
-V .OBJDIR
-f
/dev
/null xxx
74 PRINTOBJDIR
= ${PRINT.VAR.MAKE
} -V .OBJDIR
77 PRINTOBJDIR
= echo
# prevent infinite recursion
80 # we really like to have SRCTOP and OBJTOP defined...
81 .if
!defined
(SRCTOP
) ||
!defined
(OBJTOP
)
85 .if
!defined
(SRCTOP
) ||
!defined
(OBJTOP
)
86 # dpadd.mk is rather pointless without these
87 OPTIONS_DEFAULT_NO
+= DPADD_MK
91 OPTIONS_DEFAULT_NO
+= \
98 OPTIONS_DEFAULT_YES
+= \
116 OPTIONS_DEFAULT_DEPENDENT
+= \
123 .
include <options.mk
>
125 .if
${MK_INSTALL_AS_USER} == "yes"
126 # We ignore this if user is root.
129 .if
!defined
(USERGRP
)
133 .for x in BIN CONF DOC INFO KMOD LIB MAN NLS SHARE
140 # override this in sys.mk
142 BINGRP?
= ${ROOT_GROUP}
147 # Define MANZ to have the man pages compressed (gzip)
151 MANDIR?
= ${prefix}/share
/man
/${MANTARGET}
154 MANMODE?
= ${NONBINMODE}
156 LIBDIR?
= ${libprefix}/lib
157 SHLIBDIR?
= ${libprefix}/lib
158 .if
${USE_SHLIBDIR
:Uno
} == "yes"
159 _LIBSODIR?
= ${SHLIBDIR}
161 _LIBSODIR?
= ${LIBDIR}
163 # this is where ld.*so lives
164 SHLINKDIR?
= /usr
/libexec
165 LINTLIBDIR?
= ${libprefix}/libdata
/lint
168 LIBMODE?
= ${NONBINMODE}
170 DOCDIR?
= ${prefix}/share
/doc
173 DOCMODE?
= ${NONBINMODE}
175 NLSDIR?
= ${prefix}/share
/nls
178 NLSMODE?
= ${NONBINMODE}
180 KMODDIR?
= ${prefix}/lkm
183 KMODMODE?
= ${NONBINMODE}
188 .if
${TARGET_OSNAME} == "NetBSD"
189 .if exists
(/usr
/libexec
/ld.elf_so
)
194 # sys.mk should set something appropriate if need be.
197 .if
(${_HOST_OSNAME} == "FreeBSD")
201 # allow for per target flags
202 # apply the :T:R first, so the more specific :T can override if needed
203 CPPFLAGS
+= ${CPPFLAGS_
${.TARGET
:T
:R
}} ${CPPFLAGS_
${.TARGET
:T
}}
204 CFLAGS
+= ${CFLAGS_
${.TARGET
:T
:R
}} ${CFLAGS_
${.TARGET
:T
}}
206 # Define SYS_INCLUDE to indicate whether you want symbolic links to the system
207 # source (``symlinks''), or a separate copy (``copies''); (latter useful
208 # in environments where it's not possible to keep /sys publicly readable)
209 #SYS_INCLUDE= symlinks
211 # don't try to generate PIC versions of libraries on machines
212 # which don't support PIC.
213 .if
(${MACHINE_ARCH} == "vax") || \
214 ((${MACHINE_ARCH} == "mips") && defined
(STATIC_TOOLCHAIN
)) || \
215 ((${MACHINE_ARCH} == "alpha") && defined
(ECOFF_TOOLCHAIN
))
223 .if
${MK_LINKLIB} == "no"
228 .if
${MK_MAN} == "no"
232 .if
${MK_OBJ} == "no"
237 .if
${MK_SHARE} == "no"