# Makefile for Irrlicht Examples
# It's usually sufficient to change just the target name and source file list
# and be sure that CXX is set to a valid compiler

# Name of the executable created (.exe will be added automatically if necessary)
Target := smokeduel
# List of source files, separated by spaces
Sources := main.cpp ship.cpp missile.cpp CFDSolver.cpp entity.cpp mine.cpp /course/cs134/student/mcfeldma/lib/fmodapi41001linux/api/lib/libfmodex.so

Objects := main.o ship.o missile.o CFDSolver.o entity.o mine.o
# Path to Irrlicht directory, should contain include/ and lib/
#IrrlichtHome := ../..
IrrlichtHome := /course/cs134/student/mcfeldma/lib/irrlicht-1.4
# Path for the executable. Note that Irrlicht.dll should usually also be there for win32 systems
BinPath = .

# general compiler settings (might need to be set when compiling the lib, too)
# preprocessor flags, e.g. defines and include paths
USERCPPFLAGS = -I/course/cs134/student/mcfeldma/lib/fmodapi41001linux/api/inc
# compiler flags such as optimization flags
#USERCXXFLAGS = -O3 -ffast-math
USERCXXFLAGS = -O3 -ffast-math -g -Wall
#USERCXXFLAGS = -g -Wall
# linker flags such as additional libraries and link paths
USERLDFLAGS = -Wl,-rpath,/course/cs134/student/mcfeldma/lib/fmodapi41001linux/api/lib /course/cs134/student/mcfeldma/lib/fmodapi41001linux/api/lib/libfmodex.so 

####
#no changes necessary below this line
####

CPPFLAGS = -I$(IrrlichtHome)/include -I/usr/X11R6/include $(USERCPPFLAGS)
CXXFLAGS = $(USERCXXFLAGS)
LDFLAGS = $(USERLDFLAGS) -L/usr/X11R6/lib$(LIBSELECT) -L$(IrrlichtHome)/lib/Linux -lIrrlicht -lGL -lGLU -lXrandr -lXext -lX11

#default target is Linux
all: all_linux

all_linux clean_linux: SYSTEM=Linux
# name of the binary - only valid for targets which set SYSTEM
DESTPATH = $(BinPath)/$(Target)$(SUF)

%.o: %.cpp
	$(CXX) -c $^ $(CPPFLAGS) $(CXXFLAGS)

%.cpp: %.h

all_linux: $(Objects)
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ -o $(DESTPATH) $(LDFLAGS)

clean: clean_linux

clean_linux:
	rm -f $(Objects) *~ $(DESTPATH)

.PHONY: all clean clean_linux

#multilib handling
ifeq ($(HOSTTYPE), x86_64)
LIBSELECT=64
endif
#solaris real-time features
ifeq ($(HOSTTYPE), sun4)
LDFLAGS += -lrt
endif

