Annotation of src/share/mk/bsd.own.mk, Revision 1.140
1.140 ! miod 1: # $OpenBSD: bsd.own.mk,v 1.139 2013/03/23 15:04:28 miod 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
15: # Set `KERBEROS5' to `yes' to build with support for Kerberos5 authentication.
1.47 hin 16: KERBEROS5?= yes
1.19 downsj 17: # Set `YP' to `yes' to build with support for NIS/YP.
1.15 millert 18: YP?= yes
1.19 downsj 19: # Set `TCP_WRAPPERS' to `yes' to build certain networking daemons with
20: # integrated support for libwrap.
21: TCP_WRAPPERS?= yes
1.32 niklas 22: # Set `DEBUGLIBS' to `yes' to build libraries with debugging symbols
1.33 marc 23: DEBUGLIBS?= no
1.61 pvalchev 24: # Set toolchain to be able to know differences.
1.50 drahn 25: ELF_TOOLCHAIN?= yes
1.71 espie 26:
1.136 miod 27: GCC2_ARCH=vax
1.130 deraadt 28: GCC4_ARCH=alpha amd64 arm hppa hppa64 i386 ia64 mips64 mips64el powerpc sh sparc sparc64
1.139 miod 29: BINUTILS217_ARCH=hppa64 ia64
1.127 deraadt 30:
31: # i386 PIE works; but there are RAMDISK fitting problems.
1.131 deraadt 32: # powerpc has problems on some "embedded" powerpc.
33: # arm needs binutils-2.17, which still lacks W^X support
1.130 deraadt 34: PIE_ARCH=alpha amd64 hppa mips64 mips64el sh sparc64
1.106 drahn 35:
36: .for _arch in ${MACHINE_ARCH}
37: .if !empty(GCC2_ARCH:M${_arch})
1.101 espie 38: COMPILER_VERSION?=gcc2
1.106 drahn 39: .elif !empty(GCC4_ARCH:M${_arch})
1.101 espie 40: COMPILER_VERSION?=gcc4
1.92 mickey 41: .else
1.101 espie 42: COMPILER_VERSION?=gcc3
1.107 drahn 43: .endif
44:
45: .if !empty(BINUTILS217_ARCH:M${_arch})
46: BINUTILS_VERSION=binutils-2.17
47: .else
48: BINUTILS_VERSION=binutils
1.72 mickey 49: .endif
1.121 pascal 50:
51: .if !empty(PIE_ARCH:M${_arch})
1.137 miod 52: NOPIE_FLAGS?=-fno-pie
53: NOPIE_LDFLAGS?=-nopie
54: PIE_DEFAULT?=${DEFAULT_PIE_DEF}
1.121 pascal 55: .else
1.137 miod 56: NOPIE_FLAGS?=
57: PIE_DEFAULT?=
1.121 pascal 58: .endif
1.106 drahn 59: .endfor
1.117 matthew 60:
61: .if ${COMPILER_VERSION} == "gcc4"
62: VISIBILITY_HIDDEN?=-fvisibility=hidden
63: .endif
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.5 tholo 95:
96: LKMDIR?= /usr/lkm
97: LKMGRP?= ${BINGRP}
98: LKMOWN?= ${BINOWN}
99: LKMMODE?= ${NONBINMODE}
1.1 deraadt 100:
101: NLSDIR?= /usr/share/nls
102: NLSGRP?= bin
1.9 deraadt 103: NLSOWN?= root
1.1 deraadt 104: NLSMODE?= ${NONBINMODE}
1.93 espie 105:
106: LOCALEDIR?= /usr/share/locale
107: LOCALEGRP?= wheel
108: LOCALEOWN?= root
109: LOCALEMODE?= ${NONBINMODE}
1.119 haesbaer 110:
111: .if !defined(CDIAGFLAGS)
112: CDIAGFLAGS= -Wall -Wpointer-arith -Wuninitialized -Wstrict-prototypes
113: CDIAGFLAGS+= -Wmissing-prototypes -Wunused -Wsign-compare -Wbounded
114: CDIAGFLAGS+= -Wshadow
1.120 sthen 115: . if ${COMPILER_VERSION} == "gcc4"
116: CDIAGFLAGS+= -Wdeclaration-after-statement
117: . endif
1.119 haesbaer 118: .endif
1.56 espie 119:
1.57 espie 120: # Shared files for system gnu configure, not used yet
121: GNUSYSTEM_AUX_DIR?=${BSDSRCDIR}/share/gnu
1.1 deraadt 122:
1.17 millert 123: INSTALL_COPY?= -c
1.13 niklas 124: .ifndef DEBUG
1.17 millert 125: INSTALL_STRIP?= -s
1.13 niklas 126: .endif
1.12 downsj 127:
128: # This may be changed for _single filesystem_ configurations (such as
129: # routers and other embedded systems); normal systems should leave it alone!
1.11 downsj 130: STATIC?= -static
1.1 deraadt 131:
132: # Define SYS_INCLUDE to indicate whether you want symbolic links to the system
133: # source (``symlinks''), or a separate copy (``copies''); (latter useful
134: # in environments where it's not possible to keep /sys publicly readable)
135: #SYS_INCLUDE= symlinks
136:
137: # don't try to generate PIC versions of libraries on machines
138: # which don't support PIC.
1.134 miod 139: .if ${MACHINE_ARCH} == "vax"
1.1 deraadt 140: NOPIC=
1.58 drahn 141: .endif
142:
1.86 pvalchev 143: # pic relocation flags.
1.96 martin 144: .if (${MACHINE_ARCH} == "alpha") || (${MACHINE_ARCH} == "sparc64")
1.100 deraadt 145: PICFLAG?=-fPIC
1.86 pvalchev 146: .else
1.100 deraadt 147: PICFLAG?=-fpic
1.62 art 148: .endif
1.86 pvalchev 149:
1.95 brad 150: .if ${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64"
1.58 drahn 151: ASPICFLAG=-KPIC
1.95 brad 152: .elif ${ELF_TOOLCHAIN:L} == "no"
1.58 drahn 153: ASPICFLAG=-k
1.121 pascal 154: .endif
155:
1.129 kettenis 156: .if ${MACHINE_ARCH} == "alpha" || ${MACHINE_ARCH} == "powerpc" || \
157: ${MACHINE_ARCH} == "sparc64"
1.121 pascal 158: # big PIE
159: DEFAULT_PIE_DEF=-DPIE_DEFAULT=2
160: .else
161: # small pie
162: DEFAULT_PIE_DEF=-DPIE_DEFAULT=1
1.14 rahnds 163: .endif
164:
165: # don't try to generate PROFILED versions of libraries on machines
166: # which don't support profiling.
1.87 miod 167: .if 0
1.14 rahnds 168: NOPROFILE=
1.1 deraadt 169: .endif
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.115 jsg 175: all cleanman nlsinstall cleannls includes \
1.41 espie 176: beforeinstall realinstall maninstall afterinstall install