# Makefile generated by OpenModelica
CC=@CC@
AR=@AR@
CFLAGS=@CFLAGS@
LD=$(CC) -shared
LDFLAGS=@LDFLAGS@ @LIBS@
DLLEXT=@DLLEXT@
NEED_RUNTIME=@NEED_RUNTIME@
NEED_DGESV=@NEED_DGESV@
FMIPLATFORM=@FMIPLATFORM@
# Note: Simulation of the fmu with dymola does not work with -finline-small-functions (enabled by most optimization levels)
CPPFLAGS=@CPPFLAGS@
OMC_NUM_LINEAR_SYSTEMS=0
OMC_NUM_NONLINEAR_SYSTEMS=0
OMC_NUM_MIXED_SYSTEMS=0
OMC_NDELAY_EXPRESSIONS=0
OMC_NVAR_STRING=0

override CPPFLAGS += -Iinclude/ -Iinclude/fmi2 -I.    -DOMC_MODEL_PREFIX=StategraphSample -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0

MAINFILE=StategraphSample_FMU.c
MAINOBJ=StategraphSample_FMU.o
CFILES=StategraphSample.c StategraphSample_functions.c StategraphSample_records.c \
StategraphSample_01exo.c StategraphSample_02nls.c StategraphSample_03lsy.c StategraphSample_04set.c StategraphSample_05evt.c StategraphSample_06inz.c StategraphSample_07dly.c \
StategraphSample_08bnd.c StategraphSample_09alg.c StategraphSample_10asr.c StategraphSample_11mix.c StategraphSample_12jac.c StategraphSample_13opt.c StategraphSample_14lnz.c \
StategraphSample_15syn.c StategraphSample_16dae.c StategraphSample_init_fmu.c
OFILES=$(CFILES:.c=.o)
GENERATEDFILES=$(MAINFILE) StategraphSample_FMU.makefile StategraphSample_literals.h StategraphSample_model.h StategraphSample_includes.h StategraphSample_functions.h  StategraphSample_11mix.h StategraphSample_12jac.h StategraphSample_13opt.h StategraphSample_init_fmu.c StategraphSample_info.c $(CFILES) StategraphSample_FMU.libs

# FIXME: before you push into master...
RUNTIMEDIR=include
OMC_MINIMAL_RUNTIME=1
OMC_FMI_RUNTIME=1
include $(RUNTIMEDIR)/Makefile.objs
ifneq ($(NEED_RUNTIME),)
RUNTIMEFILES=$(FMI_ME_OBJS:%=$(RUNTIMEDIR)/%.o)
endif

PHONY: StategraphSample_FMU
StategraphSample_FMU: $(MAINOBJ) StategraphSample_functions.h StategraphSample_literals.h $(OFILES) $(RUNTIMEFILES)
	$(CXX) -shared -I. -o StategraphSample$(DLLEXT) $(MAINOBJ) $(RUNTIMEFILES) $(OFILES) $(CPPFLAGS) -L"C:/Users/clagms/Source Control/Git_HybridCosimulation/ModelicaModels"   $(CFLAGS) $(LDFLAGS) -llis -Wl,--kill-at
	mkdir.exe -p ../binaries/win32
	dlltool -d StategraphSample.def --dllname StategraphSample$(DLLEXT) --output-lib StategraphSample.lib --kill-at
	cp StategraphSample$(DLLEXT) StategraphSample.lib StategraphSample_FMU.libs ../binaries/win32/
	cp C:/OpenModelica1.12.0-dev-32bit//bin/libsundials_*.dll ../binaries/win32/
	cp C:/OpenModelica1.12.0-dev-32bit//bin/libopenblas.dll ../binaries/win32/
	cp C:/OpenModelica1.12.0-dev-32bit//bin/libexpat*.dll ../binaries/win32/
	cp C:/OpenModelica1.12.0-dev-32bit//bin/libgfortran*.dll ../binaries/win32/
	cp C:/OpenModelica1.12.0-dev-32bit//bin/libquadmath*.dll ../binaries/win32/
	cp C:/OpenModelica1.12.0-dev-32bit//bin/libwinpthread*.dll ../binaries/win32/
	cp C:/OpenModelica1.12.0-dev-32bit//bin/zlib*.dll ../binaries/win32/
	cp C:/OpenModelica1.12.0-dev-32bit//bin/libszip*.dll ../binaries/win32/
	cp C:/OpenModelica1.12.0-dev-32bit//bin/libhdf5*.dll ../binaries/win32/
	cp C:/OpenModelica1.12.0-dev-32bit//bin/libsystre*.dll ../binaries/win32/
	cp C:/OpenModelica1.12.0-dev-32bit//bin/libtre*.dll ../binaries/win32/
	cp C:/OpenModelica1.12.0-dev-32bit//bin/libintl*.dll ../binaries/win32/
	cp C:/OpenModelica1.12.0-dev-32bit//bin/libiconv*.dll ../binaries/win32/
	cp C:/OpenModelica1.12.0-dev-32bit//bin/libgcc_s_*.dll ../binaries/win32/
	cp C:/OpenModelica1.12.0-dev-32bit//bin/libstdc*.dll ../binaries/win32/
	rm -f StategraphSample.def StategraphSample.o StategraphSample$(DLLEXT) $(OFILES) $(RUNTIMEFILES)
	cd .. && rm -f ../StategraphSample.fmu && zip -r ../StategraphSample.fmu *

