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