1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
|
SCIDIR =../../..
SCIDIR1 =..\..\..
#LIBRARY = name of the dll (without .dll postfix)..
LIBRARY=lapackscilab
#########################################################################
# To each .obj interface (C or Fortran) associate one scilab function
#
CINTERFACES = intdgemm.obj intdlassq.obj intdgetrf.obj intdsyev.obj intdgeesx.obj intzgemm.obj intdgesvd.obj #intzgeesx.obj
CFUNCTIONS = dgemm dlassq dgetrf dsyev dgeesx zgemm dgesvd #zgeesx
OTHERCOBJS =
FORTRANINTERFACES = intfdgemm.obj inttestdgebal.obj intdgebak.obj intdgels.obj intdgeqrf.obj
FFUNCTIONS = fdgemm xxdgebal dgebak dgels dgeqrf
OTHERFOBJS =
################ do not edit below this line #############################
DUMPEXTS="$(SCIDIR1)\bin\dumpexts"
SCIIMPLIB="$(SCIDIR1)\bin\LibScilab.lib"
!include ..\..\dynamic_link\src\scripts\Makefile.incl.mak
FFLAGS = $(FC_OPTIONS) -DFORDLL -I"$(SCIDIR1)\routines"
CFLAGS = $(CC_OPTIONS) -DFORDLL -I"$(SCIDIR)/routines"
FUNCTIONS = $(CFUNCTIONS) $(FFUNCTIONS)
OBJSF = $(FORTRANINTERFACES) $(OTHERFOBJS)
OBJSC = $(CINTERFACES) $(OTHERCOBJS)
all:: $(OTHEROBJECTS) $(LIBRARY)_gateway.c $(LIBRARY)_gateway.obj $(LIBRARY).dll $(LIBRARY).sce message
OBJS = $(OBJSF) $(OBJSC) $(OTHEROBJECTS) $(LIBRARY)_gateway.obj
CLEAROLD:
@$(RM) $(LIBRARY).sce
@$(RM) $(LIBRARY)_gateway.c
$(LIBRARY)_gateway.c:
@echo "-- Generating the C function $(LIBRARY)_gateway.c";
@echo #include "mex.h" > $(LIBRARY)_gateway.c
@echo /* */ >> $(LIBRARY)_gateway.c
@"$(SCIDIR1)\tools\tomake\Tomake" @<< @<< @<<
extern Gatefunc %s;\n
<<
$(CINTERFACES:.obj=)
<<
$(LIBRARY)_gateway.c
<<
@"$(SCIDIR1)\tools\tomake\Tomake" @<< @<< @<<
extern Gatefunc C2F(%s);\n
<<
$(FORTRANINTERFACES:.obj=)
<<
$(LIBRARY)_gateway.c
<<
@echo /* */ >> $(LIBRARY)_gateway.c
@echo static GenericTable Tab[]={ >> $(LIBRARY)_gateway.c
@"$(SCIDIR1)\tools\tomake\Tomake" @<< @<< @<<
{(Myinterfun)sci_gateway, %s,"error_msg"},\n
<<
$(CINTERFACES:.obj=)
<<
$(LIBRARY)_gateway.c
<<
@"$(SCIDIR1)\tools\tomake\Tomake" @<< @<< @<<
{(Myinterfun)sci_gateway, C2F(%s),"error_msg"},\n
<<
$(FORTRANINTERFACES:.obj=)
<<
$(LIBRARY)_gateway.c
<<
@echo }; >> $(LIBRARY)_gateway.c
@echo /* */ >> $(LIBRARY)_gateway.c
@echo int C2F($(LIBRARY)_gateway)() >> $(LIBRARY)_gateway.c
@echo { Rhs = Max(0, Rhs); >> $(LIBRARY)_gateway.c
@echo (*(Tab[Fin-1].f))(Tab[Fin-1].name,Tab[Fin-1].F); >> $(LIBRARY)_gateway.c
@echo return 0; >> $(LIBRARY)_gateway.c
@echo } >> $(LIBRARY)_gateway.c
@echo /* */ >> $(LIBRARY)_gateway.c
$(LIBRARY).sce:
@echo -- Generating the Scilab script $(LIBRARY).sce;
@echo scilab_functions =[... > $(LIBRARY).sce
@"$(SCIDIR1)\tools\tomake\Tomake" @<< @<< @<<
"%s";\n
<<
$(FUNCTIONS)
<<
$(LIBRARY).sce
<<
@echo ]; >> $(LIBRARY).sce
@echo files=G_make("void(Unix)","$(LIBRARY).dll"); >> $(LIBRARY).sce
@echo addinter(files,"$(LIBRARY)_gateway",scilab_functions); >> $(LIBRARY).sce
message:
@echo ------------------------------------------
@echo - To load function(s)
@echo $(FUNCTIONS),
@echo - at Scilab prompt, enter:
@echo "-->exec $(LIBRARY).sce;"
@echo ------------------------------------------
clean ::
@$(RM) *.dia
@$(RM) *.obj
@$(RM) $(LIBRARY).sce
@$(RM) $(LIBRARY)_gateway.c
@$(RM) $(LIBRARY).lib
@$(RM) *.dll
@$(RM) *.def
@$(RM) *.lib
@$(RM) *.exp
@$(RM) *.pdb
distclean:: clean
tests::
@"$(SCIDIR1)/bin/scilex.exe" -nwni -nb -e scitest('lapackscilab.tst',%t);quit;
$(LIBRARY).dll: $(OBJS)
@echo Creation of dll $(LIBRARY).dll and import lib from ...
@echo $(OBJS)
@$(DUMPEXTS) -o "$*.def" "$*.dll" $**
@echo $(LINKER) $(LINKER_FLAGS) $(OBJS) $(SCIIMPLIB) $(SCILAB_LIBS) /nologo /dll /out:"$*.dll" /implib:"$*.lib" /def:"$*.def"
@$(LINKER) $(LINKER_FLAGS) $(OBJS) $(SCIIMPLIB) $(SCILAB_LIBS) /nologo /dll /out:"$*.dll" /implib:"$*.lib" /def:"$*.def"
|