Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  <19951996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  Index 1994  <19951996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020 
<== Date ==> <== Thread ==>

Subject: application directories and CVS, GNU make etc
From: wlupton@keck.hawaii.edu (William Lupton)
Date: Wed, 31 May 95 13:35:03 HST
Dear all,

  I have been working on setting up application directories to work with
CVS, GNU make and as much of the EPICS config stuff as possible. I
thought that it would be worthwhile summarizing and soliciting comment,
especially as others may already be thinking about or doing similar
things. I haven't finished yet and can still change things! It would be
good if the results could get used by more than just us.

  Oh. My summary seems to be rather long. Sorry about that.

  William

- stop here if bored ------------------------------------------------------

Motivation
----------

1. To use CVS for application directories (not for binary files; should
   be able to do a cvs checkout, then execute a script - possibly
   automatically - and be ready to go in a fully populated EPICS
   application tree)

2. To use GNU make for application directories (and also as much as
   possible of the standard EPICS config files)

3. To support working in single standalone application directories and
   also larger projects which consist of multiple application
   directories (this is the approach that we are taking; there is a natural
   hierarchy of sub-systems, each of which corresponds to a separate
   application directory: lower-level ones can run standalone and
   higher-level ones coordinate the lower-level ones and inherit their
   databases, records, displays, sequences and so on).

4. To support making of and referring to named releases (and integration
   into the existing Keck scheme for this, but _not_ by adding Keck
   specifics to the EPICS stuff)


Approach
--------

1. I started with the LANL sae extension (as modified by Andrew Johnson
   of RGO; these mods were fairly minor and do not substantially change
   the programmer's view of the directory structure).

2. Originally I had planned to retain getrel unchanged. However I wanted
   the application directory to look as like the EPICS tree as possible
   and there- fore wanted to use the EPICS O.<arch> convention for
   object directories.  I also felt that links like "targetfrc30" which
   reference "base/bin/frc30" offered little over using the explicit
   link. In addition, having top-level links for things like "include"
   are problematic, since in the old scheme these refer to EPICS base
   directories, whereas I wanted them to refer to application-specific
   directories.

3. The result is that I have created a modified getrel which takes a
   "-keck" option. Doing "getrel -keck" on an empty directory results
   in:

% ls -alR
total 8
drwxr-xr-x  3    512 May 31 12:28 .
drwxr-xr-x 13   1024 May 31 12:22 ..
-rw-r--r--  1     54 May 31 12:28 .current_rel_hist
lrwxrwxrwx  1     27 May 31 12:28 base -> /usr/local/epics/epics/base
lrwxrwxrwx  1     29 May 31 12:28 config -> /usr/local/epics/epics/config
drwxr-xr-x  2    512 May 31 12:28 data
lrwxrwxrwx  1     33 May 31 12:28 extensions -> /usr/local/epics/epics/extensions
lrwxrwxrwx  1     24 May 31 12:28 vw -> /usr/local/vw/m5.1.1.dcs
 
data:
total 4
drwxr-xr-x  2    512 May 31 12:28 .
drwxr-xr-x  3    512 May 31 12:28 ..
lrwxrwxrwx  1     26 May 31 12:28 default.dctsdr -> ../base/rec/default.dctsdr
lrwxrwxrwx  1     26 May 31 12:28 default.sdrSum -> ../base/rec/default.sdrSum

4. A few things are worthy of comment. Firstly the directory contains
   base, config and extensions links. This is something that Andrew had
   started and which I have taken further. I have done this in
   sub-directories created by applSetupDir too. The result is that the
   executable path can have relative entries (base/bin/`arch` etc)
   before any absolute ones and thus you always pick up the correct
   versions of EPICS stuff. This may be controversial (I know that R3.11
   had something similar implemented via hidden files and this was taken
   out...).

5. Secondly, the default.dctsdr etc links are in a sub-directory called
   data.  As will be seen, all source files are in a src tree and the
   Makefiles in this tree install to various sub-directories of the
   application directory (there is support for installing elsewhere for
   reasons of version management).  The install directories are the
   standard EPICS ones (bin, lib, include, man, doc) plus a new one
   (data: for data files, assumed architecture-independent) plus there
   needs to be ascii (see later) but I haven't added that yet.

6. I also modified applSetupDir with a "-keck" option (and also a
   "-getrel" option which causes it to invoke getrel too), which causes
   it to add some more links and populate a skeleton src tree. It can
   now safely be executed as many times as you like and will only create
   files which don't exist (necessary if you are going to execute it
   each time you do a cvs checkout, as is the intention). Doing
   "applSetupDir -keck" on the above gives (with some stuff omitted for
   brevity):

ls -alR
total 14
drwxr-xr-x  4    512 May 31 12:41 .
drwxr-xr-x 13   1024 May 31 12:22 ..
-rw-r--r--  1     54 May 31 12:28 .current_rel_hist
-rw-r--r--  1     36 May 31 12:40 .setupAsEPICS
-rw-r--r--  1   1323 May 31 12:41 CONFIG_APPLIC
-rw-r--r--  1    119 May 31 12:41 Makefile
lrwxrwxrwx  1     27 May 31 12:28 base -> /usr/local/epics/epics/base
lrwxrwxrwx  1     29 May 31 12:28 config -> /usr/local/epics/epics/config
drwxr-xr-x  2    512 May 31 12:28 data
lrwxrwxrwx  1     33 May 31 12:28 extensions -> /usr/local/epics/epics/extensions
drwxr-xr-x  9    512 May 31 12:41 src
lrwxrwxrwx  1     35 May 31 12:40 templates -> extensions/src/saekeck/templates
lrwxrwxrwx  1     24 May 31 12:28 vw -> /usr/local/vw/m5.1.1.dcs
 
data:       (unchanged from before)

src:
total 13
drwxr-xr-x  9    512 May 31 12:41 .
drwxr-xr-x  4    512 May 31 12:41 ..
-rw-r--r--  1    139 May 31 12:41 Makefile
drwxr-xr-x  2    512 May 31 12:41 alh
drwxr-xr-x  5    512 May 31 12:41 ar
drwxr-xr-x  4    512 May 31 12:41 ascii
lrwxrwxrwx  1      7 May 31 12:41 base -> ../base
drwxr-xr-x  2    512 May 31 12:41 capfast
lrwxrwxrwx  1      9 May 31 12:41 config -> ../config
drwxr-xr-x  2    512 May 31 12:41 db
drwxr-xr-x  2    512 May 31 12:41 dl
lrwxrwxrwx  1     13 May 31 12:41 extensions -> ../extensions
drwxr-xr-x  2    512 May 31 12:41 misc

src/alh:
total 6
drwxr-xr-x  2    512 May 31 12:41 .
drwxr-xr-x  9    512 May 31 12:41 ..
-rw-r--r--  1    120 May 31 12:41 Makefile
lrwxrwxrwx  1      7 May 31 12:41 base -> ../base
lrwxrwxrwx  1      9 May 31 12:41 config -> ../config
lrwxrwxrwx  1     13 May 31 12:41 extensions -> ../extensions

src/ar:     (like alh except creates arChan etc dirs)

src/ascii:  (make in here does makesdr; cf base/src/ascii)
total 9
drwxr-xr-x  4    512 May 31 12:41 .
drwxr-xr-x  9    512 May 31 12:41 ..
lrwxrwxrwx  1     34 May 31 12:41 Makefile -> ../../templates/src/ascii/Makefile
lrwxrwxrwx  1     39 May 31 12:41 Makefile.Unix -> ../../templates/src/ascii/Makefile.Unix
lrwxrwxrwx  1      7 May 31 12:41 base -> ../base
drwxr-xr-x  2    512 May 31 12:41 cat_ascii
lrwxrwxrwx  1      9 May 31 12:41 config -> ../config
lrwxrwxrwx  1     13 May 31 12:41 extensions -> ../extensions
drwxr-xr-x  2    512 May 31 12:41 replace_ascii

src/ascii/cat_ascii:  (initially empty)
src/ascii/replace_ascii:  (initially empty)

src/capfast: (like old gdct directory)
total 8
drwxr-xr-x  2    512 May 31 12:41 .
drwxr-xr-x  9    512 May 31 12:41 ..
-rw-r--r--  1    124 May 31 12:41 Makefile
-rw-r--r--  1    272 May 31 12:41 Makefile.Unix
lrwxrwxrwx  1      7 May 31 12:41 base -> ../base
lrwxrwxrwx  1      9 May 31 12:41 config -> ../config
lrwxrwxrwx  1     31 May 31 12:41 edb.def -> extensions/src/e2sr/lib/edb.def
lrwxrwxrwx  1     13 May 31 12:41 extensions -> ../extensions

src/db:     (like alh; hopefully not used!)
total 9
drwxr-xr-x  2    512 May 31 12:41 .
drwxr-xr-x  9    512 May 31 12:41 ..
-rw-r--r--  1    119 May 31 12:41 Makefile
-rw-r--r--  1    267 May 31 12:41 Makefile.Unix
lrwxrwxrwx  1      7 May 31 12:41 base -> ../base
lrwxrwxrwx  1      9 May 31 12:41 config -> ../config
lrwxrwxrwx  1     25 May 31 12:41 default.dctsdr -> ../../data/default.dctsdr
lrwxrwxrwx  1     25 May 31 12:41 default.sdrSum -> ../../data/default.sdrSum
lrwxrwxrwx  1     13 May 31 12:41 extensions -> ../extensions
 
src/dl:
total 8
drwxr-xr-x  2    512 May 31 12:41 .
drwxr-xr-x  9    512 May 31 12:41 ..
-rw-r--r--  1    119 May 31 12:41 Makefile
lrwxrwxrwx  1      7 May 31 12:41 base -> ../base
lrwxrwxrwx  1      9 May 31 12:41 config -> ../config
lrwxrwxrwx  1     13 May 31 12:41 extensions -> ../extensions
lrwxrwxrwx  1     35 May 31 12:41 template.adl -> ../../templates/src/dl/template.adl
lrwxrwxrwx  1     34 May 31 12:41 template.dl -> ../../templates/src/dl/template.dl
 
src/misc:
total 10
drwxr-xr-x  2    512 May 31 12:41 .
drwxr-xr-x  9    512 May 31 12:41 ..
-rw-r--r--  1    121 May 31 12:41 Makefile
-rw-r--r--  1    644 May 31 12:41 Makefile.Unix
-rw-r--r--  1    340 May 31 12:41 Makefile.Vx
lrwxrwxrwx  1      7 May 31 12:41 base -> ../base
lrwxrwxrwx  1      9 May 31 12:41 config -> ../config
lrwxrwxrwx  1     13 May 31 12:41 extensions -> ../extensions
-rw-r--r--  1      0 May 26 17:17 resource.def
-rw-r--r--  1   1147 May 30 11:13 startup.vws ("VxWorks Shell")

7. I haven't done all the make rules yet, but have done those in capfast
   (to generate ASCII .db files from .sch files using e2sr) and ascii (a
   wrap around makesdr similar to the way base/src/ascii does it).
   There's a rule to generate xxx from xxx.vws including sed'ing :arch:
   and :appl: as appropriate.

8. I've already gone on too long, but just a word on the Makefiles,
   release management and so on. I have defined a new CONFIG_APPLIC
   which is included by all the Makefiles (cf CONFIG_BASE and
   CONFIG_EXTENSIONS). This overrides some stuff and also includes (if
   it exists) a CONFIG_APPLIC file from the application directory which
   controls where files are installed, where external application
   includes and libraries are taken from, which target architectures
   should be built etc. I have added some stuff to RULES.*, but nothing
   that should be a problem (practical or intellectual) for the main
   EPICS build. Here's the template src/misc/Makefile.Unix. It's pretty
   like a typical such file in one of the extensions/src/xxx
   directories.

# will/src/misc $Id$
# $Log$

EPICS   = ../../..
 
include Target.include
include $(EPICS)/config/CONFIG_APPLIC

# External libraries on which this directory is dependent
DEPLIBS	=

# User compiler and loader flags (., .., local installation, application-wide,
# EPICS base and EPICS extensions directories are automatically searched)
USR_CFLAGS   =
USR_INCLUDES =
USR_LDFLAGS  =
USR_LDLIBS   =

# Names of C source files (no extensions)
NAMES	= 

SRCS.c	= $(NAMES:%=%.c)
OBJS	= $(NAMES:%=%.o)

# Standard macros for files which are to be built and installed
PROD	=
LIBNAME	=
INC	=
MAN1	=
DOCS	=
SCRIPTS	=
DATA	= resource.def

include $(EPICS)/config/RULES.Unix


Still to do
-----------

1. It's working but not quite done. The biggest thing that I still need
   to do is to sort out how to handle ascii files from multiple
   application directories. Doing "make install" in src/ascii should
   install the files in the cat_ascii and replace_ascii directories so
   that they can be referenced by other application directories (the
   idea is that other application directories should not directly
   reference src trees, only installed files). Given that there can be
   name conflicts (everyone might append to choiceGbl.ascii for
   example), the application directory name must be part of the
   installation directory. For application directory "fred" I propose
   installing the files to ascii/fred/add (cf cat_ascii), ascii/fred/rep
   (cf replace_ascii) and ascii/fred/sub (patterns to be _removed_ from
   files rather than added; won't get implemented unless it's needed).
   Then the application directory CONFIG_APPLIC file will be able to
   contain a list of application directories from which "make install"
   in src/ascii should take and concatenate (or whatever) the ascii
   files.

2. The above scheme will fit our requirements, where I don't want to put
   our private application-specific records and device support into
   EPICS base. As a rule of thumb I want EPICS base only to contain the
   sort of local stuff which should be submitted to the community for a
   future release.

3. There's some more tidying up of the template Makefiles, plus
   applSetupDir has become chock full of duplicated code. It would be
   better to drive it entirely via the contents of the template
   directory (which is now a tree); or even to make the Makefiles create
   default trees automatically?

4. There are some more tools to write to do with handling release
   directories.  I hardly mentioned this, but I think the necessary
   hooks are in there and working.

5. It needs documenting. I apologise for this long initial message.
   Subsequent discussion can involve a smaller group.

6. I will have some minor comments on the EPICS config files and so on
   ...  but have had very little trouble, and the fact that I have had
   to change so little in order to get this application stuff working is
   a testament to their good design. I really like GNU make (although I
   _did_ like .KEEP_STATE:) ... and I _love_ CVS!

----------------- William Lupton (wlupton@keck.hawaii.edu) -----------------
Home:	PO Box 7135,		Work:	W. M. Keck Observatory, PO Box 220,
	Kamuela, HI 96743, USA		Kamuela, HI 96743, USA
	(808) 885 3475			(808) 885 7887, (808) 885 4464 (fax)

Replies:
Re: application directories and CVS, GNU make etc Johnny Tang

Navigate by Date:
Prev: Re: MCG AboveBoard Newsletter Vol.2 Num.5/ 4. Mitsubishi PLCC EEPROM Availability winans
Next: Re: application directories and CVS, GNU make etc Nick Rees
Index: 1994  <19951996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020 
Navigate by Thread:
Prev: Re: MCG AboveBoard Newsletter Vol.2 Num.5/ 4. Mitsubishi PLCC EEPROM Availability winans
Next: Re: application directories and CVS, GNU make etc Johnny Tang
Index: 1994  <19951996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020 
ANJ, 10 Aug 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·