Skip to content

Commit

Permalink
- Added Compiler/Makefile.compiler_subdirs.common
Browse files Browse the repository at this point in the history
  - This is a file common for all of omc_release,debug and profiler
  - It is also common for proper Unix and OMDev
- Fixed a bug where the absyn_builder,modpar or runtime folders could fail, but compilation would still continue


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@5473 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed May 7, 2010
1 parent f6c0ac1 commit 18c24f5
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 199 deletions.
2 changes: 0 additions & 2 deletions Compiler/Makefile.common
Expand Up @@ -9,10 +9,8 @@

ifdef USE_CORBA
CORBAOBJ = $(srcdir)/runtime/corbaimpl.o $(srcdir)/runtime/omc_communication_impl.o $(srcdir)/runtime/omc_communication.o
CORBALIB =
else
CORBAOBJ = $(srcdir)/runtime/corbaimpl_stub.o
CORBALIB =
endif

AST = $(srcdir)/absyn_builder/absyn_builder.a
Expand Down
65 changes: 65 additions & 0 deletions Compiler/Makefile.compiler_subdirs.common
@@ -0,0 +1,65 @@
#
# A common Makefile for omc_release, omc_debug, omc_profiler
# Should be used for both OMDev and Linux
#

include $(srcdir)/Makefile.common

all : .testvariables $(ALLMO) $(SRCSIGX)
# Updated dependencies; reload make and compile the target
$(MAKE) -f $(MAKETARGET) $(PROG)

SUBDIRS = $(srcdir)/runtime $(srcdir)/absyn_builder $(srcdir)/modpar
SRCHSRCDIR = $(SRCH:%.h=$(srcdir)/%.h)

.SUFFIXES: .o .mo .h .c
.PHONY: all vctarget absyn_subdir clean reallyclean $(SUBDIRS)

$(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 $(RML) $<
@touch $@

vctarget: $(SRCC) absyn_subdir

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

$(srcdir)/runtime: $(SRCHSRCDIR)
$(MAKE) -C $@ -f $(MAKETARGET)
$(srcdir)/absyn_builder: $(SRCHSRCDIR)
$(MAKE) -C $@ -f $(MAKETARGET)
$(srcdir)/modpar: $(SRCHSRCDIR)
$(MAKE) -C $@ -f $(MAKETARGET)

clean:
for d in $(SUBDIRS); do \
(cd $$d && $(MAKE) -f $(MAKETARGET) 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
3 changes: 0 additions & 3 deletions Compiler/Makefile.in
Expand Up @@ -29,9 +29,6 @@ RMLINC = -I$(RMLHOME)/include/plain
USE_CORBA = @USE_CORBA@
CORBAHOME = @CORBAHOME@

#LDFLAGS = -L$(RMLHOME)/lib/plain $(ANTLR_LIBP) -lrml_g -lm -lantlr $(LIBSOCKET) $(CORBALIB) -lm -lpthread -lreadline
#LDFLAGS = -L$(RMLHOME)/lib/plain $(ANTLR_LIBP) -lrml -lm -lantlr $(LIBSOCKET) $(CORBALIB) -lm -lpthread

include Makefile.common

PROG = omc
Expand Down
68 changes: 6 additions & 62 deletions Compiler/omc_debug/Makefile.in
@@ -1,8 +1,6 @@
#
# Makefile for omc
#
# David Kågedal <x97davka@ida.liu.se>
#
# $Id$
#

Expand Down Expand Up @@ -42,64 +40,10 @@ RMLC = @rmlc_bin@ -g -Wc,-O3 #-Wr,-East,-Ecps,-Efol
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 $(RML) $<
@touch $@

vctarget: $(SRCC) absyn_subdir

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

$(PROG): $(SRCO) subdirs $(top_builddir)/c_runtime/sendData/*.cpp
g++ -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

MAKETARGET = Makefile
include $(srcdir)/Makefile.compiler_subdirs.common
.testvariables:
# You're using the proper Unix Makefile. Thanks for making my life easier.

## dependencies
include $(srcdir)/.depend
$(PROG): $(SRCO) $(SUBDIRS) $(top_builddir)/c_runtime/sendData/*.cpp
g++ $(CFLAGS) -o $(PROG)$(EXEEXT) $(SRCO) $(AST) $(RTOBJ) $(LDFLAGS) $(PLTPKGFLAGS)
74 changes: 8 additions & 66 deletions Compiler/omc_profiler/Makefile.in
@@ -1,8 +1,6 @@
#
# Makefile for omc
#
# David Kågedal <x97davka@ida.liu.se>
#
# $Id$
#

Expand All @@ -13,7 +11,7 @@ LIBLPSOLVE55 = @LIBLPSOLVE55@

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

Expand All @@ -25,10 +23,8 @@ EXEEXT = @EXEEXT@
srcdir = ..
top_builddir = ../..

include $(srcdir)/Makefile.common

ifdef USE_CORBA
CORBALIBS=$CORBALIBS$
CORBALIBS=@CORBALIBS@
else
CORBALIBS=
endif
Expand All @@ -41,64 +37,10 @@ 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 $(RML) $<
@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

MAKETARGET = Makefile
include $(srcdir)/Makefile.compiler_subdirs.common
.testvariables:
# You're using the proper Unix Makefile. Thanks for making my life easier.

## dependencies
include $(srcdir)/.depend
$(PROG): $(SRCO) $(SUBDIRS) $(top_builddir)/c_runtime/sendData/*.cpp
g++ $(CFLAGS) -o $(PROG)$(EXEEXT) $(SRCO) $(AST) $(RTOBJ) $(LDFLAGS) $(PLTPKGFLAGS)
73 changes: 7 additions & 66 deletions Compiler/omc_release/Makefile.in
@@ -1,8 +1,6 @@
#
# Makefile for omc
#
# David Kågedal <x97davka@ida.liu.se>
#
# $Id$
#

Expand All @@ -15,15 +13,14 @@ USE_CORBA = @USE_CORBA@

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

EXEEXT = @EXEEXT@

srcdir = ..
top_builddir = ../..
include $(srcdir)/Makefile.common

ifdef USE_CORBA
CORBALIBS=@CORBALIBS@
Expand All @@ -39,66 +36,10 @@ RMLC = @rmlc_bin@
RML = $(RMLHOME)/bin/rml
RMLCFLAGS = -Wr,-ftrace

MAKETARGET = Makefile
include $(srcdir)/Makefile.compiler_subdirs.common
.testvariables:
# You're using the proper Unix Makefile. Thanks for making my life easier.


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 $(RML) $<
@touch $@

vctarget: $(SRCC) absyn_subdir

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

$(PROG): $(SRCO) subdirs $(top_builddir)/c_runtime/sendData/*.cpp
g++ -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
$(PROG): $(SRCO) $(SUBDIRS) $(top_builddir)/c_runtime/sendData/*.cpp
g++ $(CFLAGS) -o $(PROG)$(EXEEXT) $(SRCO) $(AST) $(RTOBJ) $(LDFLAGS) $(PLTPKGFLAGS)

0 comments on commit 18c24f5

Please sign in to comment.