No empty .Rs/.Re
[netbsd-mini2440.git] / tools / Makefile.host
blobccffe02c72317b537879f3d6bfccf90c37fd5bae
1 #       $NetBSD$
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 .undef LINKS
47 SRCS?=          ${HOSTPROG}.c
48 SRCS+=          ${HOST_SRCS}
50 .PATH:          ${.PROGDIR}
52 # Install rule.
53 realinstall: install.host install.files
54 install.host: ${HOST_BINDIR}/${HOSTPROGNAME}
55 ${HOST_BINDIR}/${HOSTPROGNAME}:: ${HOSTPROG}
56         ${_MKTARGET_INSTALL}
57         mkdir -p ${HOST_BINDIR}
58         ${HOST_INSTALL_FILE} -m ${BINMODE} ${HOSTPROG}${HOSTEXEEXT} ${.TARGET}
60 .if ${MKUPDATE} == "no"
61 .PHONY:         ${HOST_BINDIR}/${HOSTPROGNAME}
62 .endif
64 install.files:
65 .for F in ${HOSTFILES}
66 install.files: ${HOST_FILESDIR}/${F}
67 ${HOST_FILESDIR}/${F}: ${F}
68         ${_MKTARGET_INSTALL}
69         mkdir -p ${HOST_FILESDIR}
70         ${HOST_INSTALL_FILE} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET}
72 .if ${MKUPDATE} == "no"
73 .PHONY:         ${HOST_FILESDIR}/${F}
74 .endif
75 .endfor
77 .include <bsd.hostprog.mk>