release.sh: restore -jJAILDIR option
[minix.git] / share / mk / bsd.hostlib.mk
blobf757e7b9cbf3d218865b2536b6bf9547fd75bf92
1 # $NetBSD: bsd.hostlib.mk,v 1.16 2011/09/10 16:57:35 apb Exp $
3 .include <bsd.init.mk>
4 .include <bsd.sys.mk>
6 ##### Basic targets
8 ##### Default values
9 CFLAGS+= ${COPTS}
10 HOST_MKDEP?= CC=${HOST_CC:Q} mkdep
11 MKDEP_SUFFIXES?= .o .lo
13 # Override these:
14 MKDEP:= ${HOST_MKDEP}
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