blob: 39201b4682abce46d52136ea265da5e583cbf360 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
|
# $NetBSD: Makefile,v 1.76 2015/09/17 14:25:43 christos Exp $
HOSTLIB= nbcompat
.include <bsd.own.mk>
SRCS= atoll.c basename.c cdbr.c cdbw.c dirname.c \
dprintf.c fgetln.c flock.c fparseln.c fpurge.c \
getcap.c getline.c getmode.c getopt_long.c gettemp.c \
heapsort.c \
issetugid.c lchflags.c lchmod.c lchown.c libyywrap.c \
md2.c md2hl.c md4c.c md4hl.c md5c.c md5hl.c \
mi_vector_hash.c mkdtemp.c \
mkstemp.c pread.c putc_unlocked.c pwcache.c pwrite.c \
pw_scan.c \
raise_default_signal.c reallocarr.c rmd160.c rmd160hl.c \
setenv.c setgroupent.c \
setpassent.c setprogname.c sha1.c sha1hl.c sha2.c \
sha256hl.c sha384hl.c sha512hl.c snprintb.c snprintf.c \
stat_flags.c strlcat.c strlcpy.c strmode.c \
strndup.c strnlen.c \
strsep.c strsuftoll.c strtoll.c \
strtoi.c strtou.c \
unvis.c vis.c err.c errx.c errc.c verr.c verrx.c verrc.c \
vwarn.c vwarnx.c vwarnc.c warn.c warnx.c warnc.c \
fts.c glob.c efun.c
BUILD_OSTYPE!= uname -s
# Disable use of pre-compiled headers on Darwin.
.if ${BUILD_OSTYPE} == "Darwin"
CPPFLAGS+= -no-cpp-precomp
.endif
# -D_FILE_OFFSET_BITS=64 produces a much more amenable `struct stat', and
# other file ops, on many systems, without changing function names.
CPPFLAGS+= -I. -I./include -I${.CURDIR} -I${.CURDIR}/sys \
-DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64
.PATH: ${.CURDIR}/../../lib/libc/cdb \
${.CURDIR}/../../lib/libc/gen \
${.CURDIR}/../../lib/libc/hash \
${.CURDIR}/../../lib/libc/hash/md2 \
${.CURDIR}/../../lib/libc/hash/md5 \
${.CURDIR}/../../lib/libc/hash/rmd160 \
${.CURDIR}/../../lib/libc/hash/sha1 \
${.CURDIR}/../../lib/libc/hash/sha2 \
${.CURDIR}/../../lib/libc/md \
${.CURDIR}/../../lib/libc/stdio \
${.CURDIR}/../../lib/libc/stdlib \
${.CURDIR}/../../lib/libc/string \
${.CURDIR}/../../lib/libutil \
${.CURDIR}/../../common/lib/libc/cdb \
${.CURDIR}/../../common/lib/libc/string \
${.CURDIR}/../../common/lib/libc/hash/rmd160 \
${.CURDIR}/../../common/lib/libc/hash/sha1 \
${.CURDIR}/../../common/lib/libc/hash/sha2 \
${.CURDIR}/../../common/lib/libc/md \
${.CURDIR}/../../common/lib/libc/stdlib \
${.CURDIR}/../../common/lib/libutil \
${.CURDIR}/../../external/bsd/flex/dist
DPSRCS+= defs.mk
CLEANFILES+= config.log config.status configure.lineno *.stamp
CLEANDIRFILES+= defs.mk config.cache confdefs.h
# Get components of Berkeley DB.
_CURDIR:= ${.CURDIR}
.CURDIR:= ${_CURDIR}/../../lib/libc
.include "${.CURDIR}/db/Makefile.inc"
.CURDIR:= ${_CURDIR}
SRCS:= ${SRCS:M*.c}
config.cache: include/.stamp configure nbtool_config.h.in defs.mk.in
rm -f ${.TARGET}
CC=${HOST_CC:Q} CFLAGS=${HOST_CFLAGS:Q} LDFLAGS=${HOST_LDFLAGS:Q} \
${HOST_SH} ${.CURDIR}/configure --cache-file=config.cache
defs.mk: config.cache
@touch ${.TARGET}
INCFILES= nbtool_config.h
INCSUBDIRS= sys machine rpc arpa
CLEANDIRFILES+= ${INCFILES}
# CLEANDIRFILES may not contain directory names
cleandir: cleandir.include
cleandir.include: .PHONY
rm -rf include
include/.stamp:
mkdir -p ${INCSUBDIRS:@d@ include/$d @}
@touch ${.TARGET}
# Install rules
HOST_LIBDIR= ${TOOLDIR}/lib
HOST_INCSDIR= ${TOOLDIR}/include
HOST_SHAREDIR= ${TOOLDIR}/share
install: .PHONY install.lib includes install.defs.mk
# Install lib${HOSTLIB}.a in ${TOOLDIR}/lib
install.lib: .PHONY ${HOST_LIBDIR}/lib${HOSTLIB}.a
${HOST_LIBDIR}/lib${HOSTLIB}.a: lib${HOSTLIB}.a
${_MKTARGET_INSTALL}
${HOST_INSTALL_DIR} ${HOST_LIBDIR}
${HOST_INSTALL_FILE} -m ${LIBMODE} ${.ALLSRC} ${.TARGET}
.for _f in ${INCFILES}
HOST_INCINSTFILES+= ${HOST_INCSDIR}/compat/${_f}
${HOST_INCSDIR}/compat/${_f}: ${_f}
${_MKTARGET_INSTALL}
${HOST_INSTALL_FILE} ${.ALLSRC} ${.TARGET}
.endfor
.for _d in ${INCSUBDIRS}
HOST_INCINSTDIRS+= ${HOST_INCSDIR}/compat/${_d}
${HOST_INCSDIR}/compat/${_d}:
${_MKTARGET_INSTALL}
${HOST_INSTALL_DIR} ${.TARGET}
.endfor
# Install include files in ${TOOLDIR}/include/compat
includes: .PHONY ${HOST_INCINSTDIRS} .WAIT ${HOST_INCINSTFILES}
@(cd include && find . -name '*.h' -print | while read f ; do \
${HOST_INSTALL_FILE} $$f ${HOST_INCSDIR}/compat/$$f ; \
done)
# Install defs.mk in ${TOOLDIR}/share/compat
install.defs.mk: .PHONY ${HOST_SHAREDIR}/compat/defs.mk
${HOST_SHAREDIR}/compat/defs.mk: defs.mk
${_MKTARGET_INSTALL}
${HOST_INSTALL_DIR} ${HOST_SHAREDIR}
${HOST_INSTALL_DIR} ${HOST_SHAREDIR}/compat
${HOST_INSTALL_FILE} ${.ALLSRC} ${.TARGET}
# bsd.hostlib.mk wants HOST_CPPFLAGS, not CPPFLAGS
HOST_CPPFLAGS:= ${CPPFLAGS}
CPPFLAGS:= # empty
.include <bsd.hostlib.mk>
# Use uninstalled copy of host-mkdep
HOST_MKDEP_OBJ!= cd ${.CURDIR}/../host-mkdep && ${PRINTOBJDIR}
HOST_MKDEP= ${HOST_MKDEP_OBJ}/host-mkdep
MKDEP= ${HOST_MKDEP}
# Use uninstalled copy of the install program
INSTALL_OBJ!= cd ${NETBSDSRCDIR}/tools/binstall && ${PRINTOBJDIR}
INSTALL= ${INSTALL_OBJ}/xinstall
# Run "${TOOLDIR}/bin/nbmake-${MACHINE} regen" by hand after editing
# configure.ac. See more detailed instructions in configure.ac.
regen:
cd ${.CURDIR} && ${TOOLDIR}/bin/${_TOOL_PREFIX}autoconf
cd ${.CURDIR} && ${TOOLDIR}/bin/${_TOOL_PREFIX}autoheader
|