diff options
author | merakor <cem@ckyln.com> | 2021-02-04 14:30:43 +0000 |
---|---|---|
committer | merakor <cem@ckyln.com> | 2021-02-04 14:30:43 +0000 |
commit | 97312778a09decf65030e994e72ce07434ce0f07 (patch) | |
tree | eeb18b94a461a05a6993d98ab9a68eee1152faf9 /lib.rc | |
parent | 63c4051197cfcad2231de6eb9874055d668f47df (diff) | |
download | cpt-97312778a09decf65030e994e72ce07434ce0f07.tar.gz |
cpt: switch back to 'make'
FossilOrigin-Name: 048c099fa4155f31725c51c27b09359d7b04f4c2d7e64f2a2b381ab7dea7803d
Diffstat (limited to 'lib.rc')
-rw-r--r-- | lib.rc | 60 |
1 files changed, 0 insertions, 60 deletions
@@ -1,60 +0,0 @@ -# -*- mode: redo -*- -# Helper functions -target=$1 basename=$2 dest=$3 - -# Make all targets dependent on the library and the config file -redo-ifchange "$SRC_ROOT/lib.rc" "$SRC_ROOT/config.rc" - -setv() { - # Set variables if unset. Works similar to the Makefile syntax. - [ "$3" ] || { - printf '%s\n' "Faulty variable syntax" >&2 - exit 1 - } - var=$1; sym=$2; shift 2 - case "$sym" in - \?=|=) eval "[ \"\$$var\" ]" || export "$var=$*" ;; - +=) eval "export \"$var=\$$var $*\"" - esac -} - -redo_clean() { - # Clean function for various redo implementations - [ -r .do_built ] && { - while read -r file; do - [ -d "$file" ] || rm -f "$file" - done < .do_built - } - find . -type f \( -name '*.tmp' -o -name '*.did' -o -name '.dep*' -o -name '.target*' \) \ - -exec rm -f -- {} + - [ "$DO_BUILT" ] || find . -name '.do_built*' -exec rm -rf -- {} + - [ "$REDO_BASE" ] || find . -name .redo -type d -exec rm -rf -- {} + -} - -targcheck() { - # Usage: targcheck [target...] - # - # Check if current target is one of the given arguments of this function. - # Returns 0 if target is one of the arguments, returns 1 if not. - case " $* " in *" $target "*) return 0; esac; return 1 -} - -PHONY() { - # Usage: PHONY [[target...]] - # - # Function that resembles the .PHONY: target on the classic 'make' system. - # You can either use it without an argument on a single target, or specify - # multiple targets. - if [ -z "$1" ] || targcheck "$@"; then - # shellcheck disable=2064 - trap "rm -f $dest" EXIT INT - fi -} - -getbin() { - # Function to get all executables - find src contrib \( -name cpt -o -name 'cpt-*' \) ! -name '*.in' ! -name '*.did' -} - -# Phony targets -PHONY all dist clean install uninstall test |