include: reduce default stack size
[minix.git] / tools / Makefile.host
blobede0a7575b4108ac9432f5102c4f7dd8d02a22a4
1 #       $NetBSD: Makefile.host,v 1.28 2011/04/10 16:52:36 joerg Exp $
3 NOINFO=         # defined
4 NOLINT=         # defined
5 NOMAN=          # defined
7 .include <bsd.own.mk>
9 .ifndef NOCOMPATLIB
10 COMPATOBJ!=     cd ${.CURDIR}/../compat && ${PRINTOBJDIR}
11 .-include       "${COMPATOBJ}/defs.mk"
12 .endif
14 .if ${HOST_OSTYPE:C/\-.*//} == "Minix"
15 LDADD+= -lcompat_minix
16 .endif
18 # Resolve pathnames in variables.
19 _RESOLVE_VARS=  CFLAGS CPPFLAGS DPADD HOST_CPPFLAGS LDADD
20 .for var in ${_RESOLVE_VARS}
21 ${var}:=        ${${var}}
22 .endfor
24 # Switch over to the "real" Makefile.
25 .PROGDIR:=      ${.CURDIR}/../../${HOST_SRCDIR}
26 _CURDIR:=       ${.CURDIR}
27 HOSTPROG?=      ${PROG}
29 .CURDIR:=       ${.PROGDIR}
30 .PATH:          ${.CURDIR}
31 .include "${.CURDIR}/Makefile"
32 .-include "${.CURDIR}/../Makefile.inc"
34 # Resolve pathnames from "real" Makefile, and switch .CURDIR back.
35 .for var in ${_RESOLVE_VARS}
36 ${var}:=        ${${var}}
37 .endfor
38 .CURDIR:=       ${_CURDIR}
39 .undef          _CURDIR
41 # Set up the environment for <bsd.hostprog.mk>.
42 .if ${USETOOLS} != "yes"
43 .undef HOSTPROG
44 .endif
46 HOSTPROGNAME?=  ${HOSTPROG}
47 HOST_BINDIR?=   ${TOOLDIR}/bin
48 HOST_CPPFLAGS:= ${HOST_CPPFLAGS} ${CPPFLAGS}
49 HOST_CPPFLAGS:= ${HOST_CPPFLAGS:N-Wp,-iremap,*:N--sysroot=*}
50 .undef LINKS
52 SRCS?=          ${HOSTPROG}.c
53 SRCS+=          ${HOST_SRCS}
55 .PATH:          ${.PROGDIR}
57 # Install rule.
58 realinstall: install.host install.files
59 install.host: ${HOST_BINDIR}/${HOSTPROGNAME}
60 ${HOST_BINDIR}/${HOSTPROGNAME}:: ${HOSTPROG}
61         ${_MKTARGET_INSTALL}
62         mkdir -p ${HOST_BINDIR}
63         ${HOST_INSTALL_FILE} -m ${BINMODE} ${HOSTPROG}${HOSTEXEEXT} ${.TARGET}
65 .if ${MKUPDATE} == "no"
66 .PHONY:         ${HOST_BINDIR}/${HOSTPROGNAME}
67 .endif
69 install.files:
70 .for F in ${HOSTFILES}
71 install.files: ${HOST_FILESDIR}/${F}
72 ${HOST_FILESDIR}/${F}: ${F}
73         ${_MKTARGET_INSTALL}
74         mkdir -p ${HOST_FILESDIR}
75         ${HOST_INSTALL_FILE} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET}
77 .if ${MKUPDATE} == "no"
78 .PHONY:         ${HOST_FILESDIR}/${F}
79 .endif
80 .endfor
82 .include <bsd.hostprog.mk>