DLL = harmonizer".dll"
PROG = harmonizer".exe"

# CXX is an implied variable used as the name of C++ compiler. The
# default value is `g++'. So you don't have to write the following line.
CXX = g++

# CXXFLAGS is an implied variable used as the C++ compiler options.
CXXFLAGS = -g -Wall -fstack-check -fno-stack-limit $(INCLUDES)

# Specify the libraries.-shared
LIBS =  -shared -lpthread -mrtd


# Object files.
DLLOBJECTS = CTrnsysDLLObject.o HarmonizerDataTypes.o harmonizer.o 
EXEOBJECTS = win32_interface.o launch_dll.o
MODULE_OBJECTS = Win32_interface.o dll_functions.o
MODULES = Win32interface_module.mod dll_module.mod


theDLL :  $(DLLOBJECTS) 
	$(CXX) $(CXXFLAGS)  $(DLLOBJECTS) $(LIBS) -o $(DLL)


# File dependence.
CTrnsysDLLObject.o : CTrnsysDLLObject.h
HarmonizerDataTypes.o : HarmonizerDataTypes.h
harmonizer.o : CTrnsysDLLObject.h HarmonizerDataTypes.h

strip:
	@if [ -f $(DLL) ]; then strip $(DLL); fi
	@if [ -f $(PROG) ]; then strip $(PROG); fi

install:
	@if [ -f $(DLL) ]; then cp $(DLL) $(COSIMDir); fi
	@if [ -f $(PROG) ]; then cp $(PROG) $(COSIMDir); fi


#The following lines clean up files that can be generated by other files.
clean :
	rm -f core $(PROG) $(PROG).exe $(DLL) $(PROG).dll $(MODULE_OBJECTS) $(DLLOBJECTS) $(EXEOBJECTS) $(MODULES)

