# This is a Makefile template for developing portable syzygy applications.
# It sits in my_application/build/makefiles as below:
#
# my_application
#   build
#     makefiles
#     linux
#     win32
#     darwin
#   src

# For the build to work, you must set $SZGHOME (pointing to the top-level
# directory of your syzygy install, either "developer" or "easy").
# You will also need to set $SZGBIN (which indicates the directory in which
# executables will be placed). Finally, if you are using external libraries
# (such as sound), you will need to set $SZGEXTERNAL appropriately. Please
# see the syzygy documentation.

# Source files are located relative to the final Makefile location
# this line needs to come *before* the Makefile.defines inclusion.
# The ../../src is correct for the standard portable application
# development directory tree (which lets you develop for all supported
# szg platforms simultaneously).
VPATH=../../src

# There are two styles with which applications can be built:
# EASY or DEVELOPER
# DEVELOPER is more appropriate (and is the default) if you are also
# building the library from source. EASY is more appropriate if you
# are just compiling against a library version. NOTE: if you have just
# installed a precompiled library package then you MUST use EASY (you
# don't have some of the needed intermediate files).
SZG_LIBRARY_STYLE := EASY

# this includes all the definitions
include $(SZGHOME)/build/make/Makefile.defines

# You can choose whether or not to use precompiled headers. This only
# matters for Windows systems. It may be possible to compile with a 
# broader variety of Visual C++ patch levels WITHOUT precompiled headers.
# NOTE: If you are using the EASY application build style then you MUST
# NOT use precompiled headers.
PRECOMPILED_HEADER_LOCATION = $(PRECOMPILED_HEADER_DISABLE)
#PRECOMPILED_HEADER_LOCATION = $(PRECOMPILED_HEADER_LOCATION_ABSOLUTE)

# Every executable file should be listed below, seperated by spaces.
# NOTE: you must use the $(EXE) for compatibility between Unix and Win32.
ALL := zyspace$(EXE)

# Here should go any object files you need compiled to link with your
# executable, in the format foo$(OBJ_SUFFIX) to ensure portability.
# If you have no intermediate objects, it is OK for this to be blank, i.e.
#
# OBJS := 
#
OBJS := \
	GraphicsUtilities$(OBJ_SUFFIX) \
	gadgetry$(OBJ_SUFFIX)  \
	quatomat$(OBJ_SUFFIX) \
	opticks$(OBJ_SUFFIX)

# the following magic line is necessary! See Makefile.defines
Everything: $(ALL)

# It is possible to add flags to the compile line like so. All executables
# and objects will be compiled with this flag.
COMPILE_FLAGS += -DSYZYGY

# Include directories can be added like so:
# INC_LIBRARY += \
#	-I$(MY_INCLUDE_DIRECTORY_1)
#	-I$(MY_INCLUDE_DIRECTORY_2)
#

# A similar link line should appear for all of your generated exe's:
# NOTE: You can add additional libraries to your link line like
# my_app$(EXE): my_app$(OBJ_SUFFIX) $(OBJS) $(MY_LIBRARY_NAMES) $(SZG_LIBS)
#	$(LINKER) $(LINK_FLAGS) $(LINK_PREFIX)$@ $^ $(LIBS)

zyspace$(EXE): zyspace$(OBJ_SUFFIX) $(OBJS) $(SZG_LIBS)
	$(LINKER) $(LINK_FLAGS) $(LINK_PREFIX)$@ $^ $(LIBS)
