APPGEN Manual

Contents

0.0: Introduction

Appgen is a Makefile generator for use with the Anderson Group Data Acquisition System. It reads in a specification file and produces a Makefile with standard targets appropriate to the architecture. For an overview of the programs that are required to support an instrument, please review the Data Acquisition Architecture Overview.

Appgen was first developed for QNX4 in June of 1993. The version described in this document is for use with the QNX6 version of the data acquisition architecture. The appgen program itself is written in Korn Shell script, so it is easily portable to other operating systems.

0.1: Invocation

appgen [spec file]

1.0: Overview

appgen generates a makefile based on the spec_file input. If spec file is not specified, appgen will look for a file of the form *.spec in the current directory. If there is a unique one, it will be used. appgen automatically overwrites the Makefile, so care should be taken that it is not invoked in the wrong directory.

The spec_file has two main sections. The first section is where the core components of the data acquisition system are specified. The second (optional) section, delineated by a line containing the string '%%', consists of additional text to be appended to the end of the generated Makefile. This makes it possible to extend the capabilities of appgen.

The main section of the spec_file has a syntax similar to that of a Makefile. Input can include comments, variable definitions and dependency definitions. Unlike in a Makefile, you do not define build commands, since defining those is appgen's job.

2.0: Variables

A variable definition consists of:

<name> = <value>

Spaces around the '=' are required. The same variable can be defined multiple times with each new definition simply appending to the current value.

Important variables include:

prefix
A short string used as a prefix for many of the output files. This is usually the experiment mnemonic in some form. If not defined, basename of the input file is used without the '.spec' extension.
TGTDIR
The base directory for the experiment's operations. This is usually defined with the prefix $(TGTNODE) to allow interactive addressing of multiple nodes. For example:
TGTDIR = $(TGTNODE)/home/Exp
TGTNODE
Usual not defined. Used in conjunction with TGTDIR to target a destination on a specific node. For example:
make distribution TGTNODE=/net/Exp
tmcbase
The list of all .tmc source files that define telemetry frame variables. That includes any .tmc file containing a variable definition with an explicit rate definition. Since multiple programs access the telemetry frame, it is important that they are all using the same definition.
cmdbase
cmdgen source files.
colbase
.tmc or other source files required by the data collection process. These usually involve code to initialize interfaces that receive data from device drivers.
swsbase
.sws files defining the software status commands and data definitions.
qclibase
.qcli source files.
SCRIPT
List of source files that should be copied to $(TGTDIR)/bin/$(VERSION).
DISTRIB
List of generated files that should be copied to $(TGTDIR)/bin/$(VERSION). All recognized targets get added to DISTRIB automatically, but additional targets can be added as well. For example, device drivers built in another directory are often referenced in this way.
SRCDIST
Key source files that should be archived with each data set. These files are copied to $(TGTDIR)/bin/$(VERSION)/Base. The files in tmcbase and qclibase as well as source files of type .tma, .tbl and .sol are included by default. Also, the .m files generated from qclibase.
IDISTRIB
Files that should be installed directly into $(TGTDIR). This includes any scripts which users are expected to execute interactively. This slways includes VERSION, Experiment.config and any generated doit scripts.

3.0: Dependencies

Dependencies take the form:

<target> : <sources>

<target> is the name of the output file and must have one of the suffixes listed below.

Sources listed in one of the base variables do not need to be listed explicitly in a dependency line.

Sources may also include library dependencies, e.g. -lsubbus.

Collection ($(prefix)col), command server ($(prefix)srvr) and keyboard client ($(prefix)clt) programs may not require an explicit dependency line in simple cases. These programs may be fully specified by the base variables.

Target Types

Collection: $(prefix)col
Generates the telemetry frame.
Command Server: $(prefix)srvr
Coordinates standard command channels.
Keyboard Client: $(prefix)clt
Provides interactive keyboard command capability
Data Display: *disp
Realtime display of data as text.
Algorithms: *algo
Algorithmic experiment control based on telemetry data.
GSE Startup Scripts: *doit
Code to setup data displays and other log screens for interactive monitoring.
Solfmt code: *sft
Low-level command cycles with no feedback.
Data extraction: *ext
Any other program that reads the telemetry frame for some purpose.

Appendix A: .spec File Syntax

    
     # comment line
     prefix = <prefix>  (optional: derived from spec file name)
     tmcbase = <files>
     cmdbase = <files>
     colbase = <files>
     swsbase = <files>
     qclibase = <files>
     var = substitution (supported vars are SRC TOOL OBJ
                         TGT (targets to build. copied to $TGTDIR/bin/$VERSION)
                         SCRIPT (source to be copied to $TGTDIR/bin/$VERSION)
                         DISTRIB (other files to be copied to $TGTDIR/bin/$VERSION)
                         SRCDIST (source to be copied to $TGTDIR/bin/$VERSION/Base)
                         IDISTRIB (to be copied to $TGTDIR)
                         TGTNODE TGTDIR
     target : <files>
     ...
     %%
     <additional Makefile contents>
    
     The following target types are supported:
       *algo   TMCBASE  dc usage
       *col    TMCBASE  dg usage T1 etc.
       *ext    TMCBASE  dc usage
       *disp   TMCBASE  dc usage
       *clt    CMDBASE  nl_cons, client usage
       *srvr   CMDBASE  T1
       *.sft
       *doit
     The following source types are supported:
       *.cdf
       *.edf
       *.tbl
       *.tma
       *.cyc
       *.tmc
       *.tmg
       *.cmd
       *.c
       *.slp (soldrv proxy) ==> .sol and something else
       *.oui
       *.doit
       *.DR

Return to Manuals Guide


last updated: Mon Feb 27 13:00 2017 EST webmaster@huarp.harvard.edu
Copyright 2017 by the President and Fellows of Harvard College