head	1.2;
access;
symbols
	Jan97:1.2;
locks; strict;
comment	@# @;


1.2
date	95.06.09.14.11.16;	author keller;	state Exp;
branches;
next	1.1;

1.1
date	95.06.08.15.34.51;	author keller;	state Exp;
branches;
next	;


desc
@Shell script assisting the Makefile
@


1.2
log
@Some minor improvements in Makefile-scheme (Makefile, compile,
export).
@
text
@#!/bin/sh
######################################################################
# Project:	Parallaxis-III
# Filename:	compile
# Author:	Hartmut Keller
# Last Change:	Tue Jun  6 19:35:31 1995
#
# Description:
# ------------
# This is a shell script supporting the compilation of the
# Parallaxis-III compiler system. The script is usually called
# automatically by make. compile checks its arguments to decide
# how to compile the different versions of Parallaxis. Recognized
# Arguments are: 
#    C       generate C version
#    MPL     generate MPL version
#    PVM     generate PVM version
#
# It then calls make with special targets to create the desired
# versions and clean up the directory inbetween. Every other argument
# (usually macro-definitions) is passed unchanged to the different
# calls of make.
######################################################################

set -e

cversion=0
mplversion=0
pvmversion=0

# variable to accumulate arguments that are not parsed here
passvalue=

# check for "C", "MPL", and "PVM"; every unknown argument is appended to 
# passvalue
while [ $# -gt 0 ]
do
case "$1" in
  C)
	cversion=1
	;;
  MPL)
	mplversion=1
	;;
  PVM)
	pvmversion=1
	;;
  *)
	passvalue="$passvalue $1"
	;;
esac
shift
done

# if none of "C", "MPL", or "PVM" found on command line, return with error
if [ $cversion -eq 0  -a  $mplversion -eq 0  -a  $pvmversion -eq 0 ]
then
  echo 'Not enough parameters. At least one of "C", "MPL", or "PVM" is required.'
  echo 'Please use make to generate Parallaxis-III.'
  exit 1
fi

# variable to collect -D defines for user interface p3
p3vers=
cleaned=0

# generate compiler and library for C version (p3c, libp3.a)
if [ $cversion -eq 1 ]
then
if [ $cleaned -eq 1 ]
then
    echo make versionclean
    make versionclean
    cleaned=1
fi
  echo make VERS=C $passvalue p3c libp3.a
  make VERS=C $passvalue p3c libp3.a
  p3vers="$p3vers -DC_VERSION"
fi

# generate compiler and library for MPL version (p3c_MPL, libp3_MPL.a)
if [ $mplversion -eq 1 ]
then
if [ $cleaned -eq 1 ]
then
    echo make versionclean
    make versionclean
    cleaned=1
fi
  echo make VERS=MPL $passvalue p3c_MPL libp3_MPL.a
  make VERS=MPL $passvalue p3c_MPL libp3_MPL.a
  p3vers="$p3vers -DMPL_VERSION"
fi

# generate compiler, PVM-start program and library for PVM version 
# (p3c_PVM, p3start, libp3_PVM.a)
if [ $pvmversion -eq 1 ]
then
if [ $cleaned -eq 1 ]
then
    echo make versionclean
    make versionclean
    cleaned=1
fi
  echo make VERS=PVM $passvalue p3c_PVM p3start libp3_PVM.a
  make VERS=PVM $passvalue p3c_PVM p3start libp3_PVM.a
  p3vers="$p3vers -DPVM_VERSION"
fi

# generate user interface and man-page (p3, p3.1)
echo make "P3_VERS=$p3vers" $passvalue p3 p3.1
make "P3_VERS=$p3vers" $passvalue p3 p3.1

echo "Generation of Parallaxis-III finished!"
echo

@


1.1
log
@The Makefile-scheme has changed again. Now there's again only one
Makefile, but now assisted by a small shell script "compile". The
different Makefiles (Makefile.{C,MPL,PVM}) are now obsolete.
@
text
@d25 2
d65 1
d70 6
a75 2
  echo make versionclean
  make versionclean
d84 6
a89 2
  echo make versionclean
  make versionclean
d99 6
a104 2
  echo make versionclean
  make versionclean
@
