tools/tcp_stream: Set message size on both send and receive sides
[dragonfly.git] / contrib / bmake / mk / own.mk
blobe29ff9e6d6c74a99eb7649f35afca78203684339
1 # $Id: own.mk,v 1.27 2013/07/18 05:46:24 sjg Exp $
3 .if !target(__${.PARSEFILE}__)
4 __${.PARSEFILE}__:
6 .if !target(__init.mk__)
7 .include "init.mk"
8 .endif
10 .ifndef NOMAKECONF
11 MAKECONF?= /etc/mk.conf
12 .-include "${MAKECONF}"
13 .endif
15 .include <host-target.mk>
17 TARGET_OSNAME?= ${_HOST_OSNAME}
18 TARGET_OSREL?= ${_HOST_OSREL}
19 TARGET_OSTYPE?= ${HOST_OSTYPE}
20 TARGET_HOST?= ${HOST_TARGET}
22 # these may or may not exist
23 .-include "${TARGET_HOST}.mk"
24 .-include "config.mk"
26 RM?= rm
27 LN?= ln
28 INSTALL?= install
30 prefix?= /usr
31 .if exists(${prefix}/lib)
32 libprefix?= ${prefix}
33 .else
34 libprefix?= /usr
35 .endif
37 # FreeBSD at least does not set this
38 MACHINE_ARCH?=${MACHINE}
39 # we need to make sure these are defined too in case sys.mk fails to.
40 COMPILE.s?= ${CC} ${AFLAGS} -c
41 LINK.s?= ${CC} ${AFLAGS} ${LDFLAGS}
42 COMPILE.S?= ${CC} ${AFLAGS} ${CPPFLAGS} -c -traditional-cpp
43 LINK.S?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
44 COMPILE.c?= ${CC} ${CFLAGS} ${CPPFLAGS} -c
45 LINK.c?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
46 CXXFLAGS?= ${CFLAGS}
47 COMPILE.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
48 LINK.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
49 COMPILE.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c
50 LINK.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS}
51 COMPILE.f?= ${FC} ${FFLAGS} -c
52 LINK.f?= ${FC} ${FFLAGS} ${LDFLAGS}
53 COMPILE.F?= ${FC} ${FFLAGS} ${CPPFLAGS} -c
54 LINK.F?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
55 COMPILE.r?= ${FC} ${FFLAGS} ${RFLAGS} -c
56 LINK.r?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
57 LEX.l?= ${LEX} ${LFLAGS}
58 COMPILE.p?= ${PC} ${PFLAGS} ${CPPFLAGS} -c
59 LINK.p?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
60 YACC.y?= ${YACC} ${YFLAGS}
62 # for suffix rules
63 IMPFLAGS?= ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}}
64 .for s in .c .cc
65 COMPILE.$s += ${IMPFLAGS}
66 LINK.$s += ${IMPFLAGS}
67 .endfor
69 PRINT.VAR.MAKE = MAKESYSPATH=${MAKESYSPATH:U${.PARSEDIR}} ${.MAKE}
70 .if empty(.MAKEFLAGS:M-V*)
71 .if defined(MAKEOBJDIRPREFIX) || defined(MAKEOBJDIR)
72 PRINTOBJDIR= ${PRINT.VAR.MAKE} -r -V .OBJDIR -f /dev/null xxx
73 .else
74 PRINTOBJDIR= ${PRINT.VAR.MAKE} -V .OBJDIR
75 .endif
76 .else
77 PRINTOBJDIR= echo # prevent infinite recursion
78 .endif
80 # we really like to have SRCTOP and OBJTOP defined...
81 .if !defined(SRCTOP) || !defined(OBJTOP)
82 .-include "srctop.mk"
83 .endif
85 .if !defined(SRCTOP) || !defined(OBJTOP)
86 # dpadd.mk is rather pointless without these
87 OPTIONS_DEFAULT_NO+= DPADD_MK
88 .endif
90 # process options
91 OPTIONS_DEFAULT_NO+= \
92 INSTALL_AS_USER \
93 GPROF \
94 LIBTOOL \
95 LINT \
96 META_MODE \
98 OPTIONS_DEFAULT_YES+= \
99 ARCHIVE \
100 AUTODEP \
101 AUTO_OBJ \
102 CRYPTO \
103 DOC \
104 DPADD_MK \
105 GDB \
106 KERBEROS \
107 LINKLIB \
108 MAN \
109 NLS \
110 OBJ \
111 PIC \
112 SHARE \
113 SKEY \
114 YP \
116 OPTIONS_DEFAULT_DEPENDENT+= \
117 CATPAGES/MAN \
118 OBJDIRS/OBJ \
119 PICINSTALL/LINKLIB \
120 PICLIB/PIC \
121 PROFILE/LINKLIB \
123 .include <options.mk>
125 .if ${MK_INSTALL_AS_USER} == "yes"
126 # We ignore this if user is root.
127 _uid!= id -u
128 .if ${_uid} != 0
129 .if !defined(USERGRP)
130 USERGRP!= id -g
131 .export USERGRP
132 .endif
133 .for x in BIN CONF DOC INFO KMOD LIB MAN NLS SHARE
134 $xOWN= ${USER}
135 $xGRP= ${USERGRP}
136 .endfor
137 .endif
138 .endif
140 # override this in sys.mk
141 ROOT_GROUP?= wheel
142 BINGRP?= ${ROOT_GROUP}
143 BINOWN?= root
144 BINMODE?= 555
145 NONBINMODE?= 444
147 # Define MANZ to have the man pages compressed (gzip)
148 #MANZ= 1
150 MANTARGET?= cat
151 MANDIR?= ${prefix}/share/man/${MANTARGET}
152 MANGRP?= ${BINGRP}
153 MANOWN?= ${BINOWN}
154 MANMODE?= ${NONBINMODE}
156 LIBDIR?= ${libprefix}/lib
157 SHLIBDIR?= ${libprefix}/lib
158 .if ${USE_SHLIBDIR:Uno} == "yes"
159 _LIBSODIR?= ${SHLIBDIR}
160 .else
161 _LIBSODIR?= ${LIBDIR}
162 .endif
163 # this is where ld.*so lives
164 SHLINKDIR?= /usr/libexec
165 LINTLIBDIR?= ${libprefix}/libdata/lint
166 LIBGRP?= ${BINGRP}
167 LIBOWN?= ${BINOWN}
168 LIBMODE?= ${NONBINMODE}
170 DOCDIR?= ${prefix}/share/doc
171 DOCGRP?= ${BINGRP}
172 DOCOWN?= ${BINOWN}
173 DOCMODE?= ${NONBINMODE}
175 NLSDIR?= ${prefix}/share/nls
176 NLSGRP?= ${BINGRP}
177 NLSOWN?= ${BINOWN}
178 NLSMODE?= ${NONBINMODE}
180 KMODDIR?= ${prefix}/lkm
181 KMODGRP?= ${BINGRP}
182 KMODOWN?= ${BINOWN}
183 KMODMODE?= ${NONBINMODE}
185 COPY?= -c
186 STRIP_FLAG?= -s
188 .if ${TARGET_OSNAME} == "NetBSD"
189 .if exists(/usr/libexec/ld.elf_so)
190 OBJECT_FMT=ELF
191 .endif
192 OBJECT_FMT?=a.out
193 .endif
194 # sys.mk should set something appropriate if need be.
195 OBJECT_FMT?=ELF
197 .if (${_HOST_OSNAME} == "FreeBSD")
198 CFLAGS+= ${CPPFLAGS}
199 .endif
201 # allow for per target flags
202 # apply the :T:R first, so the more specific :T can override if needed
203 CPPFLAGS += ${CPPFLAGS_${.TARGET:T:R}} ${CPPFLAGS_${.TARGET:T}}
204 CFLAGS += ${CFLAGS_${.TARGET:T:R}} ${CFLAGS_${.TARGET:T}}
206 # Define SYS_INCLUDE to indicate whether you want symbolic links to the system
207 # source (``symlinks''), or a separate copy (``copies''); (latter useful
208 # in environments where it's not possible to keep /sys publicly readable)
209 #SYS_INCLUDE= symlinks
211 # don't try to generate PIC versions of libraries on machines
212 # which don't support PIC.
213 .if (${MACHINE_ARCH} == "vax") || \
214 ((${MACHINE_ARCH} == "mips") && defined(STATIC_TOOLCHAIN)) || \
215 ((${MACHINE_ARCH} == "alpha") && defined(ECOFF_TOOLCHAIN))
216 MK_PIC=no
217 .endif
219 # No lint, for now.
220 NOLINT=
223 .if ${MK_LINKLIB} == "no"
224 MK_PICINSTALL= no
225 MK_PROFILE= no
226 .endif
228 .if ${MK_MAN} == "no"
229 MK_CATPAGES= no
230 .endif
232 .if ${MK_OBJ} == "no"
233 MK_OBJDIRS= no
234 MK_AUTO_OBJ= no
235 .endif
237 .if ${MK_SHARE} == "no"
238 MK_CATPAGES= no
239 MK_DOC= no
240 MK_INFO= no
241 MK_MAN= no
242 MK_NLS= no
243 .endif
245 .endif