Skip to content

Commit

Permalink
- Added trunk/Makefile.common, and restructured Makefile and Makefile…
Browse files Browse the repository at this point in the history
….omdev.mingw

- Fixed lots of weird install targets for files
  - Moved commands.xml, etc files from bin to share/omnotebook, share/omshell.
  - Moved ptplot.jar from bin to share/omc/java.
  - Moved ptplot_license.txt from bin to share/
  - Moved omc_helptext.txt from bin to share/doc/omc
  - Added antlr_license.txt
  - Moved OPENMODELICA/include to OPENMODELICAHOME/omc/include
    - This way we won't override system libs/includes if we install to /usr
    - Did the same for /lib
  - Left to do: Move scripts from bin to usr/share/omc/scripts
- Updated OMNotebook and OMShell to reflect new paths of xml files.
- Updated doPlot commands to reflect the new location of ptplot.jar


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@5368 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Apr 23, 2010
1 parent c80d284 commit 901913c
Show file tree
Hide file tree
Showing 19 changed files with 224 additions and 247 deletions.
6 changes: 3 additions & 3 deletions Compiler/CevalScript.mo
Expand Up @@ -2009,7 +2009,7 @@ algorithm
omhome_1 = System.trim(omhome, "\"");
cit = winCitation();
pd = System.pathDelimiter();
filename = Util.stringAppendList({omhome_1,pd,"bin",pd,"omc_helptext.txt"});
filename = Util.stringAppendList({omhome_1,pd,"share",pd,"doc",pd,"omc",pd,"omc_helptext.txt"});
print(filename);
str = System.readFile(filename);
then
Expand Down Expand Up @@ -4044,8 +4044,8 @@ algorithm
"LINK=",linker,"\n",
"EXEEXT=",exeext,"\n",
"DLLEXT=",dllext,"\n",
"CFLAGS= -I\"",omhome,"/include\" ", cflags ,"\n",
"LDFLAGS= -L\"",omhome,"/lib\" ", ldflags ,"\n",
"CFLAGS= -I\"",omhome,"/include/omc\" ", cflags ,"\n",
"LDFLAGS= -L\"",omhome,"/lib/omc\" ", ldflags ,"\n",
"ifndef SENDDATALIBS\n",
" SENDDATALIBS=",senddatalibs,"\n",
"endif\n"
Expand Down
4 changes: 2 additions & 2 deletions Compiler/CevalScript_stub.mo
Expand Up @@ -686,8 +686,8 @@ algorithm
"LINK=",linker,"\n",
"EXEEXT=",exeext,"\n",
"DLLEXT=",dllext,"\n",
"CFLAGS= -I\"",omhome,"/include\" ", cflags ,"\n",
"LDFLAGS= -L\"",omhome,"/lib\" ", ldflags ,"\n"
"CFLAGS= -I\"",omhome,"/include/omc\" ", cflags ,"\n",
"LDFLAGS= -L\"",omhome,"/lib/omc\" ", ldflags ,"\n"
});
then header;
end matchcontinue;
Expand Down
36 changes: 8 additions & 28 deletions Compiler/Makefile.in
Expand Up @@ -9,8 +9,8 @@
srcdir= .
top_builddir= ..
builddir_bin=$(top_builddir)/build/bin
builddir_lib=$(top_builddir)/build/lib
builddir_inc=$(top_builddir)/build/include
builddir_lib=$(top_builddir)/build/lib/omc
builddir_inc=$(top_builddir)/build/include/omc
builddir_doc=$(top_builddir)/build/doc

ANTLR_HOME = @antlrhome@
Expand Down Expand Up @@ -40,8 +40,7 @@ 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
SCRIPT_FILES = Compile doPlot

#SUBDIRS= ast runtime
SUBDIRS = runtime absyn_builder modpar
Expand Down Expand Up @@ -69,32 +68,15 @@ $(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); \
cp doc/$$x $(builddir_doc)/; \
done

install_scripts:
for x in $(SCRIPT_FILES); do \
echo Copying $$x into $(builddir_bin); \
cp scripts/$$x $(builddir_bin)/; \
done

install: install_scripts $(PROG)

install: install_doc install_scripts $(PROG)
echo Copying needed helpfiles....
for x in $(DOC_FILES); do \
echo Copying $$x into $(builddir_bin) where omc expects it...; \
cp doc/$$x $(builddir_bin)/; \
done

dinstall: install_doc install_scripts $(PROGD)
echo Copying needed helpfiles....
for x in $(DOC_FILES); do \
echo Copying $$x into $(builddir_bin) where omc expects it...; \
cp doc/$$x $(builddir_bin)/; \
done
dinstall: install_scripts $(PROGD)

omc_release: depend
(cd omc_release && $(MAKE))
Expand Down Expand Up @@ -134,8 +116,7 @@ clean: .depend
(cd omc_release; $(MAKE) clean)
-$(RM) -f $(SRCH)
-$(RM) -f $(builddir_bin)/$(PROG)$(EXEEXT)
-cd $(builddir_bin) && rm -f $(SCRIPT_FILES) && rm -f $(DOC_FILES)
-cd $(builddir_doc) && rm -f $(DOC_FILES)
-cd $(builddir_bin) && rm -f $(SCRIPT_FILES)

dclean: .depend
@for d in $(SUBDIRS); do \
Expand All @@ -144,8 +125,7 @@ dclean: .depend
(cd omc_debug; $(MAKE) clean)
-$(RM) -f $(SRCH)
-$(RM) -f $(builddir)/$(PROGD)$(EXEEXT)
-cd $(builddir_bin) && rm -f $(SCRIPTS_FILES) && rm -f $(DOC_FILES)
-cd $(builddir_doc) && rm -f $(DOC_FILES)
-cd $(builddir_bin) && rm -f $(SCRIPTS_FILES)

reallyclean: .depend
@for d in $(SUBDIRS); do \
Expand Down Expand Up @@ -173,4 +153,4 @@ depend:
.PRECIOUS: Makefile

Makefile: Makefile.in
$(top_builddir)/config.status Makefile
$(top_builddir)/config.status
8 changes: 2 additions & 6 deletions Compiler/omc_debug/Makefile.in
Expand Up @@ -26,10 +26,6 @@ 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
Expand All @@ -43,9 +39,9 @@ endif
LDFLAGS = -lm -L$(RMLHOME)/lib/plain -lrml_g $(ANTLR_LIBP) -lantlr $(LIBSOCKET) $(CORBALIBS) $(LIBLPSOLVE55)

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

PROG = omcd
Expand Down
9 changes: 2 additions & 7 deletions Compiler/omc_profiler/Makefile.in
Expand Up @@ -26,11 +26,6 @@ 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

Expand All @@ -43,9 +38,9 @@ endif
LDFLAGS = -lm -L$(RMLHOME)/lib/plain -lrml_p $(ANTLR_LIBP) -lantlr $(LIBSOCKET) $(CORBALIBS) $(LIBLPSOLVE55)

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

PROG = omcp
Expand Down
8 changes: 2 additions & 6 deletions Compiler/omc_release/Makefile.in
Expand Up @@ -25,10 +25,6 @@ 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

ifdef USE_CORBA
Expand All @@ -40,9 +36,9 @@ endif
LDFLAGS = -lm -L$(RMLHOME)/lib/plain -lrml $(ANTLR_LIBP) -lantlr $(LIBSOCKET) $(CORBALIBS) $(LIBLPSOLVE55)

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

PROG = omc
Expand Down
2 changes: 1 addition & 1 deletion Compiler/scripts/doPlot
@@ -1,2 +1,2 @@
#!/bin/sh
exec java -cp "${OPENMODELICAHOME}/bin/ptplot.jar" ptolemy.plot.plotml.EditablePlotMLApplication "$1" &
exec java -cp "${OPENMODELICAHOME}/share/omc/java/ptplot.jar" ptolemy.plot.plotml.EditablePlotMLApplication "$1" &
2 changes: 1 addition & 1 deletion Compiler/scripts/doPlot.Cygwin
@@ -1,2 +1,2 @@
#!/bin/sh
exec java -cp "`cygpath -w ${OPENMODELICAHOME}/bin/ptplot.jar`" ptolemy.plot.plotml.EditablePlotMLApplication "`cygpath -w $1`" &
exec java -cp "`cygpath -w ${OPENMODELICAHOME}/share/omc/java/ptplot.jar`" ptolemy.plot.plotml.EditablePlotMLApplication "`cygpath -w $1`" &
2 changes: 1 addition & 1 deletion Compiler/scripts/doPlot.bat
@@ -1,6 +1,6 @@
@echo off
if defined PTII goto runplot
set PTII=%OPENMODELICAHOME%\bin\ptplot.jar
set PTII=%OPENMODELICAHOME%\share\omc\java\ptplot.jar
:runplot
start javaw -classpath %PTII% ptolemy.plot.plotml.EditablePlotMLApplication %1

4 changes: 2 additions & 2 deletions Compiler/susan_codegen/SimCode/SimCodeC.tpl
Expand Up @@ -1339,8 +1339,8 @@ case SIMCODE(modelInfo=MODELINFO, makefileParams=MAKEFILE_PARAMS) then
LINK=<makefileParams.linker>
EXEEXT=<makefileParams.exeext>
DLLEXT=<makefileParams.dllext>
CFLAGS= -I"<makefileParams.omhome>/include" <makefileParams.cflags>
LDFLAGS= -L"<makefileParams.omhome>/lib" <makefileParams.ldflags>
CFLAGS= -I"<makefileParams.omhome>/include/omc" <makefileParams.cflags>
LDFLAGS= -L"<makefileParams.omhome>/lib/omc" <makefileParams.ldflags>

.PHONY: <modelInfo.name>
<modelInfo.name>: <modelInfo.name>.cpp
Expand Down
129 changes: 129 additions & 0 deletions Makefile.common
@@ -0,0 +1,129 @@
.PHONY : all omc omcd debug release mosh clean .testvariables mkbuilddirs all omc omcd debug release mosh clean

top_builddir = .
builddir_bin=$(top_builddir)/build/bin
builddir_lib=$(top_builddir)/build/lib/omc
builddir_inc=$(top_builddir)/build/include/omc
builddir_doc=$(top_builddir)/build/share/doc
builddir_share=$(top_builddir)/build/share/
builddir_java=$(top_builddir)/build/share/omc/java/

INSTALL_BINDIR = ${DESTDIR}${bindir}
INSTALL_LIBDIR = ${DESTDIR}${libdir}/omc
INSTALL_INCLUDEDIR = ${DESTDIR}${includedir}/omc
INSTALL_DATADIR = ${DESTDIR}${datadir}
INSTALL_DOCDIR = ${DESTDIR}${docdir}/omc
INSTALL_SHAREDIR = ${DESTDIR}${datadir}/
INSTALL_JAVADIR = ${DESTDIR}${datadir}/omc/java

.PHONY : c_runtime omc omcd release debug qtclient mosh all mkbuilddirs test install-dirs

mkbuilddirs:
mkdir -p $(builddir_bin)
mkdir -p $(builddir_lib)
mkdir -p $(builddir_inc)
mkdir -p $(builddir_java)
mkdir -p $(builddir_share)/omnotebook
mkdir -p $(builddir_share)/omshell
mkdir -p $(builddir_doc)/omc/testmodels

debug: .testvariables mkbuilddirs settings omcd
frontend: .testvariables mkbuilddirs settings omc_frontend
release: omc

c_runtime: mkbuilddirs
$(MAKE) -C c_runtime -f $(defaultMakefileTarget)

docs:
(cp -p doc/*.pdf doc/*.txt doc/OpenModelicaAPI-Howto/*.pdf $(builddir_doc)/omc)
rm -f build/doc/omc/CMakeLists.txt
(cp -p Examples/*.* $(builddir_doc)/omc/testmodels/)

testfast:
(cd testsuite; time $(MAKE) -f Makefile fast)

test:
(cd testsuite; time $(MAKE) -f Makefile)

testlog:
(cd testsuite; time $(MAKE) -f Makefile > testsuite-trace.txt 2>&1)
echo "log is in testsuite/testsuite-trace.txt"

testmos:
(cd testsuite/mosfiles; time $(MAKE) -f Makefile)

testmeta:
(cd testsuite/meta; time $(MAKE) -f Makefile)
(cd testsuite/records; time $(MAKE) -f Makefile)

testlibraries:
(cd testsuite/libraries; time $(MAKE) -f Makefile)

testSummary:
(cd testsuite; time $(MAKE) -f Makefile | grep "==")

mosh: omc
$(MAKE) -C mosh/src -f $(defaultMakefileTarget)

susan: all
$(MAKE) -C Compiler/susan_codegen

sus:
$(MAKE) -C Compiler/susan_codegen

tpl_simcode: tpl_sc susan tpl_gen

tpl_sc:
$(MAKE) -C Compiler/susan_codegen/SimCode

tpl_gen:
$(MAKE) -C Compiler/susan_codegen/SimCode/GenTest

distclean: clean
(cd Compiler && $(MAKE) -f $(defaultMakefileTarget) reallyclean)
(cd Compiler/omc_debug && $(MAKE) -f $(defaultMakefileTarget) reallyclean)
(cd Compiler/omc_release && $(MAKE) -f $(defaultMakefileTarget) reallyclean)
(cd Compiler/omc_profiler && $(MAKE) -f $(defaultMakefileTarget) reallyclean)
(cd modelica_parser/src && $(MAKE) -f $(defaultMakefileTarget) reallyclean)
(cd flat_modelica_parser/src && $(MAKE) -f $(defaultMakefileTarget) reallyclean)
rm -f Compiler/.depend
rm -f OMShell/Makefile OMNotebook/ext/Makefile OMNotebook/OMNotebookQT4/Makefile
rm -f $(autoconfGeneratedFiles)
rm -f config.status config.log
clean:
(cd c_runtime && $(MAKE) -f $(defaultMakefileTarget) clean)
(cd Compiler/rml2sig && $(MAKE) -f $(defaultMakefileTarget) clean)
(cd Compiler && $(MAKE) -f $(defaultMakefileTarget) clean)
(cd Compiler/omc_debug && $(MAKE) -f $(defaultMakefileTarget) clean)
(cd Compiler/omc_release && $(MAKE) -f $(defaultMakefileTarget) clean)
(cd Compiler/omc_profiler && $(MAKE) -f $(defaultMakefileTarget) clean)
(cd mosh/src && $(MAKE) -f $(defaultMakefileTarget) clean)
(cd modelica_parser/src && $(MAKE) -f $(defaultMakefileTarget) clean)
(cd flat_modelica_parser/src && $(MAKE) -f $(defaultMakefileTarget) clean)
rm -rf build/

install-dirs:
mkdir -p ${INSTALL_BINDIR}
mkdir -p ${INSTALL_LIBDIR}
mkdir -p ${INSTALL_INCLUDEDIR}
mkdir -p ${INSTALL_DOCDIR}
mkdir -p ${INSTALL_DOCDIR}/testmodels
mkdir -p ${INSTALL_SHAREDIR}/omnotebook ${INSTALL_SHAREDIR}/omshell ${INSTALL_JAVADIR}

install: install-dirs
echo Installing OpenModelica...
# Binaries
cp -p ${builddir_bin}/* ${INSTALL_BINDIR}
# Libraries
cp -p ${builddir_lib}/* ${INSTALL_LIBDIR}
# Includes
cp -p ${builddir_inc}/* ${INSTALL_INCLUDEDIR}
# Documents
cp -p ${builddir_doc}/omc/*.pdf ${INSTALL_DOCDIR}
cp -p ${builddir_doc}/omc/*.txt ${INSTALL_DOCDIR}
cp -p ${builddir_doc}/omc/testmodels/* ${INSTALL_DOCDIR}/testmodels
# Shared data
cp -p ${builddir_share}/omnotebook/* ${INSTALL_SHAREDIR}/omnotebook
cp -p ${builddir_share}/omshell/* ${INSTALL_SHAREDIR}/omshell
# Java
cp -p ${builddir_java}/* ${INSTALL_JAVADIR}

0 comments on commit 901913c

Please sign in to comment.