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