Skip to content

Commit

Permalink
improved the building procedure and added some useful relations
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@1854 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
x02lucpo committed Jul 14, 2005
1 parent cd7cc3b commit 54f85cc
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 16 deletions.
12 changes: 6 additions & 6 deletions Compiler/Interactive.rml
Expand Up @@ -534,7 +534,7 @@ relation evaluate_graphical_api: (InteractiveStmts, InteractiveSymbolTable) =>
=> (resstr,SYMBOLTABLE(newp,s,ic,iv,cf))

rule get_extends_modifier_names(class,ident,p) => resstr
--------------------------------------------
--------------------------------------------
evaluate_graphical_api(
ISTMTS([IEXP(Absyn.CALL(
Absyn.CREF_IDENT("getExtendsModifierNames",_),
Expand Down Expand Up @@ -691,11 +691,11 @@ relation evaluate_graphical_api: (InteractiveStmts, InteractiveSymbolTable) =>
get_top_classnames(p1) => top_names_str
---------------------------------------------------
evaluate_graphical_api(
ISTMTS([IEXP(Absyn.CALL(
Absyn.CREF_IDENT("loadFileInteractive",_),
Absyn.FUNCTIONARGS( [Absyn.STRING(name)] ,[])))],_
),
st as SYMBOLTABLE(p,s,ic,iv,cf)) => (top_names_str,SYMBOLTABLE(newp,s,ic,iv,cf))
ISTMTS([IEXP(Absyn.CALL(
Absyn.CREF_IDENT("loadFileInteractive",_),
Absyn.FUNCTIONARGS( [Absyn.STRING(name)] ,[])))],_
),
st as SYMBOLTABLE(p,s,ic,iv,cf)) => (top_names_str,SYMBOLTABLE(newp,s,ic,iv,cf))



Expand Down
22 changes: 21 additions & 1 deletion Compiler/Util.rml
Expand Up @@ -215,6 +215,8 @@ module Util :
relation write_file_or_error_msg:(string,(*filename*)
string(*the string to be written*)) => ()

relation system_call_with_error_msg:(string,(*command*)
string)(*error_msg to error_buf if fail*) => ()
end

with "System.rml"
Expand Down Expand Up @@ -1518,4 +1520,22 @@ relation write_file_or_error_msg:(string,(*filename*)
--------------------------
write_file_or_error_msg(filename,str)

end
end

(** this relation executes a command with System.system_call
** if System.system_call does not return 0 then the msg is outputed to
** error_buf and the relation fails
**)
relation system_call_with_error_msg:(string,(*command*)
string)(*error_msg to error_buf if fail*) => () =

rule System.system_call(s_call) => 0
------------------------------
system_call_with_error_msg(s_call,_)

rule Print.print_error_buf(e_msg)
------------------------------
system_call_with_error_msg(_,e_msg) => fail

end

15 changes: 7 additions & 8 deletions c_runtime/Makefile
@@ -1,6 +1,6 @@
CC = gcc
FC = g77
AR = ar -ru
AR = ar -ru
CFLAGS = -O2 -Wall -ansi -pedantic -I../mosh/src/
CPPFLAGS = $(CFLAGS)
FFLAGS = -O
Expand Down Expand Up @@ -30,20 +30,19 @@ OBJS = $(FOBJS) boolean_array.o index_spec.o integer_array.o memory_pool.o \
real_array.o string_array.o read_write.o utility.o modelica_string.o
SIMOBJS = $(FOBJS) simulation_runtime.o ../mosh/src/options.o dgesv_aux.o

all : libc_runtime.a libsim.a

all : libc_runtime.a libsim.a libf2c.a

libc_runtime.a : $(OBJS)
cd libf2c; make -f makefile.u
mv libf2c/libf2c.a ./
$(AR) $@ $(OBJS)

libsim.a : $(SIMOBJS)
cd libf2c; make -f makefile.u
mv libf2c/libf2c.a ./
$(AR) $@ $(SIMOBJS)

libf2c.a :
cd libf2c && $(MAKE) -f makefile.u

clean :
cd libf2c; make -f makefile.u clean
cd ./libf2c && $(MAKE) -f makefile.u clean
rm -f libc_runtime.a
rm -f libsim.a
rm -f $(OBJS)
Expand Down
2 changes: 1 addition & 1 deletion c_runtime/libf2c/makefile.vc
Expand Up @@ -167,7 +167,7 @@ w = \
z_sqrt.obj

all: f2c.h math.h signal1.h sysdep1.h vcf2c.lib
copy /Y vcf2c.lib ..\


f2c.h: f2c.h0
copy f2c.h0 f2c.h
Expand Down

0 comments on commit 54f85cc

Please sign in to comment.