1# $NetBSD: bsd.hostlib.mk,v 1.15 2011/08/05 09:36:28 plunky Exp $ 2 3.include <bsd.init.mk> 4.include <bsd.sys.mk> 5 6##### Basic targets 7 8##### Default values 9CFLAGS+= ${COPTS} 10HOST_MKDEP?= CC=${HOST_CC:Q} mkdep 11MKDEP_SUFFIXES?= .o .lo 12 13# Override these: 14MKDEP:= ${HOST_MKDEP} 15 16.if ${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN) 17OBJHOSTMACHINE= # set 18.endif 19 20##### Build rules 21.if defined(HOSTLIB) 22_YHLSRCS= ${SRCS:M*.[ly]:C/\..$/.c/} ${YHEADER:D${SRCS:M*.y:.y=.h}} 23DPSRCS+= ${_YHLSRCS} 24CLEANFILES+= ${_YHLSRCS} 25.endif # defined(HOSTLIB) 26 27.if !empty(SRCS:N*.h:N*.sh) 28OBJS+= ${SRCS:N*.h:N*.sh:R:S/$/.lo/g} 29.endif 30 31.if defined(OBJS) && !empty(OBJS) 32.NOPATH: lib${HOSTLIB}.a ${OBJS} ${_YHLSRCS} 33 34${OBJS}: ${DPSRCS} 35 36lib${HOSTLIB}.a: ${OBJS} ${DPADD} 37 ${_MKTARGET_BUILD} 38 rm -f ${.TARGET} 39 ${HOST_AR} cq ${.TARGET} ${OBJS} 40 ${HOST_RANLIB} ${.TARGET} 41 42.endif # defined(OBJS) && !empty(OBJS) 43 44realall: lib${HOSTLIB}.a 45 46CLEANFILES+= a.out [Ee]rrs mklog core *.core lib${HOSTLIB}.a ${OBJS} 47 48beforedepend: 49CFLAGS:= ${HOST_CFLAGS} 50CPPFLAGS:= ${HOST_CPPFLAGS} 51 52##### Pull in related .mk logic 53.include <bsd.obj.mk> 54.include <bsd.dep.mk> 55.include <bsd.clean.mk> 56 57${TARGETS}: # ensure existence 58