No empty .Rs/.Re
[netbsd-mini2440.git] / share / mk / bsd.hostprog.mk
blobd480a52a1ffb63d69c9c4e4f3220686f1e8929e6
1 # $NetBSD: bsd.hostprog.mk,v 1.55 2009/04/10 16:16:12 apb Exp $
2 # @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94
4 .include <bsd.init.mk>
5 .include <bsd.sys.mk>
7 ##### Basic targets
8 clean: cleanprog
10 ##### Default values
11 LIBBLUETOOTH?= /usr/lib/libbluetooth.a
12 LIBBZ2?= /usr/lib/libbz2.a
13 LIBC?= /usr/lib/libc.a
14 LIBC_PIC?= /usr/lib/libc_pic.a
15 LIBC_SO?= /usr/lib/libc.so
16 LIBCOMPAT?= /usr/lib/libcompat.a
17 LIBCRYPT?= /usr/lib/libcrypt.a
18 LIBCURSES?= /usr/lib/libcurses.a
19 LIBDBM?= /usr/lib/libdbm.a
20 LIBDES?= /usr/lib/libdes.a
21 LIBEDIT?= /usr/lib/libedit.a
22 LIBEVENT?= /usr/lib/libevent.a
23 LIBFETCH?= /usr/lib/libfetch.a
24 LIBFORM?= /usr/lib/libform.a
25 LIBGCC?= /usr/lib/libgcc.a
26 LIBGNUMALLOC?= /usr/lib/libgnumalloc.a
27 LIBINTL?= /usr/lib/libintl.a
28 LIBIPSEC?= /usr/lib/libipsec.a
29 LIBKVM?= /usr/lib/libkvm.a
30 LIBL?= /usr/lib/libl.a
31 LIBM?= /usr/lib/libm.a
32 LIBMAGIC?= /usr/lib/libmagic.a
33 LIBMENU?= /usr/lib/libmenu.a
34 LIBMP?= /usr/lib/libmp.a
35 LIBNTP?= /usr/lib/libntp.a
36 LIBOBJC?= /usr/lib/libobjc.a
37 LIBP2K?= /usr/lib/libp2k.a
38 LIBPC?= /usr/lib/libpc.a
39 LIBPCAP?= /usr/lib/libpcap.a
40 LIBPCI?= /usr/lib/libpci.a
41 LIBPLOT?= /usr/lib/libplot.a
42 LIBPOSIX?= /usr/lib/libposix.a
43 LIBPUFFS?= /usr/lib/libpuffs.a
44 LIBRESOLV?= /usr/lib/libresolv.a
45 LIBRPCSVC?= /usr/lib/librpcsvc.a
46 LIBRUMP?= /usr/lib/librump.a
47 LIBRUMPNET?= /usr/lib/librumpnet.a
48 LIBRUMPUSER?= /usr/lib/librumpuser.a
49 LIBRUMPVFS?= /usr/lib/librumpvfs.a
50 LIBSKEY?= /usr/lib/libskey.a
51 LIBSSP?= /usr/lib/libssp.a
52 LIBSTDCXX?= /usr/lib/libstdc++.a
53 LIBSUPCXX?= /usr/lib/libsupc++.a
54 LIBTERMCAP?= /usr/lib/libtermcap.a
55 LIBUTIL?= /usr/lib/libutil.a
56 LIBWRAP?= /usr/lib/libwrap.a
57 LIBUKFS?= /usr/lib/libukfs.a
58 LIBY?= /usr/lib/liby.a
59 LIBZ?= /usr/lib/libz.a
61 ##### rump file system modules
62 LIBRUMPFS_CD9660FS?= /usr/lib/librumpfs_cd9660fs.a
63 LIBRUMPFS_EFS?= /usr/lib/librumpfs_efs.a
64 LIBRUMPFS_EXT2FS?= /usr/lib/librumpfs_ext2fs.a
65 LIBRUMPFS_FFS?= /usr/lib/librumpfs_ffs.a
66 LIBRUMPFS_HFS?= /usr/lib/librumpfs_hfs.a
67 LIBRUMPFS_LFS?= /usr/lib/librumpfs_lfs.a
68 LIBRUMPFS_MSDOSFS?= /usr/lib/librumpfs_msdosfs.a
69 LIBRUMPFS_NTFS?= /usr/lib/librumpfs_ntfs.a
70 LIBRUMPFS_SYSPUFFS?= /usr/lib/librumpfs_syspuffs.a
71 LIBRUMPFS_TMPFS?= /usr/lib/librumpfs_tmpfs.a
72 LIBRUMPFS_UDF?= /usr/lib/librumpfs_udf.a
73 LIBRUMPFS_UFS?= /usr/lib/librumpfs_ufs.a
75 HOST_MKDEP?= CC=${HOST_CC:Q} mkdep
76 MKDEP_SUFFIXES?= .lo .ln
78 # Override these:
79 INSTALL:= ${INSTALL:NSTRIP=*}
80 MKDEP:= ${HOST_MKDEP}
82 .if ${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN)
83 OBJHOSTMACHINE= # set
84 .endif
86 ##### Build rules
87 .if defined(HOSTPROG_CXX)
88 HOSTPROG= ${HOSTPROG_CXX}
89 .endif
91 .if defined(HOSTPROG)
92 SRCS?= ${HOSTPROG}.c
94 _YHPSRCS= ${SRCS:M*.[ly]:C/\..$/.c/} ${YHEADER:D${SRCS:M*.y:.y=.h}}
95 DPSRCS+= ${_YHPSRCS}
96 CLEANFILES+= ${_YHPSRCS}
98 .if !empty(SRCS:N*.h:N*.sh)
99 OBJS+= ${SRCS:N*.h:N*.sh:R:S/$/.lo/g}
100 LOBJS+= ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
101 .endif
103 .if defined(OBJS) && !empty(OBJS)
104 .NOPATH: ${OBJS} ${HOSTPROG} ${_YHPSRCS}
106 ${OBJS} ${LOBJS}: ${DPSRCS}
107 ${HOSTPROG}: ${OBJS} ${DPADD}
108 ${_MKTARGET_LINK}
109 ${HOST_LINK.c} ${HOST_LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD}
111 .endif # defined(OBJS) && !empty(OBJS)
113 .if !defined(MAN)
114 MAN= ${HOSTPROG}.1
115 .endif # !defined(MAN)
116 .endif # defined(HOSTPROG)
118 realall: ${HOSTPROG}
120 cleanprog: .PHONY
121 rm -f a.out [Ee]rrs mklog core *.core \
122 ${HOSTPROG} ${OBJS} ${LOBJS} ${CLEANFILES}
124 beforedepend:
125 CFLAGS:= ${HOST_CFLAGS}
126 CPPFLAGS:= ${HOST_CPPFLAGS}
128 lint: ${LOBJS}
129 .if defined(LOBJS) && !empty(LOBJS)
130 ${LINT} ${LINTFLAGS} ${LDFLAGS:C/-L[ ]*/-L/Wg:M-L*} ${LOBJS} ${LDADD}
131 .endif
133 ##### Pull in related .mk logic
134 LINKSMODE?= ${BINMODE}
135 .include <bsd.man.mk>
136 .include <bsd.nls.mk>
137 .include <bsd.files.mk>
138 .include <bsd.inc.mk>
139 .include <bsd.links.mk>
140 .include <bsd.dep.mk>
142 ${TARGETS}: # ensure existence
144 # Override YACC/LEX rules so nbtool_config.h can be forced as the 1st include
145 .l.c:
146 ${_MKTARGET_LEX}
147 ${LEX.l} -o${.TARGET} ${.IMPSRC}
148 echo '#if HAVE_NBTOOL_CONFIG_H' > ${.TARGET}.1
149 echo '#include "nbtool_config.h"' >> ${.TARGET}.1
150 echo '#endif' >> ${.TARGET}.1
151 cat ${.TARGET} >> ${.TARGET}.1
152 mv ${.TARGET}.1 ${.TARGET}
153 .y.c:
154 ${_MKTARGET_YACC}
155 ${YACC.y} -o ${.TARGET} ${.IMPSRC}
156 echo '#if HAVE_NBTOOL_CONFIG_H' > ${.TARGET}.1
157 echo '#include "nbtool_config.h"' >> ${.TARGET}.1
158 echo '#endif' >> ${.TARGET}.1
159 cat ${.TARGET} >> ${.TARGET}.1
160 mv ${.TARGET}.1 ${.TARGET}