[9c9775f] | 1 | #!/bin/bash
|
---|
| 2 |
|
---|
| 3 | # $Id$
|
---|
| 4 |
|
---|
| 5 | #----------------------------------#
|
---|
| 6 | wrt_CustomTools_target() { # Add any users supplied scripts
|
---|
| 7 | #----------------------------------#
|
---|
| 8 | PREV=""
|
---|
| 9 |
|
---|
[dfa51ee] | 10 | echo "${tab_}${GREEN}Processing... ${L_arrow}CUSTOM_TOOLS ${R_arrow}"
|
---|
| 11 |
|
---|
| 12 | for file in custom-tools/* ; do
|
---|
| 13 | # Keep the script file name
|
---|
| 14 | this_script=`basename $file`
|
---|
| 15 |
|
---|
| 16 | # Grab the phase name to be used with INSTALL_LOG and tracking dir touch
|
---|
| 17 | name=`grep "^PKG_PHASE=" ${file} | sed -e 's@PKG_PHASE=@@'`
|
---|
| 18 | # Grab also the package version
|
---|
| 19 | pkg_ver=`grep "^VERSION=" ${file} | sed -e 's@VERSION=@@'`
|
---|
| 20 |
|
---|
| 21 | # Append each name of the script files to a list (this will become
|
---|
| 22 | # the names of the targets in the Makefile)
|
---|
| 23 | custom_list="$custom_list ${this_script}"
|
---|
| 24 |
|
---|
| 25 | #--------------------------------------------------------------------#
|
---|
| 26 | # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
|
---|
| 27 | #--------------------------------------------------------------------#
|
---|
| 28 | #
|
---|
| 29 | # Drop in the name of the target on a new line, and the previous target
|
---|
| 30 | # as a dependency. Also call the echo_message function.
|
---|
| 31 | wrt_target "${this_script}" "$PREV"
|
---|
| 32 |
|
---|
| 33 | # Touch timestamp file if installed files logs will be created.
|
---|
| 34 | if [ "$name" != "" ] && [ "${INSTALL_LOG}" = "y" ] ; then
|
---|
| 35 | wrt_TouchTimestamp
|
---|
[9c9775f] | 36 | fi
|
---|
| 37 |
|
---|
[dfa51ee] | 38 | # Run the script.
|
---|
| 39 | wrt_RunScript "$file"
|
---|
[9c9775f] | 40 |
|
---|
[dfa51ee] | 41 | # Write installed files log
|
---|
| 42 | if [ "$name" != "" ] && [ "${INSTALL_LOG}" = "y" ] ; then
|
---|
| 43 | wrt_LogNewFiles "$name"
|
---|
| 44 | fi
|
---|
[9c9775f] | 45 |
|
---|
[dfa51ee] | 46 | # Touch the tracking file.
|
---|
| 47 | if [ "$PROGNAME" = "clfs2" ]; then
|
---|
| 48 | echo -e "\t@touch \$(MOUNT_PT)$TRACKING_DIR/${name}-${pkg_ver}" >> $MKFILE.tmp
|
---|
[9c9775f] | 49 | else
|
---|
[dfa51ee] | 50 | echo -e "\t@touch $TRACKING_DIR/${name}-${pkg_ver}" >> $MKFILE.tmp
|
---|
[9c9775f] | 51 | fi
|
---|
| 52 |
|
---|
[dfa51ee] | 53 | # Include a touch of the target name so make can check
|
---|
| 54 | # if it's already been made.
|
---|
| 55 | wrt_touch
|
---|
| 56 | #
|
---|
| 57 | #--------------------------------------------------------------------#
|
---|
| 58 | # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
|
---|
| 59 | #--------------------------------------------------------------------#
|
---|
[9c9775f] | 60 |
|
---|
[dfa51ee] | 61 | # Keep the script file name for Makefile dependencies.
|
---|
| 62 | PREV=${this_script}
|
---|
[9c9775f] | 63 | done
|
---|
| 64 | }
|
---|