2017-02-08 06:44:40 +03:00
|
|
|
# $NetBSD: bsd.hostprog.mk,v 1.77 2017/02/08 03:44:41 kamil Exp $
|
1999-07-15 00:20:05 +04:00
|
|
|
# @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94
|
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
.include <bsd.init.mk>
|
2001-11-13 01:06:41 +03:00
|
|
|
.include <bsd.sys.mk>
|
1999-07-15 00:20:05 +04:00
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
##### Basic targets
|
1999-07-15 00:20:05 +04:00
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
##### Default values
|
2011-02-20 23:16:01 +03:00
|
|
|
LIBATF_C?= /usr/lib/libatf-c.a
|
|
|
|
LIBATF_CXX?= /usr/lib/libatf-c++.a
|
2006-06-19 19:44:33 +04:00
|
|
|
LIBBLUETOOTH?= /usr/lib/libbluetooth.a
|
1999-07-15 00:20:05 +04:00
|
|
|
LIBBZ2?= /usr/lib/libbz2.a
|
|
|
|
LIBC?= /usr/lib/libc.a
|
|
|
|
LIBCOMPAT?= /usr/lib/libcompat.a
|
|
|
|
LIBCRYPT?= /usr/lib/libcrypt.a
|
|
|
|
LIBCURSES?= /usr/lib/libcurses.a
|
2016-01-01 20:06:21 +03:00
|
|
|
LIBC_PIC?= /usr/lib/libc_pic.a
|
|
|
|
LIBC_SO?= /usr/lib/libc.so
|
1999-07-15 00:20:05 +04:00
|
|
|
LIBDBM?= /usr/lib/libdbm.a
|
|
|
|
LIBDES?= /usr/lib/libdes.a
|
|
|
|
LIBEDIT?= /usr/lib/libedit.a
|
2003-06-13 03:26:19 +04:00
|
|
|
LIBEVENT?= /usr/lib/libevent.a
|
2013-04-11 05:27:46 +04:00
|
|
|
LIBEVENT_OPENSSL?= /usr/lib/libevent_openssl.a
|
|
|
|
LIBEVENT_PTHREADS?= /usr/lib/libevent_pthreads.a
|
2012-03-01 00:07:51 +04:00
|
|
|
LIBEXPAT?= /usr/lib/libexpat.a
|
2008-10-02 21:54:51 +04:00
|
|
|
LIBFETCH?= /usr/lib/libfetch.a
|
2001-01-05 02:52:00 +03:00
|
|
|
LIBFORM?= /usr/lib/libform.a
|
1999-07-15 00:20:05 +04:00
|
|
|
LIBGCC?= /usr/lib/libgcc.a
|
|
|
|
LIBGNUMALLOC?= /usr/lib/libgnumalloc.a
|
2000-10-31 13:49:01 +03:00
|
|
|
LIBINTL?= /usr/lib/libintl.a
|
1999-07-15 00:20:05 +04:00
|
|
|
LIBIPSEC?= /usr/lib/libipsec.a
|
|
|
|
LIBKVM?= /usr/lib/libkvm.a
|
|
|
|
LIBL?= /usr/lib/libl.a
|
2013-02-17 01:40:05 +04:00
|
|
|
LIBLUTOK?= /usr/lib/liblutok.a
|
2010-11-02 22:13:58 +03:00
|
|
|
LIBLZMA?= /usr/lib/liblzma.a
|
1999-07-15 00:20:05 +04:00
|
|
|
LIBM?= /usr/lib/libm.a
|
2004-05-22 01:13:57 +04:00
|
|
|
LIBMAGIC?= /usr/lib/libmagic.a
|
1999-11-23 16:22:37 +03:00
|
|
|
LIBMENU?= /usr/lib/libmenu.a
|
1999-07-15 00:20:05 +04:00
|
|
|
LIBMP?= /usr/lib/libmp.a
|
|
|
|
LIBNTP?= /usr/lib/libntp.a
|
|
|
|
LIBOBJC?= /usr/lib/libobjc.a
|
2008-07-29 17:17:40 +04:00
|
|
|
LIBP2K?= /usr/lib/libp2k.a
|
2015-11-22 07:59:15 +03:00
|
|
|
LIBPANEL?= /usr/lib/libpanel.a
|
1999-07-15 00:20:05 +04:00
|
|
|
LIBPC?= /usr/lib/libpc.a
|
|
|
|
LIBPCAP?= /usr/lib/libpcap.a
|
2001-09-14 03:23:26 +04:00
|
|
|
LIBPCI?= /usr/lib/libpci.a
|
1999-07-15 00:20:05 +04:00
|
|
|
LIBPLOT?= /usr/lib/libplot.a
|
|
|
|
LIBPOSIX?= /usr/lib/libposix.a
|
2016-01-01 20:06:21 +03:00
|
|
|
LIBPTHREAD?= /usr/lib/libpthread.a
|
2006-10-23 02:53:41 +04:00
|
|
|
LIBPUFFS?= /usr/lib/libpuffs.a
|
2011-03-24 20:05:39 +03:00
|
|
|
LIBQUOTA?= /usr/lib/libquota.a
|
1999-07-15 00:20:05 +04:00
|
|
|
LIBRESOLV?= /usr/lib/libresolv.a
|
|
|
|
LIBRPCSVC?= /usr/lib/librpcsvc.a
|
2008-07-29 17:17:40 +04:00
|
|
|
LIBRUMP?= /usr/lib/librump.a
|
2010-11-22 14:29:07 +03:00
|
|
|
LIBRUMPCLIENT?= /usr/lib/librumpclient.a
|
2008-11-19 17:10:48 +03:00
|
|
|
LIBRUMPNET?= /usr/lib/librumpnet.a
|
2008-07-29 17:17:40 +04:00
|
|
|
LIBRUMPUSER?= /usr/lib/librumpuser.a
|
2008-11-19 17:10:48 +03:00
|
|
|
LIBRUMPVFS?= /usr/lib/librumpvfs.a
|
1999-07-15 00:20:05 +04:00
|
|
|
LIBSKEY?= /usr/lib/libskey.a
|
2011-10-14 02:08:16 +04:00
|
|
|
LIBSQLITE3?= /usr/lib/libsqlite3.a
|
2006-11-09 20:06:54 +03:00
|
|
|
LIBSSP?= /usr/lib/libssp.a
|
2006-10-09 12:32:11 +04:00
|
|
|
LIBSTDCXX?= /usr/lib/libstdc++.a
|
|
|
|
LIBSUPCXX?= /usr/lib/libsupc++.a
|
2010-02-03 18:34:37 +03:00
|
|
|
LIBTERMINFO?= /usr/lib/libterminfo.a
|
2016-01-01 20:06:21 +03:00
|
|
|
LIBUKFS?= /usr/lib/libukfs.a
|
1999-07-15 00:20:05 +04:00
|
|
|
LIBUTIL?= /usr/lib/libutil.a
|
|
|
|
LIBWRAP?= /usr/lib/libwrap.a
|
|
|
|
LIBY?= /usr/lib/liby.a
|
|
|
|
LIBZ?= /usr/lib/libz.a
|
|
|
|
|
2008-07-29 17:17:40 +04:00
|
|
|
##### rump file system modules
|
|
|
|
LIBRUMPFS_CD9660FS?= /usr/lib/librumpfs_cd9660fs.a
|
|
|
|
LIBRUMPFS_EFS?= /usr/lib/librumpfs_efs.a
|
|
|
|
LIBRUMPFS_EXT2FS?= /usr/lib/librumpfs_ext2fs.a
|
|
|
|
LIBRUMPFS_FFS?= /usr/lib/librumpfs_ffs.a
|
|
|
|
LIBRUMPFS_HFS?= /usr/lib/librumpfs_hfs.a
|
|
|
|
LIBRUMPFS_LFS?= /usr/lib/librumpfs_lfs.a
|
|
|
|
LIBRUMPFS_MSDOSFS?= /usr/lib/librumpfs_msdosfs.a
|
|
|
|
LIBRUMPFS_NTFS?= /usr/lib/librumpfs_ntfs.a
|
|
|
|
LIBRUMPFS_SYSPUFFS?= /usr/lib/librumpfs_syspuffs.a
|
|
|
|
LIBRUMPFS_TMPFS?= /usr/lib/librumpfs_tmpfs.a
|
|
|
|
LIBRUMPFS_UDF?= /usr/lib/librumpfs_udf.a
|
|
|
|
LIBRUMPFS_UFS?= /usr/lib/librumpfs_ufs.a
|
|
|
|
|
2014-12-01 04:34:30 +03:00
|
|
|
MKDEP_SUFFIXES?= .lo .ln .d
|
2001-11-02 08:21:47 +03:00
|
|
|
|
2001-11-13 20:36:14 +03:00
|
|
|
# Override these:
|
|
|
|
INSTALL:= ${INSTALL:NSTRIP=*}
|
2002-01-04 01:45:23 +03:00
|
|
|
MKDEP:= ${HOST_MKDEP}
|
2013-10-29 20:11:46 +04:00
|
|
|
MKDEPCXX:= ${HOST_MKDEPCXX}
|
2001-11-13 20:36:14 +03:00
|
|
|
|
2004-01-02 19:12:36 +03:00
|
|
|
.if ${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN)
|
2001-11-12 02:19:14 +03:00
|
|
|
OBJHOSTMACHINE= # set
|
|
|
|
.endif
|
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
##### Build rules
|
2005-09-02 07:57:10 +04:00
|
|
|
.if defined(HOSTPROG_CXX)
|
|
|
|
HOSTPROG= ${HOSTPROG_CXX}
|
|
|
|
.endif
|
|
|
|
|
1999-07-15 00:20:05 +04:00
|
|
|
.if defined(HOSTPROG)
|
|
|
|
SRCS?= ${HOSTPROG}.c
|
|
|
|
|
2004-06-10 04:29:58 +04:00
|
|
|
_YHPSRCS= ${SRCS:M*.[ly]:C/\..$/.c/} ${YHEADER:D${SRCS:M*.y:.y=.h}}
|
|
|
|
DPSRCS+= ${_YHPSRCS}
|
|
|
|
CLEANFILES+= ${_YHPSRCS}
|
1999-07-15 00:20:05 +04:00
|
|
|
|
|
|
|
.if !empty(SRCS:N*.h:N*.sh)
|
|
|
|
OBJS+= ${SRCS:N*.h:N*.sh:R:S/$/.lo/g}
|
|
|
|
LOBJS+= ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(OBJS) && !empty(OBJS)
|
2004-06-10 04:29:58 +04:00
|
|
|
.NOPATH: ${OBJS} ${HOSTPROG} ${_YHPSRCS}
|
1999-07-15 00:20:05 +04:00
|
|
|
|
2003-08-01 21:03:41 +04:00
|
|
|
${OBJS} ${LOBJS}: ${DPSRCS}
|
|
|
|
${HOSTPROG}: ${OBJS} ${DPADD}
|
2003-11-16 17:09:00 +03:00
|
|
|
${_MKTARGET_LINK}
|
1999-07-15 00:20:05 +04:00
|
|
|
${HOST_LINK.c} ${HOST_LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD}
|
2013-02-17 04:36:00 +04:00
|
|
|
.if !empty(.MAKE.OS:M*CYGWIN*)
|
2013-06-14 20:10:02 +04:00
|
|
|
${HOST_SH} ${NETBSDSRCDIR}/tools/binstall/mkmanifest ${HOSTPROG}
|
2013-02-17 04:36:00 +04:00
|
|
|
.endif
|
|
|
|
|
1999-07-15 00:20:05 +04:00
|
|
|
|
|
|
|
.endif # defined(OBJS) && !empty(OBJS)
|
|
|
|
|
|
|
|
.if !defined(MAN)
|
|
|
|
MAN= ${HOSTPROG}.1
|
|
|
|
.endif # !defined(MAN)
|
|
|
|
.endif # defined(HOSTPROG)
|
|
|
|
|
2000-01-22 22:31:00 +03:00
|
|
|
realall: ${HOSTPROG}
|
1999-07-15 00:20:05 +04:00
|
|
|
|
2011-09-10 20:57:35 +04:00
|
|
|
CLEANFILES+= a.out [Ee]rrs mklog core *.core ${HOSTPROG} ${OBJS} ${LOBJS}
|
1999-07-15 00:20:05 +04:00
|
|
|
|
|
|
|
beforedepend:
|
2001-11-13 01:06:41 +03:00
|
|
|
CFLAGS:= ${HOST_CFLAGS}
|
2010-12-25 21:56:44 +03:00
|
|
|
CPPFLAGS:= ${HOST_CPPFLAGS:N-Wp,-iremap,*}
|
1999-07-15 00:20:05 +04:00
|
|
|
|
|
|
|
lint: ${LOBJS}
|
|
|
|
.if defined(LOBJS) && !empty(LOBJS)
|
2004-01-27 06:31:48 +03:00
|
|
|
${LINT} ${LINTFLAGS} ${LDFLAGS:C/-L[ ]*/-L/Wg:M-L*} ${LOBJS} ${LDADD}
|
1999-07-15 00:20:05 +04:00
|
|
|
.endif
|
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
##### Pull in related .mk logic
|
2009-04-10 20:16:12 +04:00
|
|
|
LINKSMODE?= ${BINMODE}
|
1999-07-15 00:20:05 +04:00
|
|
|
.include <bsd.man.mk>
|
|
|
|
.include <bsd.nls.mk>
|
|
|
|
.include <bsd.files.mk>
|
|
|
|
.include <bsd.inc.mk>
|
|
|
|
.include <bsd.links.mk>
|
|
|
|
.include <bsd.dep.mk>
|
2011-09-10 20:57:35 +04:00
|
|
|
.include <bsd.clean.mk>
|
1999-07-15 00:20:05 +04:00
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
${TARGETS}: # ensure existence
|
2004-06-21 02:20:14 +04:00
|
|
|
|
|
|
|
# Override YACC/LEX rules so nbtool_config.h can be forced as the 1st include
|
|
|
|
.l.c:
|
|
|
|
${_MKTARGET_LEX}
|
|
|
|
${LEX.l} -o${.TARGET} ${.IMPSRC}
|
|
|
|
echo '#if HAVE_NBTOOL_CONFIG_H' > ${.TARGET}.1
|
|
|
|
echo '#include "nbtool_config.h"' >> ${.TARGET}.1
|
|
|
|
echo '#endif' >> ${.TARGET}.1
|
|
|
|
cat ${.TARGET} >> ${.TARGET}.1
|
|
|
|
mv ${.TARGET}.1 ${.TARGET}
|
|
|
|
.y.c:
|
|
|
|
${_MKTARGET_YACC}
|
|
|
|
${YACC.y} -o ${.TARGET} ${.IMPSRC}
|
|
|
|
echo '#if HAVE_NBTOOL_CONFIG_H' > ${.TARGET}.1
|
|
|
|
echo '#include "nbtool_config.h"' >> ${.TARGET}.1
|
|
|
|
echo '#endif' >> ${.TARGET}.1
|
|
|
|
cat ${.TARGET} >> ${.TARGET}.1
|
|
|
|
mv ${.TARGET}.1 ${.TARGET}
|