EXAMPLE GNUmakefiles FOR SoftRelTools DISTRIBUTION

1. A simple GNUmakefile for a package MyPackage that requires rootcint to be run, makes a library but has no test programs and no ROOT macros
   # Makefile for MyPackage package
   # Define whether rootcint should be run to generate ROOT
   # dictionaries
   ROOTCINT := YES
 
   # library 
   LIB := lib$(PACKAGE)
 
   #library contents
   LIBCXXFILES := $(wildcard *.cxx)

   ########################################################################
   include SoftRelTools/standard.mk
   E="background: transparent">include SoftRelTools/arch_spec_root.mk
2. A GNUmakefile for a package MyPackage that has test programs
   # Makefile for MyPackage package

   SUBDIRS = test

   # Define files for rootcint
   ROOTCINT = YES

   # library 
   LIB := lib$(PACKAGE)

   #library contents
   LIBCXXFILES := $(wildcard *.cxx)

   ########################################################################
   include SoftRelTools/standard.mk
   include SoftRelTools/arch_spec_root.mk
This package will have a GNUmakefile in the test directory.
   # Makefile for Persistencytest package

   # library 
   LIB := lib$(PACKAGE)test

   #library contents
   LIBCCFILES := DemoDaqOutputModule.cc DemoInputModule.cc

   # These are the test binaries. They are only built if you execute 
   # gmake tbin

   TBINS = TestPer DemoDaq DemoInput

   SIMPLEBINS = TestPer DemoDaq DemoInput

   # These are the libraries to build the binaries

   BINLIBS = -l$(PACKAGE) -l$(PACKAGE)test $(MINOSLIBS) $(ROOTLIBS) $(ROOTGLIBS)
 
   ########################################################################
   include SoftRelTools/standard.mk
   include SoftRelTools/arch_spec_root.mk

3. Another example of a GNUmakefile for a package with test programs. This one overrides the CINTLIST variable as it does not want to run rootcint on all the header files that are in the package.
   # Makefile for JobControl Package

   SUBDIRS = main test

   # Define files for rootcint. Don't want the standard CINTLIST 
   # so we override it
   ROOTCINT = YES
   override CINTLIST = JobCROOT.h JobC.h

   # library
   LIB = lib$(PACKAGE)

   # library contents - don't include Test*.cxx as they contain main programs
   LIBCXXFILES := $(wildcard *.cxx)

   ############################################################
   include SoftRelTools/standard.mk
   include SoftRelTools/arch_spec_root.mk

GNUmakefile in test subdirectory. This one has some root macros which will be copied to the macros directory of the release when the package is built. It makes both SIMPLEBINS - the executable has the same name as the source file that contains its main program - and COMPLEXBINS - the executable does not have the same name as the source file that contains its main program (a subdirectory may only contain one COMPLEXBIN). (If you look at the actual GNUmakefile for this package it has some extra stuff which is ugly but necessary and I have left it out of the example so as not to confuse the reader.)
   # Makefile for JobControltest Package

   # library
   LIB = lib$(PACKAGE)test

   # library contents - don't include Test*.cxx as they contain main programs

   skip_files := $(wildcard Test*.cxx)
   LIBCXXFILES := $(filter-out $(skip_files), $(wildcard *.cxx))

   # These are the test binaries. They are only built if you execute
   # gmake tbin

   TBINS = TestJobCModuleReg TestJobCPath TestJobCommand TestJobC TestBatch

   SIMPLEBINS = TestJobCModuleReg TestJobCPath TestJobCommand TestJobC

   COMPLEXBIN = TestBatch

   BINCXXFILES = JobCmain.cxx

   BINLIBS = -l$(PACKAGE)test $(MINOSLIBS) \
	     $(ROOTLIBS) $(ROOTGLIBS)

   ROOTMACROS = $(wildcard *.C) $(wildcard *.jcm)
   ############################################################
   include SoftRelTools/standard.mk
   include SoftRelTools/arch_spec_root.mk

4. Here is an example of a package that just builds a binary.
   # Makefile for minfastjob

   SUBDIRS = macros

   BINS = minfastjob

   SIMPLEBINS = $(BINS)

   BINLIBS = $(MINOSLIBS) $(ROOTLIBS) $(ROOTGLIBS)

   ########################################################################
   include SoftRelTools/standard.mk
   include SoftRelTools/arch_spec_root.mk
This one has a macros subdirectory. The root macros get copied to the macros directory in the release when the package is built.
   # Makefile for Minfastjob/macros

   ROOTMACROS = $(wildcard *.C)

   #########################################################################
   include SoftRelTools/standard.mk
   include SoftRelTools/arch_spec_root.mk

There are other examples of GNUmakefile in the various offline packages. If you need help constructing your makefile then please contact Liz Buckley-Geer.