1# $OpenBSD: bsd.own.mk,v 1.177 2016/09/03 10:47:24 jsg Exp $ 2# $NetBSD: bsd.own.mk,v 1.24 1996/04/13 02:08:09 thorpej Exp $ 3 4# Host-specific overrides 5.if defined(MAKECONF) && exists(${MAKECONF}) 6.include "${MAKECONF}" 7.elif exists(/etc/mk.conf) 8.include "/etc/mk.conf" 9.endif 10 11# Set `WARNINGS' to `yes' to add appropriate warnings to each compilation 12WARNINGS?= no 13# Set `SKEY' to `yes' to build with support for S/key authentication. 14SKEY?= yes 15# Set `YP' to `yes' to build with support for NIS/YP. 16YP?= yes 17 18GCC3_ARCH=m88k 19 20# m88k: ? 21PIE_ARCH=alpha amd64 arm hppa i386 mips64 mips64el powerpc sh sparc64 22STATICPIE_ARCH=alpha amd64 hppa i386 mips64 mips64el powerpc sh sparc64 23 24.for _arch in ${MACHINE_ARCH} 25.if !empty(GCC3_ARCH:M${_arch}) 26COMPILER_VERSION?=gcc3 27.else 28COMPILER_VERSION?=gcc4 29.endif 30 31.if !empty(STATICPIE_ARCH:M${_arch}) 32STATICPIE?=-pie 33.endif 34 35.if !empty(PIE_ARCH:M${_arch}) 36NOPIE_FLAGS?=-fno-pie 37NOPIE_LDFLAGS?=-nopie 38PIE_DEFAULT?=${DEFAULT_PIE_DEF} 39.else 40NOPIE_FLAGS?= 41PIE_DEFAULT?= 42.endif 43.endfor 44 45# where the system object and source trees are kept; can be configurable 46# by the user in case they want them in ~/foosrc and ~/fooobj, for example 47BSDSRCDIR?= /usr/src 48BSDOBJDIR?= /usr/obj 49 50BINGRP?= bin 51BINOWN?= root 52BINMODE?= 555 53NONBINMODE?= 444 54DIRMODE?= 755 55 56SHAREDIR?= /usr/share 57SHAREGRP?= bin 58SHAREOWN?= root 59SHAREMODE?= ${NONBINMODE} 60 61MANDIR?= /usr/share/man/man 62MANGRP?= bin 63MANOWN?= root 64MANMODE?= ${NONBINMODE} 65 66LIBDIR?= /usr/lib 67LIBGRP?= ${BINGRP} 68LIBOWN?= ${BINOWN} 69LIBMODE?= ${NONBINMODE} 70 71DOCDIR?= /usr/share/doc 72DOCGRP?= bin 73DOCOWN?= root 74DOCMODE?= ${NONBINMODE} 75 76LKMDIR?= /usr/lkm 77LKMGRP?= ${BINGRP} 78LKMOWN?= ${BINOWN} 79LKMMODE?= ${NONBINMODE} 80 81LOCALEDIR?= /usr/share/locale 82LOCALEGRP?= wheel 83LOCALEOWN?= root 84LOCALEMODE?= ${NONBINMODE} 85 86.if !defined(CDIAGFLAGS) 87CDIAGFLAGS= -Wall -Wpointer-arith -Wuninitialized -Wstrict-prototypes 88CDIAGFLAGS+= -Wmissing-prototypes -Wunused -Wsign-compare 89CDIAGFLAGS+= -Wshadow 90. if ${COMPILER_VERSION} == "gcc4" 91CDIAGFLAGS+= -Wdeclaration-after-statement 92. endif 93.endif 94 95# Shared files for system gnu configure, not used yet 96GNUSYSTEM_AUX_DIR?=${BSDSRCDIR}/share/gnu 97 98INSTALL_COPY?= -c 99.ifndef DEBUG 100INSTALL_STRIP?= -s 101.endif 102 103STATIC?= -static ${STATICPIE} 104 105# Define SYS_INCLUDE to indicate whether you want symbolic links to the system 106# source (``symlinks''), or a separate copy (``copies''); (latter useful 107# in environments where it's not possible to keep /sys publicly readable) 108#SYS_INCLUDE= symlinks 109 110# pic relocation flags. 111.if (${MACHINE_ARCH} == "alpha") || (${MACHINE_ARCH} == "sparc64") 112PICFLAG?=-fPIC 113.else 114PICFLAG?=-fpic 115.endif 116 117.if ${MACHINE_ARCH} == "sparc64" 118ASPICFLAG=-KPIC 119.endif 120 121.if ${MACHINE_ARCH} == "alpha" || ${MACHINE_ARCH} == "powerpc" || \ 122 ${MACHINE_ARCH} == "sparc64" 123# big PIE 124DEFAULT_PIE_DEF=-DPIE_DEFAULT=2 125.else 126# small pie 127DEFAULT_PIE_DEF=-DPIE_DEFAULT=1 128.endif 129 130# don't try to generate PROFILED versions of libraries on machines 131# which don't support profiling. 132.if 0 133NOPROFILE= 134.endif 135 136BSD_OWN_MK=Done 137 138.PHONY: spell clean cleandir obj manpages print all \ 139 depend beforedepend afterdepend cleandepend subdirdepend \ 140 all cleanman includes \ 141 beforeinstall realinstall maninstall afterinstall install 142