2004-06-10 04:29:58 +04:00
|
|
|
# $NetBSD: bsd.hostprog.mk,v 1.43 2004/06/10 00:29:58 lukem 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
|
2001-08-14 11:02:13 +04:00
|
|
|
clean: cleanprog
|
1999-07-15 00:20:05 +04:00
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
##### Default values
|
1999-07-15 00:20:05 +04:00
|
|
|
LIBBZ2?= /usr/lib/libbz2.a
|
|
|
|
LIBC?= /usr/lib/libc.a
|
|
|
|
LIBC_PIC?= /usr/lib/libc_pic.a
|
2001-01-05 02:52:00 +03:00
|
|
|
LIBCDK?= /usr/lib/libcdk.a
|
1999-07-15 00:20:05 +04:00
|
|
|
LIBCOMPAT?= /usr/lib/libcompat.a
|
|
|
|
LIBCRYPT?= /usr/lib/libcrypt.a
|
|
|
|
LIBCURSES?= /usr/lib/libcurses.a
|
|
|
|
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
|
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
|
|
|
|
LIBKDB?= /usr/lib/libkdb.a
|
|
|
|
LIBKRB?= /usr/lib/libkrb.a
|
|
|
|
LIBKVM?= /usr/lib/libkvm.a
|
|
|
|
LIBL?= /usr/lib/libl.a
|
|
|
|
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
|
|
|
|
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
|
|
|
|
LIBRESOLV?= /usr/lib/libresolv.a
|
|
|
|
LIBRPCSVC?= /usr/lib/librpcsvc.a
|
|
|
|
LIBSKEY?= /usr/lib/libskey.a
|
2003-12-26 20:22:43 +03:00
|
|
|
LIBSTDCPP?= /usr/lib/libstdc++.a
|
1999-07-15 00:20:05 +04:00
|
|
|
LIBTERMCAP?= /usr/lib/libtermcap.a
|
|
|
|
LIBUTIL?= /usr/lib/libutil.a
|
|
|
|
LIBWRAP?= /usr/lib/libwrap.a
|
|
|
|
LIBY?= /usr/lib/liby.a
|
|
|
|
LIBZ?= /usr/lib/libz.a
|
|
|
|
|
2002-01-04 01:45:23 +03:00
|
|
|
HOST_MKDEP?= CC=${HOST_CC:Q} mkdep
|
2003-11-11 14:43:45 +03:00
|
|
|
MKDEP_SUFFIXES?= .lo .ln
|
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}
|
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
|
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}
|
|
|
|
|
|
|
|
.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
|
|
|
|
2004-01-29 04:48:45 +03:00
|
|
|
cleanprog: .PHONY
|
1999-07-15 00:20:05 +04:00
|
|
|
rm -f a.out [Ee]rrs mklog core *.core \
|
|
|
|
${HOSTPROG} ${OBJS} ${LOBJS} ${CLEANFILES}
|
|
|
|
|
|
|
|
beforedepend:
|
2001-11-13 01:06:41 +03:00
|
|
|
CFLAGS:= ${HOST_CFLAGS}
|
|
|
|
CPPFLAGS:= ${HOST_CPPFLAGS}
|
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
|
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>
|
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
${TARGETS}: # ensure existence
|