#!/bin/sh
# This script creates a header file "adept_source.h" containing the
# ../adept/*.cpp source files; why this is useful is explained below.

ADEPT_SOURCE_HEADER=adept_source.h
rm -f $ADEPT_SOURCE_HEADER

echo "Creating $ADEPT_SOURCE_HEADER"

echo "/* $ADEPT_SOURCE_HEADER - Source code for the Adept library

  Copyright (C) 2012-2015 The University of Reading

  Licensed under the Apache License, Version 2.0 (the \"License\"); you
  may not use this file except in compliance with the License.  You
  may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an \"AS IS\" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
  implied.  See the License for the specific language governing
  permissions and limitations under the License.


  This file was created automatically by script $0 
  on "$(date)"

  It contains a concatenation of the source files from the Adept
  library. The idea is that a program may #include this file in one of
  its source files (typically the one containing the main function),
  and then the Adept library will be built into the executable without
  the need to link to an external library. All other source files
  should just #include \"adept.h\". The ability to use Adept in this
  way makes it easier to distribute an Adept package that is usable on
  non-Unix platforms that are unable to use the configure script to
  build external libraries.

  The individual source files now follow.
*/

#ifndef ADEPT_SOURCE_H
#define ADEPT_SOURCE_H 1
" > $ADEPT_SOURCE_HEADER

for FILE in ../adept/*.cpp
do
    echo "   Adding $FILE"
    echo "

// =================================================================
// Contents of $(basename $FILE)
// =================================================================
" >> $ADEPT_SOURCE_HEADER
    cat $FILE >> $ADEPT_SOURCE_HEADER
done

echo "

#endif
" >> $ADEPT_SOURCE_HEADER
echo "Done"