Drop main() prototype. Syncs with NetBSD-8
[minix.git] / tools / Makefile.host
blob219b5e5385ecc705b3d9d01fbf746b3ce95889eb
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 # Resolve pathnames in variables.
17 _RESOLVE_VARS=  CFLAGS CPPFLAGS DPADD HOST_CPPFLAGS LDADD
18 .for var in ${_RESOLVE_VARS}
19 ${var}:=        ${${var}}
20 .endfor
22 # Switch over to the "real" Makefile.
23 .PROGDIR:=      ${.CURDIR}/../../${HOST_SRCDIR}
24 _CURDIR:=       ${.CURDIR}
25 HOSTPROG?=      ${PROG}
27 .CURDIR:=       ${.PROGDIR}
28 .PATH:          ${.CURDIR}
29 .include "${.CURDIR}/Makefile"
30 .-include "${.CURDIR}/../Makefile.inc"
32 # Resolve pathnames from "real" Makefile, and switch .CURDIR back.
33 .for var in ${_RESOLVE_VARS}
34 ${var}:=        ${${var}}
35 .endfor
36 .CURDIR:=       ${_CURDIR}
37 .undef          _CURDIR
39 # Set up the environment for <bsd.hostprog.mk>.
40 .if ${USETOOLS} != "yes"
41 .undef HOSTPROG
42 .endif
44 HOSTPROGNAME?=  ${HOSTPROG}
45 HOST_BINDIR?=   ${TOOLDIR}/bin
46 HOST_CPPFLAGS:= ${HOST_CPPFLAGS} ${CPPFLAGS}
47 HOST_CPPFLAGS:= ${HOST_CPPFLAGS:N-Wp,-iremap,*:N--sysroot=*}
48 HOST_INSTALLPROG?=${HOST_BINDIR}/${HOSTPROGNAME}${HOSTEXEEXT}
49 .undef LINKS
51 SRCS?=          ${HOSTPROG}.c
52 SRCS+=          ${HOST_SRCS}
54 .PATH:          ${.PROGDIR}
56 # Install rule.
57 realinstall: install.host install.files
58 install.host: ${HOST_INSTALLPROG}
59 ${HOST_INSTALLPROG}:: ${HOSTPROG}
60         ${_MKTARGET_INSTALL}
61         mkdir -p ${HOST_BINDIR}
62         ${HOST_INSTALL_FILE} -m ${BINMODE} ${HOSTPROG}${HOSTEXEEXT} ${.TARGET}
63 .if !empty(.MAKE.OS:M*CYGWIN*)
64         ${HOST_SH} ${NETBSDSRCDIR}/tools/binstall/mkmanifest ${.TARGET}
65 .endif
67 .if ${MKUPDATE} == "no"
68 .PHONY:         ${HOST_INSTALLPROG}
69 .endif
71 install.files:
72 .for F in ${HOSTFILES}
73 install.files: ${HOST_FILESDIR}/${F}
74 ${HOST_FILESDIR}/${F}: ${F}
75         ${_MKTARGET_INSTALL}
76         mkdir -p ${HOST_FILESDIR}
77         ${HOST_INSTALL_FILE} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET}
79 .if ${MKUPDATE} == "no"
80 .PHONY:         ${HOST_FILESDIR}/${F}
81 .endif
82 .endfor
84 .include <bsd.hostprog.mk>