mkfs: move directory entry manipulation
[minix.git] / tools / Makefile.host
blob9d90dc222bd2c72c00ab2197f41b907bc5e49573
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 # Resolve pathnames in variables.
15 _RESOLVE_VARS=  CFLAGS CPPFLAGS DPADD HOST_CPPFLAGS LDADD
16 .for var in ${_RESOLVE_VARS}
17 ${var}:=        ${${var}}
18 .endfor
20 # Switch over to the "real" Makefile.
21 .PROGDIR:=      ${.CURDIR}/../../${HOST_SRCDIR}
22 _CURDIR:=       ${.CURDIR}
23 HOSTPROG?=      ${PROG}
25 .CURDIR:=       ${.PROGDIR}
26 .PATH:          ${.CURDIR}
27 .include "${.CURDIR}/Makefile"
28 .-include "${.CURDIR}/../Makefile.inc"
30 # Resolve pathnames from "real" Makefile, and switch .CURDIR back.
31 .for var in ${_RESOLVE_VARS}
32 ${var}:=        ${${var}}
33 .endfor
34 .CURDIR:=       ${_CURDIR}
35 .undef          _CURDIR
37 # Set up the environment for <bsd.hostprog.mk>.
38 .if ${USETOOLS} != "yes"
39 .undef HOSTPROG
40 .endif
42 HOSTPROGNAME?=  ${HOSTPROG}
43 HOST_BINDIR?=   ${TOOLDIR}/bin
44 HOST_CPPFLAGS:= ${HOST_CPPFLAGS} ${CPPFLAGS}
45 HOST_CPPFLAGS:= ${HOST_CPPFLAGS:N-Wp,-iremap,*:N--sysroot=*}
46 .undef LINKS
48 SRCS?=          ${HOSTPROG}.c
49 SRCS+=          ${HOST_SRCS}
51 .PATH:          ${.PROGDIR}
53 # Install rule.
54 realinstall: install.host install.files
55 install.host: ${HOST_BINDIR}/${HOSTPROGNAME}
56 ${HOST_BINDIR}/${HOSTPROGNAME}:: ${HOSTPROG}
57         ${_MKTARGET_INSTALL}
58         mkdir -p ${HOST_BINDIR}
59         ${HOST_INSTALL_FILE} -m ${BINMODE} ${HOSTPROG}${HOSTEXEEXT} ${.TARGET}
61 .if ${MKUPDATE} == "no"
62 .PHONY:         ${HOST_BINDIR}/${HOSTPROGNAME}
63 .endif
65 install.files:
66 .for F in ${HOSTFILES}
67 install.files: ${HOST_FILESDIR}/${F}
68 ${HOST_FILESDIR}/${F}: ${F}
69         ${_MKTARGET_INSTALL}
70         mkdir -p ${HOST_FILESDIR}
71         ${HOST_INSTALL_FILE} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET}
73 .if ${MKUPDATE} == "no"
74 .PHONY:         ${HOST_FILESDIR}/${F}
75 .endif
76 .endfor
78 .include <bsd.hostprog.mk>