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