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