2 # copies the final products of the current project into the repository.
4 # check whether a failure should prevent promotion from occurring.
5 if [ -f $FAILURE_FILE ]; then
6 echo Postconditions will not promote due to a failure:
8 . $CLAM_DIR/exit_make.sh
11 # make sure that we actually did something during the make.
12 if [ ! -f "$DIRTY_FILE" -a ! -f "$SUBMAKE_FLAG" ]; then
13 # nothing was built, seemingly, so we do no promotion.
17 # toss the flag files so we don't see them again.
18 rm -f "$DIRTY_FILE" "$SUBMAKE_FLAG"
20 # clean up generated resource files after the build.
21 for i in *.resources; do rm -f "$i"; done
23 # these variables define the locations for final products. all of them
24 # descend from the root of the repository.
30 TEST_DIR=$TEST_ROOT/$PROJECT
32 # causes the shell to quit.
33 DIE=". $CLAM_DIR/exit_make.sh"
35 if [ "$TYPE" = "library" ]; then
37 # make sure the required directories exist.
38 if [ ! -d $ROOT ]; then mkdir -p $ROOT; fi
39 if [ ! -d $LIB_DIR ]; then mkdir $LIB_DIR; fi
40 if [ ! -d $DLL_DIR ]; then mkdir $DLL_DIR; fi
42 if [ -z "$NO_COMPILE" ]; then
43 # we ensure that none of the normal products are copied for a non-compiling
46 # copy the import libraries for any DLLs.
47 if [ ! -z "`$FIND "$DYNAMIC_LIBRARY_DIR" -iname "*.lib"`" ]; then
48 echo Moving import libraries to $LIB_DIR.
49 mv "$DYNAMIC_LIBRARY_DIR"/*.lib $LIB_DIR
54 elif [ "$TYPE" = "application" ]; then
56 # sets up the directory for executable programs and copies any found in the
57 # this project's final directory.
59 # first make sure the executable directory is around.
60 if [ ! -d $EXE_DIR ]; then mkdir $EXE_DIR; fi
62 if [ -z "$NO_COMPILE" ]; then
63 # we ensure that none of the normal products are copied for a non-compiling
66 # copy anything extra over.
67 if [ ! -z "$EXTRA_COPIES" ]; then
68 echo Copying extra files to $EXE_DIR.
70 cp -f $EXTRA_COPIES $EXE_DIR || $DIE
75 elif [ "$TYPE" = "test" ]; then
77 # sets up a directory for test programs based on the project name and copies
78 # the generated programs into there.
80 # first make sure the test program root directory is around.
81 if [ ! -d $TEST_ROOT ]; then mkdir $TEST_ROOT; fi
83 # create the target directory if it doesn't exist.
84 if [ ! -d $TEST_DIR ]; then mkdir $TEST_DIR; fi
86 if [ -z "$NO_COMPILE" ]; then
87 # we ensure that none of the normal products are copied for a non-compiling
90 # make the files writable. this is required for some tests' data files,
91 # which come in from the build and could be read-only.
92 chmod 777 $TEST_DIR/* $TEST_DIR/*/* $TEST_DIR/*/*/* >/dev/null 2>&1
94 # copy anything extra over.
95 if [ ! -z "$EXTRA_COPIES" ]; then
96 echo Copying extra files to $TEST_DIR.
98 cp -f $EXTRA_COPIES $TEST_DIR || $DIE
104 echo "Unknown type for project [$TYPE]; cancelling postconditions!"
105 . $CLAM_DIR/exit_make.sh