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