Skip to content

Commit

Permalink
- Added a makefile target for building omc with RML profiling informa…
Browse files Browse the repository at this point in the history
…tion

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@5192 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Mar 24, 2010
1 parent bae366c commit c3d58ee
Show file tree
Hide file tree
Showing 4 changed files with 2,248 additions and 2,729 deletions.
8 changes: 8 additions & 0 deletions Compiler/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ include Makefile.common

PROG = omc
PROGD = omcd
PROGP = omcp

SCRIPT_FILES = Compile Compile.bat doPlot doPlot.bat doPlot.Cygwin
DOC_FILES = omc_helptext.txt omc_interactive_api.txt
Expand All @@ -64,6 +65,10 @@ $(PROGD): omc_debug
echo Copying $(PROGD)$(EXEEXT) into $(builddir_bin)
cp omc_debug/$(PROGD)$(EXEEXT) $(builddir_bin)/

$(PROGP): omc_profiler
echo Copying $(PROGP)$(EXEEXT) into $(builddir_bin)
cp omc_profiler/$(PROGP)$(EXEEXT) $(builddir_bin)/

install_doc:
for x in $(DOC_FILES); do \
echo Copying $$x into $(builddir_doc); \
Expand Down Expand Up @@ -97,6 +102,9 @@ omc_release: depend
omc_debug: depend
(cd omc_debug && $(MAKE))

omc_profiler: depend
(cd omc_profiler && $(MAKE))

#vctarget:
# @(cd omc_debug ; $(MAKE) vctarget)

Expand Down
118 changes: 118 additions & 0 deletions Compiler/omc_profiler/Makefile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
#
# Makefile for omc
#
# David Kågedal <x97davka@ida.liu.se>
#
# $Id$
#

ANTLR_HOME = @antlrhome@

ANTLR_INCP = -I@antlrinc@
ANTLR_LIBP = -L@antlrlib@
LIBSOCKET = @LIBSOCKET@

SHELL = /bin/sh
CC = gcc
CFLAGS = $(USE_CORBA)
RMLHOME = @rmlhome@
RMLINC = -I$(RMLHOME)/include/plain


USE_CORBA = @USE_CORBA@
CORBAHOME = @CORBAHOME@

EXEEXT = @EXEEXT@

srcdir = ..
top_builddir = ../..
builddir_bin=$(top_builddir)/build/bin
builddir_lib=$(top_builddir)/build/lib
builddir_inc=$(top_builddir)/build/include
builddir_doc=$(top_builddir)/build/doc


include $(srcdir)/Makefile.common

CORBALIB=`mico-config --libs`

ifdef USE_CORBA
CORBALIBS=$(CORBALIB)
else
CORBALIBS=
endif

LDFLAGS = -lm -L$(RMLHOME)/lib/plain -lrml_p $(ANTLR_LIBP) -lantlr $(LIBSOCKET) $(CORBALIBS) -ldl -llpsolve55

ifdef QTHOME
PLTPKGFLAGS = -L../../build/lib -lsendData -L$(QTHOME)/lib -lQtNetwork -lQtCore -lQtGui
else
PLTPKGFLAGS = -L../../build/lib -lsendData
endif

PROG = omcp
RMLC = @rmlc_bin@ -p
RML = $(RMLHOME)/bin/rml
RMLCFLAGS = -Wr,-ftrace

SUBDIRS = $(srcdir)/runtime $(srcdir)/absyn_builder $(srcdir)/modpar

all : $(ALLMO) $(SRCSIGX)
# Updated dependencies; reload make and compile the target
$(MAKE) $(PROG)

.SUFFIXES:
.SUFFIXES: .o .mo .h .c
.PHONY: all vctarget absyn_subdir clean reallyclean

SRCHSRCDIR = $(SRCH:%.h=$(srcdir)/%.h)


$(ALLMO): %.mo : $(srcdir)/%.mo
cp $< $@

$(SRCO): %.o : %.c %.h
$(RMLC) $(RMLCFLAGS) -c $<

%.c %.h : %.mo
$(RMLC) $(RMLCFLAGS) +C $<

%.h : %.c

$(SRCHSRCDIR) : $(srcdir)/%.h : %.h
cp $< $@

$(SRCSIGX): %.sigx : %.mo
$(srcdir)/rml2sig/rmldep-new.sh $<
@touch $@

vctarget: $(SRCC) absyn_subdir

absyn_subdir:
(cd $(srcdir)/absyn_builder && $(MAKE) vctarget)

$(PROG): $(SRCO) subdirs $(top_builddir)/c_runtime/sendData/*.cpp
g++ -pg -O3 -o $(PROG)$(EXEEXT) $(SRCO) $(AST) $(RTOBJ) $(LDFLAGS) $(PLTPKGFLAGS)

subdirs: $(SRCHSRCDIR)
for dir in $(SUBDIRS); do $(MAKE) -C $$dir; done;

clean:
for d in $(SUBDIRS); do \
(cd $$d && $(MAKE) clean) \
done
(cd $(srcdir) && $(RM) $(SRCH))
$(RM) -f $(SRCO) $(SRCC) $(SRCH) $(PROG)$(EXEEXT) *~ $(ALLMO:.mo=.srz) $(ALLMO:.mo=.sig) $(ALLMO:.mo=.sigx)

reallyclean: clean
$(RM) -f $(ALLMO) $(ALLMO:.mo=.sig) $(ALLMO:.mo=.sigx) $(ALLMO:.mo=.srz) $(PROG)$(EXEEXT)

# don't remove these files after intermediate build steps
.PRECIOUS: Makefile $(ALLMO)

Makefile: Makefile.in
$(top_builddir)/config.status Makefile


## dependencies
include $(srcdir)/.depend

0 comments on commit c3d58ee

Please sign in to comment.