• Antelope Release 5.10 Linux CentOS release 7.6.1810 (Core) 3.10.0 2020-05-12

 

NAME

antelopemakefile - Antelope Makefile format

DESCRIPTION

This manual page describes the usage and guidelines for Antelope Makefiles, including the required environment variables, default targets and rules.

Antelope makefiles all include a single file $(ANTELOPEMAKE) which contains the boiler plate targets and rules. These rules depend on the environment variable ANTELOPE, which defines various destination directories. This central included file is intended to simplify the process of porting to different architectures. On machines other than Suns, you may find that GNU make is required rather than the make which your vendor ships.

TARGETS

The included $(ANTELOPEMAKE) defines a range of targets. The standard set are the following:

The following targets are useful for selectively installing something from a directory:

Finally, these targets have special and unusual applications:

STANDARD MACROS

The following macros are useful shorthands for the link libraries required when a program uses libstock, libcoords, libds, libtr, liborb or libPkt. Note that libds uses libstock and libcoords, and libtr uses libds. You may find it convenient to use ldlibs(1) to figure out what the ldlibs line should be.

ENVIRONMENT VARIABLES

The following environment variables should be defined before running an Antelope Makefile:

MAKE VARIABLES

Standard Antelope makefiles set a few variables to indicate the targets that should be installed, and then may have specific rules for the construction of some targets. In general, the goal is to keep the Makefiles as small and simple as possible, and to avoid specifying rules if possible.

The standard set of variables which may be defined are:

In addition to the variables above defining targets, the following variables are useful for modifying the options used during compiles and links:

It's best to avoid specifying extra compiler flags, as these are often different for different compilers on different machines. In particular, it's bad to explicitly specify -g as this makes it difficult to globally compile using the optimizer.

The following variables must be defined immediately preceding the line include $(ANTELOPEMAKE). Order is important.

The following variables must be defined immediately following the line include $(ANTELOPEMAKE). Order is important.

RULES

$(ANTELOPEMAKE) adds a number of special purpose rules for installing programs and data files. These are primarily used for building an Antelope distribution at BRTT, but you may use these rules for installing your own programs, or compiling the contributed-code ("contrib") software. (The contrib software is compiled and distributed separately from BRTT software. Although the Antelope User Community makes compiled versions available at the time of each release, you may wish to compile versions yourself if bug fixes are released of if you make your own modifications. See the man-page contrib(5) for further details.)

In addition, $(ANTELOPEMAKE) recognizes some additional suffixes:

suffix interpreter
.xpl $antelope/bin/perl
.xppl perl
.xtcl $antelope/bin/atcl
.xwish $antelope/bin/awish
.oxtcl $antelope/bin/oatcl
.oxwish $antelope/bin/oawish
.csh /bin/csh
.wphp ??
.php php
These suffixes are similar to the standard .sh suffix; they cause an executable script to be created from the corresponding source file. In the standard case of .sh, a file script.sh is copied to a file script, and made executable.

For the new suffixes, it's useful to prepend a few special lines to specify the interpreter to be used. These "special" lines may change from release to release, hence it's better to keep them separate from the scripts. (They're actually kept in the templates directory). The task of copying the template and script and making the result executable is accomplished by the script produce(1). At BRTT, this script is also sometimes used to interpolate certain global values which may change from release to release into scripts, man pages or data files. See getid(1) for more detail.

EXAMPLE

Here's a simple Makefile which creates a library. It's a good idea to include a method for making a dynamic (shared) library as well as a static library.

INCLUDE=tttaup.h tttaup.i
LIB = libtttaup.a
MAN3= ptime.3 ptime.3f

include $(ANTELOPEMAKE)
DIRS=

OBJS=   tt_taup.o subs.o delta.o ptime.o ptime_.o
$(LIB) : $(OBJS)
        $(RM) $@
        $(AR) $(ARFLAGS) $@ $(OBJS)
        $(RANLIB) $@

Running make install in the directory containing this Makefile installs tttaup.h and tttaup.i in $(ANTELOPE)/include, ptime.3 and ptime.3f in $(ANTELOPE)/man/man3, and libtttaup.a in $(ANTELOPE)/lib.

Here's a simple Makefile which creates a program:


PF=dbverify.pf
MAN1=dbverify.1 dbchkwf.1
BIN=dbverify dbchkwf

ldlibs = $(DBLIBS)

include $(ANTELOPEMAKE)
DIRS=

OBJS=dbverify.o check_aview.o dbverify_expr.o dbfind_dups.o\
        dbshow_select.o
dbverify : $(OBJS)
        $(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS) $(LDLIBS)

Running make install in the directory containing this Makefile installs dbverify.pf in $(ANTELOPE)/data/pf, dbverify.1 and dbchkwf.1 in $(ANTELOPE)/man/man1, and dbverify and dbchkwf in $(ANTELOPE)/bin. Note the use of the DBLIBS macro definition, rather than an explicit list.

You can get a prototype copy of a makefile with the command mkmk(1), which prints a makefile template with comments. This can be edited to produce a custom makefile:


% mkmk -
BIN=
LIB=
DLIB=$(LIB:.a=$(DSUFFIX))
DATADIR=
DATA=
INCLUDE=
PF=

MAN1=
MAN3=
MAN5=

CLEAN=

cflags=
fflags=
ldflags=
ldlibs=

include $(ANTELOPEMAKE)

DIRS=

OBJS=
$(BIN) : $(OBJS)
        $(RM) $@
        $(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS) $(LDLIBS)

OBJS=
$(BIN) : $(OBJS)
        $(RM) $@
        $(FC) $(FFLAGS) -o $@ $(OBJS) $(LDFLAGS) $(LDLIBS)

OBJS=
$(LIB) : $(OBJS)
        $(RM) $@
        $(AR) $(ARFLAGS) $@ $(LORDER) $(OBJS) $(TSORT)
        $(RANLIB) $@

$(DLIB) : $(OBJS)
        $(RM) $@
        $(DLD) $(DLDFLAGS) -o $(DLIB) $(LORDER) $(OBJS) $(TSORT) $(DLDLIBS)

DIAGNOSTICS

Standard make(1) diagnostics.

SEE ALSO

antelope(3)
make(1)
mkmk(1)
manpage(1)
ldlibs(1)
template(1)
produce(1)
deposit(1)
getid(1)

BUGS AND CAVEATS

The standard $(ANTELOPEMAKE) replaces the standard rules for generating .f files from .F files (by running cpp(1)) to keep a local copy of the .f file, for use by the debugger.

The clean target removes all the BIN targets; this can be a problem if a target is not itself created by make, but is a static source file. In this case, make clean removes the original source file. To avoid this with scripts (for instance), make the source file target.sh, and then make will create the executable file target.

AUTHOR

Daniel Quinlan
Printer icon