Example of a Makefile for a simple library
# G_COMPILER settings are optional, but are handy if you want to designate a
# preferred compiler. If they are set here you won't need to set them outside
# the Makefile. Generally a library is built with all available compilers.
# This gives users the freedom to use the compiler of their choice.
#
ifeq ($(GARCH),linux)
G_COMPILER ?= gcc4
endif
ifeq ($(GARCH),WIN32)
G_COMPILER ?= cl9
endif
# The project name is used to create directory names. For consistency
# make this the same name as the top level directory for the project.
#
PROJECT = collection
# For a project with subdirectories the PROJECT_HOME variable is the path
# of the top level directory in the project. In a simple project there
# is only the top level directory and this setting is not needed.
#
PROJECT_HOME = $(realpath ./)
# This is the name of the generated library file.
# There can be more only one library per directory.
#
LIBRARY = crest
# For C++ sources in a library set the CXXSRC variable.
#
CXXSRC = crest.cpp subroutine.cpp
# For C sources in a library set the CSRC variable.
#
CSRC = utility.c
# Include files to be installed. Do not list include files
# that are private.
#
INCLUDE_H = subroutine.h utility.h
# This include brings in the G Build Make files and is required.
#
include $(G)/common/build/make/directory.make
# This include brings in Make declarations to build a library
# with all available compilers. Note that when you include
# this make file additional targets are declared for:
# install all allclean
#
include $(G)/common/build/make/build.multiple.make