Commit f0ad859c authored by claes's avatar claes

pwre for Lynx

parent aa34fb2f
# dir_symbols.mk - get directory symbols
#
#
#
comma := ,
empty :=
space := $(empty) $(empty)
pred_13 := 12
pred_12 := 11
pred_11 := 10
pred_10 := 9
pred_9 := 8
pred_8 := 7
pred_7 := 6
pred_6 := 5
pred_5 := 4
pred_4 := 3
pred_3 := 2
pred_2 := 1
pred_1 := 0
cwd_dirs := $(subst /,$(space),$(PWD))
word := $(words $(cwd_dirs))
hw_name := $(word $(word), $(cwd_dirs))
ifneq ($(findstring hw, $(hw_name)),hw)
include ___error___hw
endif
prev := pred_ $(word)
pred := $(subst $(space),$(empty),$(prev))
word := $($(pred))
os_name := $(word $(word), $(cwd_dirs))
ifneq ($(findstring os,$(os_name)),os)
include ___error___os
endif
prev := pred_ $(word)
pred := $(subst $(space),$(empty),$(prev))
word := $($(pred))
src_name := $(word $(word), $(cwd_dirs))
ifneq ($(src_name),src)
include ___error___no_source_subdirectory
endif
prev := pred_ $(word)
pred := $(subst $(space),$(empty),$(prev))
word := $($(pred))
comp_name := $(word $(word), $(cwd_dirs))
prev := pred_ $(word)
pred := $(subst $(space),$(empty),$(prev))
word := $($(pred))
type_name := $(word $(word), $(cwd_dirs))
prev := pred_ $(word)
pred := $(subst $(space),$(empty),$(prev))
word := $($(pred))
root_name := $(word $(word), $(cwd_dirs))
ifneq ($(src_name),src)
include ___error___incorrect_source_root1
endif
#rest = /$(type_name)/$(comp_name)/src/$(os_name)/$(hw_name)/
#test_source_root := $(subst $(rest),$(empty),$(PWD))
#ifneq ($(pwre_sroot),$(test_source_root))
#include ___error___incorrect_source_root2
#endif
#
#
# pwr_tags
#
crtags_c() {
crtags -absolute -nologo -q -o $HOME/pwre/tags -l C $@
}
crtags_ac() {
crtags -a -absolute -nologo -q -o $HOME/pwre/tags -l C $@
}
crtags_acpp() {
crtags -a -absolute -nologo -q -o $HOME/pwre/tags -l CPP $@
}
if [ -e $HOME/pwre/tags ]; then
echo "Moving ~/pwre/tags to ~/pwre/tags.old"
mv $HOME/pwre/tags $HOME/pwre/tags.old
fi
find $pwre_sroot -name "*.c" -o -name "*.sc" -o -name "*.cpp" -o -name "*.h" -o -name "*.hpp" -o -name "*.x" |grep -v \/tst\/ > $HOME/.pwr_tags.tmp
crtags_c -PROTOTYPE `grep "\.c$" $HOME/.pwr_tags.tmp`
crtags_ac -PROTOTYPE `grep "\.sc$" $HOME/.pwr_tags.tmp`
crtags_acpp `grep "\.cpp$" $HOME/.pwr_tags.tmp`
crtags_ac -MEMBER -PROTOTYPE `grep "\.h$" $HOME/.pwr_tags.tmp`
crtags_acpp `grep "\.hpp$" $HOME/.pwr_tags.tmp`
crtags_ac $pwr_inc/pwr_*classes.h
if [ "$HOSTTYPE" != "alpha" ]; then
crtags_ac $pwr_inc/*_msg.h
# get tags for files generated by rpcgen
crtags_ac `find $pwre_broot/$pwre_target/bld -name "*.c"`
eval crtags_ac -PROTOTYPE `grep "\.x$" $HOME/.pwr_tags.tmp|sed 's!\([^/]*\.\)x! \1!' |sed 's!^[^ ]* \(.*\)!\$pwr_inc/\1h!'`
else
crtags_ac $pwre_vmsinc/*_msg.h
eval crtags_ac -PROTOTYPE `grep "\.x$" $HOME/.pwr_tags.tmp|sed 's!\([^/]*\.\)x! \1!' |sed 's!^[^ ]* \(.*\)!\$pwre_vmsinc/\1h!'`
fi
rm $HOME/.pwr_tags.tmp
This diff is collapsed.
#
# pwre.source
#
# This script must be sourced
#
# Only the init verb is handled by this script, all the others
# is handled by pwre.perl
#
#
# Don't call pwre.perl if it is the init verb
#
env="$2"
if [ $# -eq 0 ] || echo "init" | grep $pwre_silent -v "^$1"; then
$pwre_bin/pwre.pl $@
elif [ "$env" = "" ]; then
echo "++ init what?"
else
if $pwre_bin/pwre.pl _exists $2; then
set_env `$pwre_bin/pwre.pl _print $2`
else
echo "++ Environment $2 doesn't exist"
fi
fi
pwre()
{
if [ "$HOSTTYPE" = "alpha" ]; then
pwre_silent="-q"
else
pwre_silent="-s"
fi
local flags="$-"
# Turn off filename globber
set -f
source $pwre_bin/pwre.source $@
if echo "$flags" | grep $pwre_silent -v f; then
set +f
fi
}
set_env()
{
export pwre_env="$env"
export pwre_sroot="$1"
export pwre_vmsinc="$2"
export pwre_broot="$3"
export pwre_btype="$4"
export pwre_os="os_$5"
export pwre_hw="hw_$6"
export pwre_target="$pwre_os/$pwre_hw"
export pwre_bin="$pwre_sroot/tools/pwre/src/$pwre_os"
export pwre_dir_symbols="$pwre_bin/dir_symbols.mk"
export pwr_exe="$pwre_broot/$pwre_os/$pwre_hw/exp/exe"
export pwr_inc="$pwre_broot/$pwre_os/$pwre_hw/exp/inc"
export pwr_lib="$pwre_broot/$pwre_os/$pwre_hw/exp/lib"
export pwr_lis="$pwre_broot/$pwre_os/$pwre_hw/exp/lis"
export pwr_load="$pwre_broot/$pwre_os/$pwre_hw/exp/load"
export pwr_obj="$pwre_broot/$pwre_os/$pwre_hw/exp/obj"
export pwr_doc="$pwre_broot/$pwre_os/$pwre_hw/exp/doc"
export co_lib="$pwre_sroot/lib/co/src"
export op_lib="$pwre_sroot/lib/op/src"
export rt_lib="$pwre_sroot/lib/rt/src"
export wb_lib="$pwre_sroot/lib/wb/src"
export exe="$pwre_sroot/exe"
if [ -e /usr/include/Imlib.h ]; then
export PWR_IMLIB=1
fi
# PWR alias
alias pwr_root="cd $pwre_sroot"
alias pwr_exe="cd $pwr_exe"
alias pwr_inc="cd $pwr_inc"
alias pwr_lib="cd $pwr_lib"
alias pwr_lis="cd $pwr_lis"
alias pwr_obj="cd $pwr_obj"
alias co_lib="cd $pwre_sroot/lib/co/src"
alias op_lib="cd $pwre_sroot/lib/op/src"
alias rt_lib="cd $pwre_sroot/lib/rt/src"
alias wb_lib="cd $pwre_sroot/lib/wb/src"
alias db="cd $pwre_sroot/db"
alias exe="cd $pwre_sroot/exe"
alias exp="cd $pwre_sroot/exp"
alias inc="cd $pwre_sroot/exp/inc/src"
alias lib="cd $pwre_sroot/lib"
alias hlp="cd $pwre_sroot/hlp"
alias mmi="cd $pwre_sroot/mmi"
alias msg="cd $pwre_sroot/msg"
alias tools="cd $pwre_sroot/tools"
alias wbl="cd $pwre_sroot/wbl"
alias hw="cd $pwre_target"
alias bld="cd $pwre_broot/$pwre_target/bld"
alias co_bld="cd $pwre_broot/$pwre_target/bld/lib/co"
alias rt_bld="cd $pwre_broot/$pwre_target/bld/lib/rt"
alias exe_bld="cd $pwre_broot/$pwre_target/bld/exe"
alias tmp="cd $pwre_broot/$pwre_target/tmp"
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment