#--------------------------- Tool Specifications -------------------------
#
# Modify the following macros to reflect the tools you wish to use for
# compiling and linking your code.
#
CC = /usr/local/MATLAB/R2024a/bin/mex -R2018a
LD = $(CC)
 
MODEL     = TCP_Test
TARGET      = sfun
MODULE_SRCS   = c2_TCP_Test.cpp half_type.cpp
MODEL_SRC  = TCP_Test_sfun.cpp
MODEL_REG = TCP_Test_sfun_registry.cpp
MAKEFILE    = TCP_Test_sfun.mku
MATLAB_ROOT  = /usr/local/MATLAB/R2024a/toolbox/stateflow/stateflow/../../..
BUILDARGS   = 
#------------------------------ Include/Lib Path ------------------------------
 
USER_INCLUDES = -I"/home/judson/Desktop/Pixhawk/MATLAB/TCP_Test" 
AUX_INCLUDES = 
MLSLSF_INCLUDES  = \
    -I"/usr/local/MATLAB/R2024a/extern/include" \
    -I"/usr/local/MATLAB/R2024a/simulink/include" \
    -I"/usr/local/MATLAB/R2024a/simulink/include/sf_runtime" \
    -I"/usr/local/MATLAB/R2024a/stateflow/c/mex/include" \
    -I"/usr/local/MATLAB/R2024a/rtw/c/src" \
    -I"/home/judson/Desktop/Pixhawk/MATLAB/TCP_Test/slprj/_sfprj/TCP_Test/_self/sfun/src" 

THIRD_PARTY_INCLUDES = 

INCLUDE_PATH = $(USER_INCLUDES) $(AUX_INCLUDES) $(MLSLSF_INCLUDES) $(COMPILER_INCLUDES) $(THIRD_PARTY_INCLUDES)
 
#----------------- Compiler and Linker Options --------------------------------
 
# Optimization Options
 
CC_OPTS =  
CPP_REQ_DEFINES = -DMATLAB_MEX_FILE
 
# Uncomment this line to move warning level to W4
# cflags = $(cflags:W3=W4)
CFLAGS = $(CPP_REQ_DEFINES) $(INCLUDE_PATH) CFLAGS="\$$CFLAGS $(CC_OPTS)"
 
LDFLAGS =  
LINKLIBS = 
 
AUXLDFLAGS = 
#----------------------------- Source Files -----------------------------------
 
REQ_SRCS  = $(MODEL_SRC) $(MODEL_REG) $(MODULE_SRCS)

USER_OBJS =

AUX_ABS_OBJS =
THIRD_PARTY_OBJS =

REQ_OBJS = $(REQ_SRCS:.cpp=.o)
REQ_OBJS2 = $(REQ_OBJS:.c=.o)
OBJS = $(REQ_OBJS2) $(USER_OBJS) $(AUX_ABS_OBJS) $(THIRD_PARTY_OBJS)
OBJLIST_FILE = TCP_Test_sfun.mol
SFCLIB = 
AUX_LNK_OBJS = 
USER_LIBS = 
PARLIB = 
  MAPCSF = /usr/local/MATLAB/R2024a/tools/glnxa64/mapcsf
   # RUN_MAPCSF_ON_UNIX is defined only if MAPCSF exists on this platform.
   ifneq ($(wildcard $(MAPCSF)),) # run MAPCSF if it exists on this platform
      RUN_MAPCSF_ON_UNIX =  /usr/local/MATLAB/R2024a/tools/glnxa64/mapcsf $@
   endif
 
#--------------------------------- Rules --------------------------------------
 
MEX_FILE_NAME = $(MODEL)_$(TARGET).mexa64
 
 $(MEX_FILE_NAME): $(MAKEFILE) $(OBJS) $(SFCLIB) $(AUX_LNK_OBJS) $(USER_LIBS)
	@echo ### Linking ...
	$(CC) -silent LDFLAGS="\$$LDFLAGS $(LDFLAGS)" LINKLIBS="\$$LINKLIBS $(AUXLDFLAGS)" -output $(MEX_FILE_NAME) @$(OBJLIST_FILE) $(AUX_LNK_OBJS) $(USER_LIBS) $(SFCLIB) $(PARLIB) $(IPPLIB) $(THIRD_PARTY_LIBS)
	$(RUN_MAPCSF_ON_UNIX)

%.o :    %.c
	$(CC) -c $(CFLAGS) $<

%.o :    %.cpp
	$(CC) -c $(CFLAGS) $<

