Skip to content

Commit

Permalink
- added some more fixes for Makefile
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@10421 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Willi Braun committed Nov 11, 2011
1 parent ba58cf6 commit bd108c9
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 51 deletions.
13 changes: 5 additions & 8 deletions SimulationRuntime/c/Makefile.common
@@ -1,14 +1,16 @@
AR = ar
AR = ar -ru
ANSI= #-ansi
CXXFLAGS := $(CFLAGS) -Wall $(ANSI) $(EXTRA_CFLAGS)
CFLAGS := $(CFLAGS) -Wall $(ANSI) -pedantic $(EXTRA_CFLAGS)
CPPFLAGS = -I. -Iinteractive/ -Imeta/ -I../
FFLAGS = -O -fexceptions
# P.A: before, g77 had -O3 or -O2 but that caused a bug in DDASRT, giving infinite loop.

include Makefile.objs

LIBS = libsim.a libsolver.a libmath-support.a libutil.a libmeta.a libf2c.a libresult.a libModelicaExternalC.a libsendData.a

LIBSPATH= simulation/libsim.a simulation/math-support/libmath-support.a simulation/solver/libsolver.a simulation/results/libresult.a meta/libmeta.a ModelicaExternalC/libModelicaExternalC.a simulation/libf2c/libf2c.a util/libutil.a sendData/release/libsendData.a
LIBSPATH= simulation/libsim.a simulation/math-support/libmath-support.a simulation/solver/libsolver.a simulation/results/libresult.a meta/libmeta.a util/libutil.a


.PHONY : libsim.a libmath-support.a libsolver.a libutil.a libmeta.a libf2c.a libresult.a libModelicaExternalC.a libsendData.a clean install
Expand All @@ -17,14 +19,9 @@ all : install


libSimulationCRuntime.a: $(LIBS) $(LIBSPATH)
$(AR) rsc $@ *.o
rm -f *.o
$(AR) $@ $(ALL_OBJS)
ranlib $@

$(LIBSPATH): $(LIBS)
$(AR) -x $@


libmath-support.a:
$(MAKE) -C simulation/math-support -f ${LIBMAKEFILE}

Expand Down
6 changes: 3 additions & 3 deletions SimulationRuntime/c/ModelicaExternalC/Makefile.in
@@ -1,16 +1,16 @@
CC = @CC@
CXX = @CXX@
CFLAGS := @CFLAGS@
CPPFLAGS := @CPPFLAGS@ -I.. -Dlinux -Dstatic=
OBJS = ModelicaInternal.o ModelicaStrings.o ModelicaTablesImpl.o
CPPFLAGS := @CPPFLAGS@ -I.. -Dlinux -Dstatic= -I../util/
OBJS = ModelicaInternal.o ModelicaStrings.o ModelicaTablesImpl.o ModelicaUtilities.o tables.o
AR = ar -ru

all: libModelicaExternalC.a

tables.o: tables.cpp tables.h
$(CXX) $(CFLAGS) -o $@ -c $<

libModelicaExternalC.a : $(OBJS) tables.o
libModelicaExternalC.a : $(OBJS)
$(AR) $@ $(OBJS)
ranlib $@

Expand Down
14 changes: 1 addition & 13 deletions SimulationRuntime/c/meta/Makefile.in
Expand Up @@ -5,19 +5,7 @@ CPPFLAGS := @CPPFLAGS@ -Wall $(ANSI) $(EXTRA_CFLAGS) -I. -I.. -I../util/
AR = ar -ru
FFLAGS = -O -fexceptions

META_OBJS = \
meta_modelica.o \
meta_modelica_builtin.o \
meta_modelica_real.o \
meta_modelica_string_lit.o \
meta_modelica_catch.o \
meta_modelica_gc.o \
meta_modelica_gc_list.o \
meta_modelica_gc_stack.o \
meta_modelica_gc_roots.o \
meta_modelica_gc_pages.o \
meta_modelica_gc_stats.o \
meta_modelica_gc_settings.o
include ../Makefile.objs

META_HFILES = \
rml_compatibility.h \
Expand Down
9 changes: 4 additions & 5 deletions SimulationRuntime/c/simulation/Makefile.in
Expand Up @@ -11,8 +11,7 @@ CPPFLAGS := @CPPFLAGS@ -Wall $(ANSI) $(EXTRA_CFLAGS) -I. -I.. -I../util -I../lin
AR = ar -ru
FFLAGS = -O -fexceptions

OBJS = options.o simulation_input_xml.o simulation_modelinfo.o simulation_runtime.o simulation_varinfo.o ../linearization/linearize.o

include ../Makefile.objs

HFILES = \
simulation_input_xml.h \
Expand All @@ -28,13 +27,13 @@ LIBS = libsim.a

all : libsim.a

libsim.a : $(OBJS) $(HFILES)
$(AR) $@ $(OBJS)
libsim.a : $(SIM_OBJS) $(HFILES)
$(AR) $@ $(SIM_OBJS)
ranlib $@

clean :
rm -f libsim.a
rm -f $(OBJS)
rm -f $(SIM_OBJS)

Makefile: Makefile.in
cd ../../..; ./config.status
Expand Down
11 changes: 4 additions & 7 deletions SimulationRuntime/c/simulation/math-support/Makefile.in
Expand Up @@ -11,10 +11,7 @@ CPPFLAGS := @CPPFLAGS@ -Wall $(ANSI) $(EXTRA_CFLAGS) -I. -I.. -I../../ -I../solv
AR = ar -ru
FFLAGS = -O -fexceptions

OBJS = bigden.o enorm.o hybrd1.o nelmead.o qform.o r1updt.o \
biglag.o dogleg.o fdjac1.o hybrj.o newuoa.o qrfac.o trsapp.o \
dpmpar.o hybrd.o lsame.o newuob.o r1mpyq.o update.o \
simulation_events.o ringbuffer.o simulation_delay.o simulation_init.o dgesv_aux.o list.o \
include ../../Makefile.objs

HFILES = blaswrap.h \
matrix.h \
Expand All @@ -31,13 +28,13 @@ LIBS = libmath-support.a

all : libmath-support.a

libmath-support.a : $(OBJS) $(HFILES)
$(AR) $@ $(OBJS)
libmath-support.a : $(MATH_OBJS) $(HFILES)
$(AR) $@ $(MATH_OBJS)
ranlib $@

clean :
rm -f libmath-support.a
rm -f $(OBJS)
rm -f $(MATH_OBJS)

Makefile: Makefile.in
cd ../../../../; ./config.status
Expand Down
10 changes: 5 additions & 5 deletions SimulationRuntime/c/simulation/results/Makefile.in
Expand Up @@ -11,8 +11,8 @@ CPPFLAGS := @CPPFLAGS@ -Wall $(ANSI) $(EXTRA_CFLAGS) -I. -I.. -I../../ -I../solv
AR = ar -ru
FFLAGS = -O -fexceptions

OBJS = \
read_csv.o read_matlab4.o simulation_result_csv.o simulation_result_mat.o simulation_result_plt.o

include ../../Makefile.objs

HFILES = \
read_csv.h \
Expand All @@ -30,13 +30,13 @@ LIBS = libresult.a

all : libresult.a

libresult.a : $(OBJS) $(HFILES)
$(AR) $@ $(OBJS)
libresult.a : $(RESULTS_OBJS) $(HFILES)
$(AR) $@ $(RESULS_OBJS)
ranlib $@

clean :
rm -f libresult.a
rm -f $(OBJS)
rm -f $(RESULTS_OBJS)

Makefile: Makefile.in
cd ../../../../; ./config.status
Expand Down
6 changes: 3 additions & 3 deletions SimulationRuntime/c/simulation/simulation_runtime.cpp
Expand Up @@ -182,9 +182,10 @@ void setTermMsg(const char *msg)
free(TermMsg);
}
std::string s(msg);
TermMsg = (char*)calloc(s.length(),sizeof(char));
for (size_t i=0;i<s.length();i++)
TermMsg = (char*) calloc(s.length()+1,sizeof(char));
for (size_t i=0;i<s.length();i++){
TermMsg[i] = s[i];
}
}

static void deInitializeDataStruc2(DATA *data)
Expand Down Expand Up @@ -659,7 +660,6 @@ startNonInteractiveSimulation(int argc, char**argv)
}

deinitDelay();
deInitializeDataStruc2(globalData);

return retVal;
}
Expand Down
11 changes: 4 additions & 7 deletions SimulationRuntime/c/util/Makefile.in
Expand Up @@ -5,10 +5,7 @@ CPPFLAGS := @CPPFLAGS@ -Wall $(ANSI) $(EXTRA_CFLAGS) -I. -I.. -I../meta
AR = ar -ru
FFLAGS = -O -fexceptions

OBJS = boolean_array.o index_spec.o integer_array.o memory_pool.o \
base_array.o real_array.o string_array.o utility.o \
modelica_string.o division.o\
java_interface.o rtclock.o
include ../Makefile.objs

HFILES = \
base_array.h \
Expand All @@ -35,13 +32,13 @@ LIBS = libutil.a

all : libutil.a

libutil.a : $(OBJS) $(HFILES)
$(AR) $@ $(OBJS)
libutil.a : $(UTIL_OBJS) $(HFILES)
$(AR) $@ $(UTIL_OBJS)
ranlib $@

clean :
rm -f libutils.a
rm -f $(OBJS)
rm -f $(UTIL_OBJS)

Makefile: Makefile.in
cd ../../../; ./config.status

0 comments on commit bd108c9

Please sign in to comment.