Annotation of src/share/mk/bsd.own.mk, Revision 1.203
1.203 ! gkoehler 1: # $OpenBSD: bsd.own.mk,v 1.202 2020/05/30 19:22:00 drahn Exp $
1.7 deraadt 2: # $NetBSD: bsd.own.mk,v 1.24 1996/04/13 02:08:09 thorpej Exp $
3:
1.15 millert 4: # Host-specific overrides
1.7 deraadt 5: .if defined(MAKECONF) && exists(${MAKECONF})
6: .include "${MAKECONF}"
7: .elif exists(/etc/mk.conf)
8: .include "/etc/mk.conf"
1.26 art 9: .endif
1.1 deraadt 10:
1.51 espie 11: # Set `WARNINGS' to `yes' to add appropriate warnings to each compilation
12: WARNINGS?= no
1.15 millert 13: # Set `SKEY' to `yes' to build with support for S/key authentication.
14: SKEY?= yes
1.19 downsj 15: # Set `YP' to `yes' to build with support for NIS/YP.
1.15 millert 16: YP?= yes
1.71 espie 17:
1.202 drahn 18: CLANG_ARCH=aarch64 amd64 arm i386 mips64 mips64el powerpc powerpc64 sparc64
1.201 kettenis 19: GCC4_ARCH=alpha hppa mips64el sh sparc64
1.173 deraadt 20: GCC3_ARCH=m88k
1.202 drahn 21: LLD_ARCH=aarch64 amd64 arm i386 powerpc64
1.127 deraadt 22:
1.198 visa 23: .if ${MACHINE} == "sgi"
24: GCC4_ARCH+=mips64
25: .endif
26:
1.171 deraadt 27: # m88k: ?
1.195 jca 28: PIE_ARCH=aarch64 alpha amd64 arm hppa i386 mips64 mips64el powerpc sh sparc64
29: STATICPIE_ARCH=aarch64 alpha amd64 arm hppa i386 mips64 mips64el powerpc sh sparc64
1.106 drahn 30:
31: .for _arch in ${MACHINE_ARCH}
1.183 kettenis 32: .if !empty(GCC3_ARCH:M${_arch})
33: COMPILER_VERSION?=gcc3
34: .elif !empty(GCC4_ARCH:M${_arch})
35: COMPILER_VERSION?=gcc4
36: .elif !empty(CLANG_ARCH:M${_arch})
37: COMPILER_VERSION?=clang
38: .endif
39:
40: .if !empty(GCC3_ARCH:M${_arch})
41: BUILD_GCC3?=yes
42: .else
43: BUILD_GCC3?=no
44: .endif
1.186 robert 45: .if !empty(GCC4_ARCH:M${_arch}) || ${MACHINE_ARCH} == "amd64" || \
1.201 kettenis 46: ${MACHINE_ARCH} == "mips64" || ${MACHINE_ARCH} == "powerpc"
1.183 kettenis 47: BUILD_GCC4?=yes
48: .else
49: BUILD_GCC4?=no
50: .endif
1.182 patrick 51: .if !empty(CLANG_ARCH:M${_arch})
1.183 kettenis 52: BUILD_CLANG?=yes
1.141 miod 53: .else
1.183 kettenis 54: BUILD_CLANG?=no
1.190 kettenis 55: .endif
56:
57: .if !empty(LLD_ARCH:M${_arch})
58: LINKER_VERSION?=lld
59: .else
60: LINKER_VERSION?=bfd
1.72 mickey 61: .endif
1.121 pascal 62:
1.151 deraadt 63: .if !empty(STATICPIE_ARCH:M${_arch})
1.154 kettenis 64: STATICPIE?=-pie
1.192 visa 65: .endif
66:
67: # Executables are always PIC on mips64.
68: # Do not pass -fno-pie to the compiler because clang does not accept it.
69: .if ${MACHINE_ARCH} == "mips64" || ${MACHINE_ARCH} == "mips64el"
70: NOPIE_FLAGS?=
1.151 deraadt 71: .endif
72:
1.121 pascal 73: .if !empty(PIE_ARCH:M${_arch})
1.137 miod 74: NOPIE_FLAGS?=-fno-pie
75: NOPIE_LDFLAGS?=-nopie
76: PIE_DEFAULT?=${DEFAULT_PIE_DEF}
1.121 pascal 77: .else
1.137 miod 78: NOPIE_FLAGS?=
79: PIE_DEFAULT?=
1.121 pascal 80: .endif
1.106 drahn 81: .endfor
1.32 niklas 82:
1.1 deraadt 83: # where the system object and source trees are kept; can be configurable
84: # by the user in case they want them in ~/foosrc and ~/fooobj, for example
85: BSDSRCDIR?= /usr/src
86: BSDOBJDIR?= /usr/obj
87:
88: BINGRP?= bin
1.9 deraadt 89: BINOWN?= root
1.1 deraadt 90: BINMODE?= 555
91: NONBINMODE?= 444
1.28 espie 92: DIRMODE?= 755
1.1 deraadt 93:
1.18 tholo 94: SHAREDIR?= /usr/share
95: SHAREGRP?= bin
96: SHAREOWN?= root
97: SHAREMODE?= ${NONBINMODE}
1.1 deraadt 98:
1.105 schwarze 99: MANDIR?= /usr/share/man/man
1.1 deraadt 100: MANGRP?= bin
1.9 deraadt 101: MANOWN?= root
1.1 deraadt 102: MANMODE?= ${NONBINMODE}
103:
104: LIBDIR?= /usr/lib
105: LIBGRP?= ${BINGRP}
106: LIBOWN?= ${BINOWN}
107: LIBMODE?= ${NONBINMODE}
108:
1.119 haesbaer 109: DOCDIR?= /usr/share/doc
1.1 deraadt 110: DOCGRP?= bin
1.9 deraadt 111: DOCOWN?= root
1.119 haesbaer 112: DOCMODE?= ${NONBINMODE}
1.1 deraadt 113:
1.93 espie 114: LOCALEDIR?= /usr/share/locale
115: LOCALEGRP?= wheel
116: LOCALEOWN?= root
117: LOCALEMODE?= ${NONBINMODE}
1.119 haesbaer 118:
119: .if !defined(CDIAGFLAGS)
120: CDIAGFLAGS= -Wall -Wpointer-arith -Wuninitialized -Wstrict-prototypes
1.143 martynas 121: CDIAGFLAGS+= -Wmissing-prototypes -Wunused -Wsign-compare
1.119 haesbaer 122: CDIAGFLAGS+= -Wshadow
1.120 sthen 123: . if ${COMPILER_VERSION} == "gcc4"
124: CDIAGFLAGS+= -Wdeclaration-after-statement
125: . endif
1.119 haesbaer 126: .endif
1.56 espie 127:
1.57 espie 128: # Shared files for system gnu configure, not used yet
129: GNUSYSTEM_AUX_DIR?=${BSDSRCDIR}/share/gnu
1.1 deraadt 130:
1.17 millert 131: INSTALL_COPY?= -c
1.13 niklas 132: .ifndef DEBUG
1.17 millert 133: INSTALL_STRIP?= -s
1.13 niklas 134: .endif
1.12 downsj 135:
1.151 deraadt 136: STATIC?= -static ${STATICPIE}
1.1 deraadt 137:
138: # Define SYS_INCLUDE to indicate whether you want symbolic links to the system
139: # source (``symlinks''), or a separate copy (``copies''); (latter useful
140: # in environments where it's not possible to keep /sys publicly readable)
141: #SYS_INCLUDE= symlinks
1.58 drahn 142:
1.86 pvalchev 143: # pic relocation flags.
1.196 kettenis 144: .if ${MACHINE_ARCH} == "alpha" || ${MACHINE_ARCH} == "powerpc" || \
145: ${MACHINE_ARCH} == "sparc64"
1.100 deraadt 146: PICFLAG?=-fPIC
1.86 pvalchev 147: .else
1.100 deraadt 148: PICFLAG?=-fpic
1.121 pascal 149: .endif
150:
1.129 kettenis 151: .if ${MACHINE_ARCH} == "alpha" || ${MACHINE_ARCH} == "powerpc" || \
1.176 tedu 152: ${MACHINE_ARCH} == "sparc64"
1.121 pascal 153: # big PIE
154: DEFAULT_PIE_DEF=-DPIE_DEFAULT=2
155: .else
156: # small pie
157: DEFAULT_PIE_DEF=-DPIE_DEFAULT=1
1.14 rahnds 158: .endif
159:
160: # don't try to generate PROFILED versions of libraries on machines
161: # which don't support profiling.
1.87 miod 162: .if 0
1.14 rahnds 163: NOPROFILE=
1.1 deraadt 164: .endif
1.180 natano 165:
1.181 tb 166: BUILDUSER?= build
167: WOBJGROUP?= wobj
168: WOBJUMASK?= 007
1.31 espie 169:
170: BSD_OWN_MK=Done
1.41 espie 171:
172: .PHONY: spell clean cleandir obj manpages print all \
1.98 espie 173: depend beforedepend afterdepend cleandepend subdirdepend \
1.172 bluhm 174: all cleanman includes \
1.41 espie 175: beforeinstall realinstall maninstall afterinstall install