1#!/bin/sh
2# Copy files to their correct locations.
3#
4# If arguments are given, try symbolic link first.  This is not the default
5# so that most people will have the distribution versions stay around so
6# subsequent patches can be applied.  People who pay enough attention to
7# know there's a non-default behavior are assumed to pay enough attention
8# to keep distribution versions if they modify things.
9
10# Were we started from the top level?  Cope.
11if [ -f sys/unix/Makefile.top ]; then cd sys/unix; fi
12
13if [ $# -gt 0 ] ; then
14#	First, try to make a symbolic link.
15#
16	ln -s Makefile.top Makefile >/dev/null 2>&1
17	if [ $? -eq 0 ] ; then
18
19		echo "Lucky you!  Symbolic links."
20		rm -f Makefile
21
22		umask 0
23		ln -s sys/unix/Makefile.top ../../Makefile
24		ln -s ../sys/unix/Makefile.dat ../../dat/Makefile
25		ln -s ../sys/unix/Makefile.doc ../../doc/Makefile
26		ln -s ../sys/unix/Makefile.src ../../src/Makefile
27		ln -s ../sys/unix/Makefile.utl ../../util/Makefile
28		exit 0
29	fi
30fi
31
32#
33#	Otherwise...
34
35echo "Copying Makefiles."
36
37cp Makefile.top ../../Makefile
38cp Makefile.dat ../../dat/Makefile
39cp Makefile.doc ../../doc/Makefile
40cp Makefile.src ../../src/Makefile
41cp Makefile.utl ../../util/Makefile
42