etc/protocols - sync with NetBSD-8
[minix.git] / share / mk / bsd.hostlib.mk
blobdebf50158ebcbdeb7df5a5cb02767532d9bf8812
1 # $NetBSD: bsd.hostlib.mk,v 1.19 2014/12/01 01:34:30 erh Exp $
3 .include <bsd.init.mk>
4 .include <bsd.sys.mk>
6 ##### Basic targets
8 ##### Default values
9 CFLAGS+= ${COPTS}
10 MKDEP_SUFFIXES?= .o .lo .d
12 # Override these:
13 MKDEP:= ${HOST_MKDEP}
14 MKDEPCXX:= ${HOST_MKDEPCXX}
16 .if ${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN)
17 OBJHOSTMACHINE= # set
18 .endif
20 ##### Build rules
21 .if defined(HOSTLIB)
22 _YHLSRCS= ${SRCS:M*.[ly]:C/\..$/.c/} ${YHEADER:D${SRCS:M*.y:.y=.h}}
23 DPSRCS+= ${_YHLSRCS}
24 CLEANFILES+= ${_YHLSRCS}
25 .endif # defined(HOSTLIB)
27 .if !empty(SRCS:N*.h:N*.sh)
28 OBJS+= ${SRCS:N*.h:N*.sh:R:S/$/.lo/g}
29 .endif
31 .if defined(OBJS) && !empty(OBJS)
32 .NOPATH: lib${HOSTLIB}.a ${OBJS} ${_YHLSRCS}
34 ${OBJS}: ${DPSRCS}
36 lib${HOSTLIB}.a: ${OBJS} ${DPADD}
37 ${_MKTARGET_BUILD}
38 rm -f ${.TARGET}
39 ${HOST_AR} cq ${.TARGET} ${OBJS}
40 ${HOST_RANLIB} ${.TARGET}
42 .endif # defined(OBJS) && !empty(OBJS)
44 realall: lib${HOSTLIB}.a
46 CLEANFILES+= a.out [Ee]rrs mklog core *.core lib${HOSTLIB}.a ${OBJS}
48 beforedepend:
49 CFLAGS:= ${HOST_CFLAGS}
50 CPPFLAGS:= ${HOST_CPPFLAGS}
52 ##### Pull in related .mk logic
53 .include <bsd.obj.mk>
54 .include <bsd.dep.mk>
55 .include <bsd.clean.mk>
57 ${TARGETS}: # ensure existence