1 # $Id: own.mk,v 1.35 2017/05/03 18:09:44 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 .if
!defined
(SRCTOP
) ||
!defined
(OBJTOP
)
81 # dpadd.mk is rather pointless without these
82 OPTIONS_DEFAULT_NO
+= DPADD_MK
86 OPTIONS_DEFAULT_NO
+= \
90 OPTIONS_DEFAULT_YES
+= \
108 OPTIONS_DEFAULT_DEPENDENT
+= \
114 STAGING_PROG
/STAGING \
116 .
include <options.mk
>
118 .if
${MK_INSTALL_AS_USER} == "yes"
119 # We ignore this if user is root.
122 .if
!defined
(USERGRP
)
129 .for x in BIN CONF DOC INC INFO FILES KMOD LIB MAN NLS SHARE
138 # override this in sys.mk
140 BINGRP?
= ${ROOT_GROUP}
146 INCLUDEDIR?
= ${prefix}/include
147 INCDIR?
= ${INCLUDEDIR}
149 # Define MANZ to have the man pages compressed (gzip)
153 MANDIR?
= ${prefix}/share
/man
/${MANTARGET}
156 MANMODE?
= ${NONBINMODE}
158 INCLUDEDIR?
= ${libprefix}/include
159 LIBDIR?
= ${libprefix}/lib
160 SHLIBDIR?
= ${libprefix}/lib
161 .if
${USE_SHLIBDIR
:Uno
} == "yes"
162 _LIBSODIR?
= ${SHLIBDIR}
164 _LIBSODIR?
= ${LIBDIR}
166 # this is where ld.*so lives
167 SHLINKDIR?
= /usr
/libexec
172 DOCDIR?
= ${prefix}/share
/doc
175 DOCMODE?
= ${NONBINMODE}
177 NLSDIR?
= ${prefix}/share
/nls
180 NLSMODE?
= ${NONBINMODE}
182 KMODDIR?
= ${prefix}/lkm
185 KMODMODE?
= ${NONBINMODE}
189 SHAREMODE?
= ${NONBINMODE}
194 .if
${TARGET_OSNAME} == "NetBSD"
195 .if exists
(/usr
/libexec
/ld.elf_so
)
200 # sys.mk should set something appropriate if need be.
203 .if
(${_HOST_OSNAME} == "FreeBSD")
207 # allow for per target flags
208 # apply the :T:R first, so the more specific :T can override if needed
209 CPPFLAGS
+= ${CPPFLAGS_
${.TARGET
:T
:R
}} ${CPPFLAGS_
${.TARGET
:T
}}
210 CFLAGS
+= ${CFLAGS_
${.TARGET
:T
:R
}} ${CFLAGS_
${.TARGET
:T
}}
212 # Define SYS_INCLUDE to indicate whether you want symbolic links to the system
213 # source (``symlinks''), or a separate copy (``copies''); (latter useful
214 # in environments where it's not possible to keep /sys publicly readable)
215 #SYS_INCLUDE= symlinks
217 # don't try to generate PIC versions of libraries on machines
218 # which don't support PIC.
219 .if
(${MACHINE_ARCH} == "vax") || \
220 ((${MACHINE_ARCH} == "mips") && defined
(STATIC_TOOLCHAIN
)) || \
221 ((${MACHINE_ARCH} == "alpha") && defined
(ECOFF_TOOLCHAIN
))
225 .if
${MK_LINKLIB} == "no"
230 .if
${MK_MAN} == "no"
234 .if
${MK_OBJ} == "no"
239 .if
${MK_SHARE} == "no"