Install some default transliterations for man pages. If nroff is used
[netbsd-mini2440.git] / compat / build-makefiles
blobc0444fb99690c4d368635b6bc2834d1311cd1918
1 #! /bin/sh
3 # generate src/compat/* Makefile's based on SUBDIR values in
4 # the main source tree
6 srcdir=/usr/src
7 rwsrcdir=/home/current/src
8 MAKE=${MAKE-make}
10 CHECK_SUBDIRS="gnu/lib gnu/lib/libgcc4 lib lib/csu lib/i18n_module external/bsd/atf/lib external/bsd/openldap/lib lib/libpam/modules"
11 # lib/csu is spsecial
12 # lib/libm needs to be special -- i387
13 # gnu/lib/libsupc++ -- fails to get NOPROFILE properly
15 for _dir in ${CHECK_SUBDIRS}; do
16 if [ ${_dir} = "lib/csu" ]; then
17 _subdirs="i386_elf sparc_elf"
18 else
19 _subdirs=`cd ${srcdir}/${_dir}; ${MAKE} -V SUBDIR`
22 echo "looking in: $_dir: subdirs $_subdirs"
23 for _sd in $_subdirs; do
24 # skip lib/csu --
25 if [ "$_dir" = "lib" -a "$_sd" = "csu" ]; then
26 continue
28 # skip .WAIT --
29 if [ "$_sd" = ".WAIT" ]; then
30 continue
32 _libdplibs="`cd ${srcdir}/${_dir}/${_sd}; ${MAKE} -V LIBDPLIBS`"
33 echo "creating stuff for subdir: $_sd"
34 echo " - libdplibs = ${_libdplibs}"
35 mkdir -p ${rwsrcdir}/compat/${_dir}/${_sd}
37 cat <<'EOF'
38 # $NetBSD: build-makefiles,v 1.4 2008/10/27 07:17:05 mrg Exp $
40 NOLINT= # defined
41 NOMAN= # defined
42 NONLS= # defined
43 NOINFO= # defined
44 NOSHARE= # defined
45 EOF
46 # XXX various hacks
47 case "${_sd}" in
48 libsupc++4)
49 echo "NOPROFILE= # defined"
51 libc)
52 echo "# XXX"
53 echo "nsparser.h: nsparser.c"
55 libpcap)
56 echo "# XXX"
57 echo "grammar.h: grammar.c"
59 libipsec)
60 echo "# XXX"
61 echo "policy_parse.h: policy_parse.c"
63 esac
65 if [ -n "${_libdplibs}" ]; then
66 echo "LIBDPLIBS= ${_libdplibs}"
68 cat <<'EOF'
70 NOCHECKVER= # defined
72 .include <bsd.obj.mk>
74 # Resolve pathnames in variables.
75 _RESOLVE_VARS= CFLAGS CPPFLAGS DPADD LDADD LIBDPLIBS LIB_ROOT_DIR
76 .for var in ${_RESOLVE_VARS}
77 ${var}:= ${${var}}
78 .endfor
80 _CURDIR:= ${.CURDIR}
82 EOF
83 printf ".PATH: \${NETBSDSRCDIR}/${_dir}/${_sd}\n"
84 printf ".CURDIR:=\${NETBSDSRCDIR}/${_dir}/${_sd}\n\n"
85 cat <<'EOF'
86 .include "${NETBSDSRCDIR}/compat/Makefile.compat"
87 .include "${.CURDIR}/Makefile"
89 # Resolve pathnames from "real" Makefile, and switch .CURDIR back.
90 _RESOLVE_VARS= CFLAGS CPPFLAGS DPADD LDADD ARCHDIR COMPATDIR COMPATARCHDIR LIBCDIR RPC_INCS RPC_XDIR LIBEDITDIR MODOBJDIR RUMPTOP
91 .for var in ${_RESOLVE_VARS}
92 ${var}:= ${${var}}
93 .endfor
95 .CURDIR:= ${_CURDIR}
96 .undef _CURDIR
97 EOF
98 ) > ${rwsrcdir}/compat/${_dir}/${_sd}/Makefile
99 done
101 if [ "${_dir}" = "lib" -a "${_sd}" = "csu" ]; then
102 (printf '# $'NetBSD'$\n\n'
103 printf "_CURDIR:= \${.CURDIR}\n\n"
104 printf ".CURDIR:=\${NETBSDSRCDIR}/${_dir}\n\n"
105 printf ".include "'"'"\${.CURDIR}/Makefile"'"'"\n\n"
106 printf ".CURDIR:= \${_CURDIR}\n"
107 ) > ${rwsrcdir}/compat/${_dir}/Makefile
109 if [ -f "${srcdir}/${_dir}/Makefile.inc" ]; then
110 (printf '# $'NetBSD'$\n\n'
111 printf "_CURDIR:= \${.CURDIR}\n\n"
112 printf ".include "'"'"\${NETBSDSRCDIR}/${_dir}/Makefile.inc"'"'"\n\n"
113 printf ".CURDIR:= \${_CURDIR}\n"
114 ) > ${rwsrcdir}/compat/${_dir}/Makefile.inc
117 done