File: Makefile

package info (click to toggle)
scilab 2.6-4
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 54,632 kB
  • ctags: 40,267
  • sloc: ansic: 267,851; fortran: 166,549; sh: 10,005; makefile: 4,119; tcl: 1,070; cpp: 233; csh: 143; asm: 135; perl: 130; java: 39
file content (114 lines) | stat: -rw-r--r-- 3,720 bytes parent folder | download
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
SHELL = /bin/sh

SCIDIR = ../..

LIBRARY = lapackscilab.a

#OTHERLIBS = mylib.a pipo.o
OTHERLIBS = 

#########################################################################
#    To each .o interface (C or Fortran) associate one scilab function
#    
CINTERFACES = intdgemm.o intdlassq.o intdgetrf.o intdsyev.o intdgeesx.o intzgemm.o intdgesvd.o #intzgeesx.o

CFUNCTIONS = dgemm dlassq dgetrf  dsyev dgeesx zgemm dgesvd #zgeesx

OTHERCOBJS = 

FORTRANINTERFACES = intfdgemm.o intdgebal.o intdgebak.o intdgels.o intdgeqrf.o 

FFUNCTIONS = fdgemm dgebal dgebak dgels dgeqrf 

OTHERFOBJS = zgemm.o
################ do not edit below this line ############################

GATEWAY = $(LIBRARY:.a=)

STARTUP = $(LIBRARY:.a=)

include $(SCIDIR)/Makefile.incl

CFLAGS = $(CC_OPTIONS) $(CC_PICFLAGS) -I$(SCIDIR)/routines
FFLAGS = $(FC_OPTIONS) $(FC_PICFLAGS) -I$(SCIDIR)/routines

FUNCTIONS = $(CFUNCTIONS) $(FFUNCTIONS)

OBJSF = $(FORTRANINTERFACES) $(OTHERFOBJS)

OBJSC = $(CINTERFACES) $(OTHERCOBJS)

all:: all_nomessage message 

all_nomessage :: $(LIBRARY) $(GATEWAY)_gateway.c $(GATEWAY)_gateway.o $(STARTUP).sce 

include $(SCIDIR)/routines/Make.lib

$(GATEWAY)_gateway.c: Makefile 
	@echo "-- Generating the C function $(GATEWAY)_gateway.c";
	@echo "#include \"mex.h\" " > $(GATEWAY)_gateway.c;
	@echo " " >> $(GATEWAY)_gateway.c;
	@echo "extern Gatefunc %s;\n" > format;
	@echo $(CINTERFACES:.o=) >> args;
	@echo $(GATEWAY)_gateway.c > file;
	@$(SCIDIR)/macros/Tomake Xformat Xargs Xfile;
	@$(RM) format args file;
	@echo "extern Gatefunc C2F(%s);\n" > format;
	@echo $(FORTRANINTERFACES:.o=) >> args;
	@echo $(GATEWAY)_gateway.c > file;
	@$(SCIDIR)/macros/Tomake Xformat Xargs Xfile;
	@$(RM) format args file;
	@echo " " >> $(GATEWAY)_gateway.c;
	@echo "static GenericTable Tab[]={"  >> $(GATEWAY)_gateway.c;
	@echo "{(Myinterfun)sci_gateway, %s,\"error msg\"},\n" > format;
	@echo $(CINTERFACES:.o=) > args;
	@echo $(GATEWAY)_gateway.c > file;
	@$(SCIDIR)/macros/Tomake  Xformat Xargs Xfile;
	@$(RM) format args file;
	@echo "{(Myinterfun)sci_gateway, C2F(%s),\"error msg\"},\n" > format;
	@echo $(FORTRANINTERFACES:.o=) > args;
	@echo $(GATEWAY)_gateway.c > file;
	@$(SCIDIR)/macros/Tomake  Xformat Xargs Xfile;
	@$(RM) format args file;
	@echo "	 };" >> $(GATEWAY)_gateway.c;
	@echo " " >> $(GATEWAY)_gateway.c;
	@echo "int C2F($(GATEWAY)_gateway)()" >> $(GATEWAY)_gateway.c;
	@echo "{  Rhs = Max(0, Rhs);" >> $(GATEWAY)_gateway.c;
	@echo "(*(Tab[Fin-1].f))(Tab[Fin-1].name,Tab[Fin-1].F);" >>  $(GATEWAY)_gateway.c;
	@echo "  return 0;" >> $(GATEWAY)_gateway.c;
	@echo "}" >>  $(GATEWAY)_gateway.c;
	@echo " " >> $(GATEWAY)_gateway.c;


$(STARTUP).sce: Makefile 
	@echo "-- Generating the Scilab script $(STARTUP).sce";
	@echo "scilab_functions =[..." > $(STARTUP).sce;
	@echo "\"%s\";\n" > format;
	@echo $(FUNCTIONS) > args;
	@echo $(STARTUP).sce > file; 
	@$(SCIDIR)/macros/Tomake Xformat Xargs Xfile;
	@$(RM) format args file;
	@echo "           ];" >> $(STARTUP).sce;
	@echo "auxiliary=\"$(OTHERLIBS)\";"  >> $(STARTUP).sce;
	@echo "files=G_make([\"$(GATEWAY)_gateway.o\",\"$(LIBRARY)\", auxiliary],\"void(Win)\");"  >>$(STARTUP).sce;
	@echo "addinter(files,\"$(GATEWAY)_gateway\",scilab_functions);" >> $(STARTUP).sce;

message:
	@echo "------------------------------------------";
	@echo "To load $(FUNCTIONS)";
	@echo "        functions, at Scilab prompt, enter:";
	@echo "-->exec $(STARTUP).sce";
	@echo "------------------------------------------";

clean	::
	@$(RM) *.o *~ so_locations
	@$(RM) $(GATEWAY)_gateway.c $(STARTUP).sce
	@$(RM) *.dia

distclean	:: clean

tests	: $(GATEWAY).dia

$(GATEWAY).dia	: $(GATEWAY).tst  all_nomessage 
	@$(SCIDIR)/util/scidem $(SCIDIR) $(GATEWAY).tst $(GATEWAY).dia