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