File: makeshadowdir

package info (click to toggle)
libreswan 5.2-2.3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 81,644 kB
  • sloc: ansic: 129,988; sh: 32,018; xml: 20,646; python: 10,303; makefile: 3,022; javascript: 1,506; sed: 574; yacc: 511; perl: 264; awk: 52
file content (61 lines) | stat: -rwxr-xr-x 1,191 bytes parent folder | download | duplicates (5)
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
#!/bin/sh -e

SRCDIR=$1 ; shift
OBJDIR=$1 ; shift
dirs=$1

if test $(cd ${SRCDIR} ; pwd) = $(cd ${SRCDIR} ; cd ${OBJDIR} ; pwd)
then
	echo "failed. ${OBJDIR} == ${SRCDIR}"
	exit 1
fi

cd ${SRCDIR}
mkdir -p ${OBJDIR}

# Generate sub-directories first

find ${dirs} -type d -print | while read dirname
do
    if test -r $dirname/Makefile
    then
	(
	    echo Generating ${OBJDIR}/$dirname/Makefile
	    cd ${OBJDIR}
	    mkdir -p $dirname
	    cd $dirname

	    top_builddir=$(echo $dirname | sed -e 's;[^/]*;..;g')

	    cat <<EOF >Makefile.tmp
# Generated by $0

# define autoconf style names such as srcdir, builddir, abs_srcdir,
# top_srcdir, abs_top_srcdir, ...
include ${top_builddir}/../mk/dirs.mk

include \${srcdir}/Makefile
EOF
	    mv Makefile.tmp Makefile
	)
    fi
done

# OBJDIR makefile is just different enough

cat <<EOF > $OBJDIR/Makefile.tmp
# Generated by $0

# define autoconf style names such as srcdir, builddir, abs_srcdir,
# top_srcdir, abs_top_srcdir, ...
include ../mk/dirs.mk

programs config man install clean install-programs:
	set -e ; \\
	for d in \$(SUBDIRS) ; \\
	do \\
		( cd \$\$d && \$(MAKE) \$@ ) ; \\
	done
EOF

mv $OBJDIR/Makefile.tmp $OBJDIR/Makefile