2014-12-01 04:34:30 +03:00
|
|
|
# $NetBSD: bsd.hostlib.mk,v 1.19 2014/12/01 01:34:30 erh Exp $
|
2001-11-28 07:42:49 +03:00
|
|
|
|
|
|
|
.include <bsd.init.mk>
|
|
|
|
.include <bsd.sys.mk>
|
|
|
|
|
|
|
|
##### Basic targets
|
|
|
|
|
|
|
|
##### Default values
|
|
|
|
CFLAGS+= ${COPTS}
|
2014-12-01 04:34:30 +03:00
|
|
|
MKDEP_SUFFIXES?= .o .lo .d
|
2001-11-28 07:42:49 +03:00
|
|
|
|
|
|
|
# Override these:
|
2002-01-04 01:45:23 +03:00
|
|
|
MKDEP:= ${HOST_MKDEP}
|
2013-10-29 20:11:46 +04:00
|
|
|
MKDEPCXX:= ${HOST_MKDEPCXX}
|
2001-11-28 07:42:49 +03:00
|
|
|
|
2004-01-02 19:12:36 +03:00
|
|
|
.if ${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN)
|
2001-11-28 07:42:49 +03:00
|
|
|
OBJHOSTMACHINE= # set
|
|
|
|
.endif
|
|
|
|
|
|
|
|
##### Build rules
|
|
|
|
.if defined(HOSTLIB)
|
2004-06-10 04:29:58 +04:00
|
|
|
_YHLSRCS= ${SRCS:M*.[ly]:C/\..$/.c/} ${YHEADER:D${SRCS:M*.y:.y=.h}}
|
|
|
|
DPSRCS+= ${_YHLSRCS}
|
|
|
|
CLEANFILES+= ${_YHLSRCS}
|
2001-11-28 07:42:49 +03:00
|
|
|
.endif # defined(HOSTLIB)
|
|
|
|
|
|
|
|
.if !empty(SRCS:N*.h:N*.sh)
|
|
|
|
OBJS+= ${SRCS:N*.h:N*.sh:R:S/$/.lo/g}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(OBJS) && !empty(OBJS)
|
2011-08-05 13:36:28 +04:00
|
|
|
.NOPATH: lib${HOSTLIB}.a ${OBJS} ${_YHLSRCS}
|
2001-11-28 07:42:49 +03:00
|
|
|
|
2003-08-01 21:03:41 +04:00
|
|
|
${OBJS}: ${DPSRCS}
|
|
|
|
|
|
|
|
lib${HOSTLIB}.a: ${OBJS} ${DPADD}
|
2003-10-21 14:01:19 +04:00
|
|
|
${_MKTARGET_BUILD}
|
2003-10-18 19:33:59 +04:00
|
|
|
rm -f ${.TARGET}
|
2001-11-28 07:42:49 +03:00
|
|
|
${HOST_AR} cq ${.TARGET} ${OBJS}
|
2003-10-18 19:33:59 +04:00
|
|
|
${HOST_RANLIB} ${.TARGET}
|
2001-11-28 07:42:49 +03:00
|
|
|
|
|
|
|
.endif # defined(OBJS) && !empty(OBJS)
|
|
|
|
|
|
|
|
realall: lib${HOSTLIB}.a
|
|
|
|
|
2011-09-10 20:57:35 +04:00
|
|
|
CLEANFILES+= a.out [Ee]rrs mklog core *.core lib${HOSTLIB}.a ${OBJS}
|
2001-11-28 07:42:49 +03:00
|
|
|
|
|
|
|
beforedepend:
|
|
|
|
CFLAGS:= ${HOST_CFLAGS}
|
|
|
|
CPPFLAGS:= ${HOST_CPPFLAGS}
|
|
|
|
|
|
|
|
##### Pull in related .mk logic
|
|
|
|
.include <bsd.obj.mk>
|
2003-07-31 17:47:32 +04:00
|
|
|
.include <bsd.dep.mk>
|
2011-09-10 20:57:35 +04:00
|
|
|
.include <bsd.clean.mk>
|
2001-11-28 07:42:49 +03:00
|
|
|
|
|
|
|
${TARGETS}: # ensure existence
|