xref: /openbsd/share/mk/bsd.own.mk (revision d25d28bf)
1#	$OpenBSD: bsd.own.mk,v 1.179 2016/09/21 18:27:55 natano Exp $
2#	$NetBSD: bsd.own.mk,v 1.24 1996/04/13 02:08:09 thorpej Exp $
3
4# Host-specific overrides
5.if defined(MAKECONF) && exists(${MAKECONF})
6.include "${MAKECONF}"
7.elif exists(/etc/mk.conf)
8.include "/etc/mk.conf"
9.endif
10
11# Set `WARNINGS' to `yes' to add appropriate warnings to each compilation
12WARNINGS?=	no
13# Set `SKEY' to `yes' to build with support for S/key authentication.
14SKEY?=		yes
15# Set `YP' to `yes' to build with support for NIS/YP.
16YP?=		yes
17
18GCC3_ARCH=m88k
19
20# m88k: ?
21PIE_ARCH=alpha amd64 arm hppa i386 mips64 mips64el powerpc sh sparc64
22STATICPIE_ARCH=alpha amd64 arm hppa i386 mips64 mips64el powerpc sh sparc64
23
24.for _arch in ${MACHINE_ARCH}
25.if !empty(GCC3_ARCH:M${_arch})
26COMPILER_VERSION?=gcc3
27.else
28COMPILER_VERSION?=gcc4
29.endif
30
31.if !empty(STATICPIE_ARCH:M${_arch})
32STATICPIE?=-pie
33.endif
34
35.if !empty(PIE_ARCH:M${_arch})
36NOPIE_FLAGS?=-fno-pie
37NOPIE_LDFLAGS?=-nopie
38PIE_DEFAULT?=${DEFAULT_PIE_DEF}
39.else
40NOPIE_FLAGS?=
41PIE_DEFAULT?=
42.endif
43.endfor
44
45# where the system object and source trees are kept; can be configurable
46# by the user in case they want them in ~/foosrc and ~/fooobj, for example
47BSDSRCDIR?=	/usr/src
48BSDOBJDIR?=	/usr/obj
49
50BINGRP?=	bin
51BINOWN?=	root
52BINMODE?=	555
53NONBINMODE?=	444
54DIRMODE?=	755
55
56SHAREDIR?=	/usr/share
57SHAREGRP?=	bin
58SHAREOWN?=	root
59SHAREMODE?=	${NONBINMODE}
60
61MANDIR?=	/usr/share/man/man
62MANGRP?=	bin
63MANOWN?=	root
64MANMODE?=	${NONBINMODE}
65
66LIBDIR?=	/usr/lib
67LIBGRP?=	${BINGRP}
68LIBOWN?=	${BINOWN}
69LIBMODE?=	${NONBINMODE}
70
71DOCDIR?=	/usr/share/doc
72DOCGRP?=	bin
73DOCOWN?=	root
74DOCMODE?=	${NONBINMODE}
75
76LOCALEDIR?=	/usr/share/locale
77LOCALEGRP?=	wheel
78LOCALEOWN?=	root
79LOCALEMODE?=	${NONBINMODE}
80
81.if !defined(CDIAGFLAGS)
82CDIAGFLAGS=	-Wall -Wpointer-arith -Wuninitialized -Wstrict-prototypes
83CDIAGFLAGS+=	-Wmissing-prototypes -Wunused -Wsign-compare
84CDIAGFLAGS+=	-Wshadow
85.  if ${COMPILER_VERSION} == "gcc4"
86CDIAGFLAGS+=	-Wdeclaration-after-statement
87.  endif
88.endif
89
90# Shared files for system gnu configure, not used yet
91GNUSYSTEM_AUX_DIR?=${BSDSRCDIR}/share/gnu
92
93INSTALL_COPY?=	-c
94.ifndef DEBUG
95INSTALL_STRIP?=	-s
96.endif
97
98STATIC?=	-static ${STATICPIE}
99
100# Define SYS_INCLUDE to indicate whether you want symbolic links to the system
101# source (``symlinks''), or a separate copy (``copies''); (latter useful
102# in environments where it's not possible to keep /sys publicly readable)
103#SYS_INCLUDE= 	symlinks
104
105# pic relocation flags.
106.if (${MACHINE_ARCH} == "alpha") || (${MACHINE_ARCH} == "sparc64")
107PICFLAG?=-fPIC
108.else
109PICFLAG?=-fpic
110.endif
111
112.if ${MACHINE_ARCH} == "sparc64"
113ASPICFLAG=-KPIC
114.endif
115
116.if ${MACHINE_ARCH} == "alpha" || ${MACHINE_ARCH} == "powerpc" || \
117    ${MACHINE_ARCH} == "sparc64"
118# big PIE
119DEFAULT_PIE_DEF=-DPIE_DEFAULT=2
120.else
121# small pie
122DEFAULT_PIE_DEF=-DPIE_DEFAULT=1
123.endif
124
125# don't try to generate PROFILED versions of libraries on machines
126# which don't support profiling.
127.if 0
128NOPROFILE=
129.endif
130
131BSD_OWN_MK=Done
132
133.PHONY: spell clean cleandir obj manpages print all \
134	depend beforedepend afterdepend cleandepend subdirdepend \
135	all cleanman includes \
136	beforeinstall realinstall maninstall afterinstall install
137