1#!/bin/sh
2
3# Copyright (c) 1993 Eric P. Allman
4# Copyright (c) 1993 The Regents of the University of California.
5# All rights reserved.
6#
7# %sccs.include.redist.sh%
8#
9#       @(#)makesendmail	8.3 (Berkeley) 09/26/93
10#
11
12#
13#  A quick-and-dirty script to compile sendmail in the presence of
14#  multiple architectures and Makefiles.
15#
16
17# determine machine architecture
18arch=`uname -m`
19case $arch
20in
21  sun4*)	arch=sun4;;
22esac
23
24# determine operating system type
25os=`uname -s`
26
27# determine operating system release
28rel=`uname -r`
29
30# now try to find a reasonable object directory
31if [ -r obj.$os.$arch.$rel ]; then
32	obj=obj.$os.$arch.$rel
33elif [ -r obj.$os.$rel ]; then
34	obj=obj.$os.$rel
35elif [ -r obj.$os.$arch ]; then
36	obj=obj.$os.$arch
37elif [ -r obj.$arch.$rel ]; then
38	obj=obj.$arch.$rel
39elif [ -r obj.$os ]; then
40	obj=obj.$os
41elif [ -r obj.$arch ]; then
42	obj=obj.$arch
43elif [ -r obj.$rel ]; then
44	obj=obj.$rel
45elif [ -r Makefile.$os ]; then
46	obj=obj.$os.$arch.$rel
47	echo "Creating $obj using Makefile.$os"
48	mkdir $obj
49	(cd $obj; ln -s ../*.[ch158] ../sendmail.hf .; ln -s ../Makefile.$os Makefile)
50else
51	echo "Warning: no recognized support for $arch.$os.$rel"
52	echo "	... winging it ..."
53	obj=.
54fi
55echo "Making in $obj"
56cd $obj
57exec make -f Makefile $*
58