make vfs & filesystems use failable copying
[minix3.git] / tools / Makefile.host
blob3088a91ba8ed96d9fc5e3e0e67a629aa08e115e5
1 #       $NetBSD: Makefile.host,v 1.31 2013/06/14 16:10:02 tsutsui Exp $
3 NOINFO=         # defined
4 NOLINT=         # defined
5 NOMAN=          # defined
7 .include <bsd.own.mk>
9 .ifndef NOCOMPATLIB
10 # Use TOOLDIR copy of libnbcompat and associated *.h files
11 .-include       "${TOOLDIR}/share/compat/defs.mk"
12 .elif !empty(.MAKE.OS:M*CYGWIN*)
13 HOSTEXEEXT=.exe
14 .endif
16 .if ${HOST_OSTYPE:C/\-.*//} == "Minix"
17 LDADD+= -lcompat_minix
18 .endif # ${HOST_OSTYPE:C/\-.*//} == "Minix"
20 # Resolve pathnames in variables.
21 _RESOLVE_VARS=  CFLAGS CPPFLAGS DPADD HOST_CPPFLAGS LDADD
22 .for var in ${_RESOLVE_VARS}
23 ${var}:=        ${${var}}
24 .endfor
26 # Switch over to the "real" Makefile.
27 .PROGDIR:=      ${.CURDIR}/../../${HOST_SRCDIR}
28 _CURDIR:=       ${.CURDIR}
29 HOSTPROG?=      ${PROG}
31 .CURDIR:=       ${.PROGDIR}
32 .PATH:          ${.CURDIR}
33 .include "${.CURDIR}/Makefile"
34 .-include "${.CURDIR}/../Makefile.inc"
36 # Resolve pathnames from "real" Makefile, and switch .CURDIR back.
37 .for var in ${_RESOLVE_VARS}
38 ${var}:=        ${${var}}
39 .endfor
40 .CURDIR:=       ${_CURDIR}
41 .undef          _CURDIR
43 # Set up the environment for <bsd.hostprog.mk>.
44 .if ${USETOOLS} != "yes"
45 .undef HOSTPROG
46 .endif
48 HOSTPROGNAME?=  ${HOSTPROG}
49 HOST_BINDIR?=   ${TOOLDIR}/bin
50 HOST_CPPFLAGS:= ${HOST_CPPFLAGS} ${CPPFLAGS}
51 HOST_CPPFLAGS:= ${HOST_CPPFLAGS:N-Wp,-iremap,*:N--sysroot=*}
52 HOST_INSTALLPROG?=${HOST_BINDIR}/${HOSTPROGNAME}${HOSTEXEEXT}
53 .undef LINKS
55 SRCS?=          ${HOSTPROG}.c
56 SRCS+=          ${HOST_SRCS}
58 .PATH:          ${.PROGDIR}
60 # Install rule.
61 realinstall: install.host install.files
62 install.host: ${HOST_INSTALLPROG}
63 ${HOST_INSTALLPROG}:: ${HOSTPROG}
64         ${_MKTARGET_INSTALL}
65         mkdir -p ${HOST_BINDIR}
66         ${HOST_INSTALL_FILE} -m ${BINMODE} ${HOSTPROG}${HOSTEXEEXT} ${.TARGET}
67 .if !empty(.MAKE.OS:M*CYGWIN*)
68         ${HOST_SH} ${NETBSDSRCDIR}/tools/binstall/mkmanifest ${.TARGET}
69 .endif
71 .if ${MKUPDATE} == "no"
72 .PHONY:         ${HOST_INSTALLPROG}
73 .endif
75 install.files:
76 .for F in ${HOSTFILES}
77 install.files: ${HOST_FILESDIR}/${F}
78 ${HOST_FILESDIR}/${F}: ${F}
79         ${_MKTARGET_INSTALL}
80         mkdir -p ${HOST_FILESDIR}
81         ${HOST_INSTALL_FILE} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET}
83 .if ${MKUPDATE} == "no"
84 .PHONY:         ${HOST_FILESDIR}/${F}
85 .endif
86 .endfor
88 .include <bsd.hostprog.mk>