Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
main.sh
Go to the documentation of this file.
1#!/usr/bin/env zsh
2script=${0##*/}
3
4# ------------------------------------------------------------------------------------------
5#
6# Example script to test completeness of include files.
7#
8# ------------------------------------------------------------------------------------------
9
10if [ -z $JPP_DIR ]; then
11 echo "Variable JPP_DIR undefined."
12 exit
13fi
14
15source $JPP_DIR/setenv.sh $JPP_DIR
16
17if do_usage $*; then
18 usage "$script (include file)+"
19fi
20
21if (( $# == 0 )); then
22 INCLUDE_FILES=($JPP_DIR/software/*/*.hh)
23else
24 INCLUDE_FILES=($*)
25fi
26
27for INCLUDE_FILE in $INCLUDE_FILES[*]; do
28
29 echo ${INCLUDE_FILE##*software/}
30
31 pushd ${INCLUDE_FILE:h}
32
33 cat>abc.cc<<EOF
34#include "${INCLUDE_FILE##*software/}"
35
36int main()
37{
38}
39EOF
40 if [[ -f Makefile ]]; then
41 make -f Makefile abc.o
42 elif [[ -f Makefile.DAQ ]]; then
43 make -f Makefile.DAQ abc.o
44 else
45 make -f $JPP_DIR/make/JMakefile abc.o
46 fi
47
48 if (( $? != 0 )); then
49 exit 1
50 fi
51
52 rm -f abc* >& /dev/null
53
54 popd
55done