SHAPE_TMPL(7)
π SHAPE_TMPL(7) π
okay so welcome to the Miscellaneous Information Manual, bestie. This is SHAPE_TMPL(7), and it's giving template lore. Sit down, grab a strawberry, we're doing this. π
πΈ NAME πΈ
Shapefile.tmpl,Makefile.tmpl,Release.tmpl,release.c.tmplβ the templates in the shapeTools RMS
β¨ DESCRIPTION β¨
When you're working inside the shapeTools Release Management System, all the system model files (that means your Shapefiles and your Makefiles) must be derived from templates, namely Shapefile.tmpl and Makefile.tmpl. No skipping this step, it's not optional. π
Those templates define a certain number of standard macro names that get used throughout the shapeTools RMS. Deriving system model files from the templates is mainly just... filling in the appropriate macro values. That's it. That's the job. You're basically decorating. π
The next section gives you an overview of every macro name defined in the templates, plus a short explanation of the semantics of each macro.
Release.tmpl and release.c.tmpl are templates for release identification files. They do not need to be adapted in any way. Like, at all. Leave them alone, they're perfect. π
π₯ MACROS π₯
Here's the list of macros that occur in the Shape- and Makefile templates. Most of them are defined in the Makefile. And since Makefiles are included in the Shapefiles, both calls of make and calls of shape use them. Some shape specific macros (the ones defined in the Shapefile template) get described at the end of this section, don't worry, we get there. π¦
Because the shapeTools RMS performs recursive calls of shape (resp. make), some of the standard macro settings get inherited down into a recursively called sub-build-process. Those macros are marked in the list accordingly. This inheritance mechanism is honestly iconic: it lets installation dependent macros (eg. BASE) be set for the whole entire project by only modifying the value in the top level Shape-/Makefile. One edit. Whole project. ate. β¨
π Locations and General Macros π
BASE(inherited) β the base directory of the project's central source repository.NODEPATHβ the relative path name of a system node within the project's source repository. In the top node, this macro has an empty value. For subsystems, set it to the path relative to$(BASE)(eg."/subsystem/library").NODENAMEβ a short name for the developed system node. This name will also be used for generating release identification strings having the form<system_name>-<release_number>.HOSTSYSTEM(inherited) β the underlying operating system. The value of theHOSTSYSTEMmacro is built after the schemas-<opSys>. This macro has different meanings inmakeand inshape, so pay attention bestie:maketreats it as an extension to a known base path for accessing the appropriate versions of operating system dependent files. The base path points to a directory containing subdirectories for each supported operating system type. All subdirectories carry the same list of filenames, with in each case different (operating system specific) contents.- For
shape, theHOSTSYSTEMmacro is treated as a variant definition. With the corresponding variant definition defined in the variant definitions include file (seeshape_stdvar(7)), a whole bunch of macros is set (resp. modified).
HOSTTYPE(inherited) β the machine architecture. This macro should be used for installing different binaries (for different machine architectures) compiled from the same program source in a heterogeneous network. On systems containing thearchcommand,HOSTTYPEmay be dynamically set byHOSTTYPE=arch``. This macro is currently not supported in the default installation setup.SWITCHES(inherited) β preprocessor switches for conditional compilation. This macro may be used for system wide switching on/off of certain program behavior. TheSWITCHESare passed as arguments to the language preprocessor.INSTALLBASE(inherited) β locations and modes for installation of executables, header files, libraries, and manuals. TheINSTALLBASEmacro eases the definition and redefinition of the following installation path macros, as the values of these may citeINSTALLBASE. Each of the installation path macros may also be set to a value independent ofINSTALLBASE.INSTALLBINPATH(inherited) β installation directory for executablesINSTALLBINMODE(inherited) β file protection mode to be set for installed executablesINSTALLINCPATH(inherited) β installation directory for include filesINSTALLINCMODE(inherited) β file protection mode to be set for installed include filesINSTALLLIBPATH(inherited) β installation directory for librariesINSTALLLIBMODE(inherited) β file protection mode to be set for installed librariesINSTALLMANPATH(inherited) β installation directory for manualsINSTALLMANMODE(inherited) β file protection mode to be set for installed manuals- Installing manuals using the
INSTALLMANPATHmacro expects appropriatemanX(man1, ...) subdirectories there. π
LIBPATH(inherited) β the directory where local libraries, developed within the project, shall be installed for project wide use.INCLUDEPATH(inherited) β similar toLIBPATH. The location of project internal header files.
π§© The System Components π§©
TARGETβ the name of the main target to be built. This can be a program, a library, or anything else to be produced. If the construction of the main target does not require any real transformation (if eg. only subsystems are to be built), it is advisable to have a file$(SUBSYSTEMNAME).dateas main target. The system building action should justtouchthis file, so that its modification date shows when the last system building action happened. If the managed system consists of multiple programs, this macro should be multiplied (eg.TARGET_1 TARGET_2 ... TARGET_N). In that case, all places in the Makefile where$(TARGET)occurs have to be modified accordingly ! (yes, that exclamation mark is staying, this one is serious)VERSIONFILEβ the name of a file, used as release number generator. With each new release, a new version of this file is generated automatically. When developing a program, this file ideally contains exactly one function returning a version identification string. When using the ShapeTools version control system's attribute citation mechanism, the contents of such a file needs only to be written once and never be changed afterwards. There are different prototypes for such a file in$(LIBPATH)/shape. For system parts not incorporating an executable program, any other source file could be chosen as release number generator. In any case,$(VERSIONFILE)should never be saved explicitly by the user. πVERSIONOBJECTβ the object file (.ofile) derived fromVERSIONFILE. This macro is only to be set whenVERSIONFILEcontains program text.SUBSYSTEMSβ all subdirectories where additional parts of the system wait for being built. For each subtarget, a recursiveshape(resp.make) call is performed with the current macro settings getting inherited. TheSUBSYSTEMSwill be built beforeTARGET. This macro may also be empty.ALIASESβ this is a list of aliases forTARGET. This macro is to be set whenTARGETshould be accessible by multiple names (eg. a program to be activated under different names).SOURCESβ a list of all programming language source files belonging to the system. In the case of C development, these are the.cfiles.HEADERSβ the header files belonging to the system. The.hfiles in case of C development.AUXSOURCESβ auxiliary source files. These are source files that shall also be processed when building the system, but that are not genuine part of the system. These are for example sources of auxiliary test programs, needed to perform tests in the development area.AUXHEADERSβ auxiliary header files, similar to auxiliary sources.VARIANTSOURCESVARIANTHEADERSβ equally named source and header files, located in subdirectories, each named after a certain variant. For system building, only one of the directories is used, according to the specifiedHOSTSYSTEM. In theshape_RMSenvironment, the subdirectory names should be chosen from the value set of theHOSTSYSTEMmacro (for more details, see the description of theHOSTSYSTEMmacro above).MANUALSβ the manual files for the system, distinguished by categories.COMPONENTSβ all source components belonging to the system. These are the source files (SOURCES), the include files (HEADERS), the manuals (MANUALS), the Shapefile, the Makefile and a (generated) file namedDependencies.OBJECTSβ all files automatically produced during a build process exceptTARGET. These are usually the.ofiles.
π οΈ Tools, Flags and Libraries π οΈ
MAKE(inherited) β the make program. This macro is used for recursive calls ofmake. During execution ofshape, this macro is explicitly (in the Shapefile) set to the value of theSHAPEmacro. This causes recursive builds also to be performed byshape. slay.SHELL(inherited) β the shell to be used bymake, resp.shapefor interpreting the build actions in the Makefile or Shapefile.CC(inherited) β the C compiler to be used.CFLAGS(inherited) β the C compilation flags (seeSWITCHESfor additional compilation flags).LDFLAGS(inherited) β the linker flags.RANLIB(inherited) β the program for adding a table of contents to archives.SYSLIBS(inherited) β additional system libraries to be linked toTARGETLOCALLIBSβ local libraries to be linked toTARGETLINTLIBSβ libraries to be invoked when executing"lint".
π Shape Specific Macros π
VERSIONSβ the default version binding (version selection) rule to be applied for each component. Selection rules are globally defined in the$(SHAPELIBPATH)/stdrulesfile (seeshape_stdrul(7)). It is strongly recommended to define a project wide version selection policy only in thestdrulesfile and to renounce version selection rules in local Shapefiles. fr fr, keep it global.BINDDEFAULT(inherited) β internal name forVERSIONS. Should not be redefined.BINDINSTALL(inherited) β the default version binding rule to be applied when installing a system or system part for project wide or global use. π
COMPILER (inherited) π»β¨
okay so bestie, this macro is literally the compile environment. It's a shape variant selection. With each variant, a whole bunch of macro settings may be associated, so that the COMPILER variant not only sets the actual compiler (CC), but also some compilation flags. See stdvar for the default variant raster. Same as version selection rules, the variant raster should be defined project wide. Local variant definitions can very easily lead to confusion and improper configurations. So maybe don't do that. π
QUALITY (inherited) π
The desired quality of the produced object code. This is also a variant definition (see stdvar for other options). Slay.
RELEASEBASE (inherited)
PARTIALRELEASEBASE (inherited) π¦
The base of the directory tree, where prereleases and releases of the system are to be constructed. When building a (pre)release, the appropriate versions of all components of the system are copied from the development area to the release area. The release area should only be used for performing final tests and for bundling up a shippable package. Periodt.
RELEASESRCPATH π£οΈ
The relative path within the release or partial release area where the source files are to be copied to. Usually, this is identical to $(NODEPATH).
RELEASEMANPATH π
The relative path within the release or partial release area where all manuals are gathered.
SHAPELIBPATH (inherited) π
The directory, where all common parts of the shape_RMS environment reside. Here are all the templates and shape include files located.
.BPOOL: π
This is rather a pseudo-target than a Macro. Shape interprets this as a directive that causes only the listed files ($(OBJECTS)) to be put into the derived object cache. Defining the pseudo target .NOBPOOL: (without dependents) deactivates the derived object cache. This is necessary, when the development environment requires access to the same derived object cache from machines with different architectures. The reason is, that "dbm" databases (and derived object caches use dbm databases) are not portable between different machine architectures. π
FILES πβ¨
Shapefile.tmplβ Template for node specific ShapefilesMakefile.tmplβ Template for node specific Makefilesrelease.c.templateRelease.template
SEE ALSO π
and that's the tea, bestie π΅β¨ this page is SHAPE_TMPL(7) and it's dated 12.10.126. mwah π
π¦ where this page comes from
- debian bookworm: shapetools 1.4pl6-15+b1
- ubuntu jammy: shapetools 1.4pl6-15
- ubuntu noble: shapetools 1.4pl6-16.1build1
- ubuntu questing: shapetools 1.4pl6-16.1build1
- ubuntu resolute: shapetools 1.4pl6-17
- ubuntu stonking: shapetools 1.4pl6-17
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms