# Template makefile from $PTII/ptolemy/cg/kernel/generic/program/procedural/c/jnimakefile.in # $Id: jnimakefile.in 68858 2014-04-13 06:57:18Z cxh $ # The CCodeGenerator class subsitutes strings like "@modelName@" with # the value of parameters and writes the results in the directory # where the source code is created. # To compile, run make -f @modelName@.mk MODELNAME = @modelName@ # The include files and libraries are determined in CCodeGenerator PTCGINCLUDES = @PTCGIncludes@ PTCGLIBRARIES = @PTCGLibraries@ PTCG_CFILES = @PTCG_CFILES@ # Flag to use with JNI under Cygwin (-mno-cygwin) PTJNI_NO_CYGWIN = @PTJNI_NO_CYGWIN@ # GCC shared flag. For Mac OS X, -dynamiclib. For all others, -shared PTJNI_GCC_SHARED_FLAG = @PTJNI_GCC_SHARED_FLAG@ # JNI shared library linker flag, under Solaris this would be -fPIC. PTJNI_SHAREDLIBRARY_LDFLAG = @PTJNI_SHAREDLIBRARY_LDFLAG@ # JNI shared library prefix, under Solaris this would be lib PTJNI_SHAREDLIBRARY_PREFIX = @PTJNI_SHAREDLIBRARY_PREFIX@ # JNI shared library suffix, under Windows this would be dll. PTJNI_SHAREDLIBRARY_SUFFIX = @PTJNI_SHAREDLIBRARY_SUFFIX@ # The name of the library we are generating PTLIB = $(PTJNI_SHAREDLIBRARY_PREFIX)$(MODELNAME).$(PTJNI_SHAREDLIBRARY_SUFFIX) # Need -stdc99 for for loops. PTCFLAGS = -D__int64="long long" -Wall -std=c99 -ggdb # We need -lm so we can get floor() for ftoi() $(PTLIB): $(PTCG_CFILES) @PTCGCompiler@ -DPTJNI $(PTCFLAGS) $(PTJNI_NO_CYGWIN) $(PTCGINCLUDES) $(PTJNI_SHAREDLIBRARY_LDFLAG) $(PTJNI_GCC_SHARED_FLAG) -o $(PTLIB) $(PTCG_CFILES) -lm $(PTCGLIBRARIES) # Each subdirectory must supply rules for building sources it contributes ./build/%.o: ./src/%.c gcc $(WARNING_CC_FLAGS) $(CC_FLAGS) $(USER_CC_FLAGS) $(DEBUG) -c -o "$@" "$<"