public inbox for sourcenav@sourceware.org
 help / color / mirror / Atom feed
From: Doug Fraser <dfraser@photuris.com>
To: sourcenav@sourceware.cygnus.com
Subject: RE: SN 5.0 html docs
Date: Thu, 06 Sep 2001 04:52:00 -0000	[thread overview]
Message-ID: <E2D27064CD59574F88D05AEF5728396D44546C@PH01SRV02.photuris.com> (raw)

Hello,

Attached below is a simple shell script and a description of a
file list that it uses to generate 'import' files that can be
used to manage pseudo projects that can be stored in CVS.
It allows developers to share a common files list with relative
paths and generates full local paths useable by snavigator.

Enjoy.

Embellishments and feedback welcome. Send it to the whole group.

Doug

> -----Original Message-----
> From: Peter Milne [ mailto:peter@remware.demon.co.uk ]
> Sent: Wednesday, September 05, 2001 4:30 PM
> To: Doug Fraser
> Cc: sourcenav@sourceware.cygnus.com
> Subject: Re: SN 5.0 html docs
> 
> 
> Doug Fraser wrote:
> 
> >
> >
> >Another thing, I have a method of collecting file
> >path names into a text file, and a shell script that
> >filters those relative path names into a temp file
> >as full path names and starting source navigator
> >using the created temp file as an import file.
> >It works okay and lets us set up pseudo-projects
> >that can be stored in CVS and shared between
> >developers. If anyone is interested in the shell
> >script I will attach it to the list. Sure, it could
> >have been prettier in TCL, but I don't know TCL.....
> >
> Script sounds great. Please let us see it.
> Having a project with full path names is no good when you 
> want to use it from different work areas.


So, our source tree is broken up into subdirectories that
support individual targets (boards), with each subdirectory
broken into at the least; src, include, drv, and build
The relative tree might look like this:

     ./product/board1
     ./product/board2
     ./product/board3

and a given board would look like:

     ./product/board1/src
     ./product/board1/drv
     ./product/board1/include
     ./product/board1/build

and we also have a common area for shared headers and build scripts

     ./common/include

We added a subdirectory to each board, named snlst.
It holds one or more files that list the source and include
files used to create a process that runs on that board.
So add another directory

     ./product/board1/snlst

The contents and format of that file are as follows:

src/ThisClass.cc
src/ThatClass.cc
src/AnotherClass.cc
src/SomeClient.cc
src/BigServer.cc
../common/include/BaseClass.h
include/ThisClass.h
include/ThatClass.h
include/AnotherClass.h
include/SomeClient.h
include/BigServer.h

If you are currently in the board directory (for example, ./product/board1),
you can run the following script (I call it snrun), and it will display a
menu
listing the files that you have created in the snlst directory, and if you
select a valid file, it creates a /tmp/file (unique) that provides full path
names to your source suitable for snavigator. It then starts snavigator with
a temporary project file. When you close out the session, all the files are
removed.

This script is written in KSH, that is what I use, but should port easily to
other shells as well.

#!/bin/ksh

if [ ! -d snlst ]
then
    echo No snlst directory in this node.
    exit
fi

PS3="select product> "
FILELST=`find snlst -maxdepth 1 -type f -print`
select PRODUCT in $FILELST
do
    case $PRODUCT in
        $FILELST)
	break
        ;;

	*)
	;;
    esac

    if [ ! -d $PRODUCT ]
    then
        PRODUCT=`basename $PRODUCT`
        break
    fi

done

print "You selected $REPLY ) $PRODUCT"

HERE=`pwd`/
TMP=/tmp/snrun

# create and chmod the tmp dir. Redirect to /dev/null if it
# already exists....
mkdir ${TMP} > /dev/null 2>&1
chmod 777 ${TMP} > /dev/null 2>&1

IMPORT=${TMP}/${PRODUCT}$$.import
PROJ=${TMP}/${PRODUCT}$$.proj
LIST=${HERE}/snlst/${PRODUCT}

trap "rm ${IMPORT} ${PROJ} > /dev/null 2>&1" EXIT INT TERM QUIT

# Yup. That is a magic sed script. The contents of the first [] pair
# is a tab and a space
sed -e 's/^[ 	]*//' -e '/^$/d' -e "s?^?${HERE}?" ${LIST} | while read F
do
if [ -f ${F} ]
then
print ${F}
fi
done > ${IMPORT}

snavigator -import ${IMPORT} ${PROJ}






src/ThisClass.cc
src/ThatClass.cc
src/AnotherClass.cc
src/SomeClient.cc
src/BigServer.cc
../common/include/BaseClass.h
inc/ThisClass.h
inc/ThatClass.h
inc/AnotherClass.h
inc/SomeClient.h
inc/BigServer.h

             reply	other threads:[~2001-09-06  4:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-06  4:52 Doug Fraser [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-09-05 12:59 Doug Fraser
2001-09-05 13:31 ` Peter Milne

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E2D27064CD59574F88D05AEF5728396D44546C@PH01SRV02.photuris.com \
    --to=dfraser@photuris.com \
    --cc=sourcenav@sourceware.cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).