Skip to content

Commit

Permalink
Allow compiling without all subprojects present
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund committed Jun 2, 2015
1 parent 1bc9092 commit a4f6d11
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
3 changes: 2 additions & 1 deletion Makefile.in
@@ -1,4 +1,4 @@
all: omc @OMLIBRARY_TARGET@ omc-diff omplot omnotebook omshell omedit omoptim ReferenceFiles
all: @ALL_TARGETS@ @OMLIBRARY_TARGET@

.PRECIOUS: Makefile

Expand All @@ -22,6 +22,7 @@ omc-diff:
$(MAKE) -C testsuite/difftool "OMBUILDDIR=@OMBUILDDIR@" CC="@CC@" CFLAGS="@CFLAGS@"
ReferenceFiles:
$(MAKE) -C testsuite/ReferenceFiles
testsuite-depends: omc-diff ReferenceFiles

SOURCE_DIRS_UTF8=OMEdit/ OMShell/ OMNotebook/ OMOptim/ OMPlot/ OMCompiler/Compiler/ OMCompiler/SimulationRuntime/ `bash -c echo testsuite/flattening/libraries/3rdParty/{PlanarMechanics,siemens,SiemensPower,ThermoSysPro}` testsuite/openmodelica/modelicaML testsuite/AVM testsuite/simulation
SOURCE_DIRS=$(SOURCE_DIRS_UTF8) # testsuite/flattening/libraries/3rdParty/HumMod
Expand Down
30 changes: 24 additions & 6 deletions configure.ac
Expand Up @@ -46,6 +46,15 @@ case "$OMLIBRARY_TARGET" in
;;
esac

if test ! -z "$OMLIBRARY_TARGET"; then
AC_MSG_CHECKING([for libraries directory])
if test -f libraries/Makefile; then
AC_MSG_RESULT([yes])
else
AC_MSG_ERROR([no])
fi
fi

AC_SUBST(MODELICA3D_TARGET)
AC_MSG_CHECKING([if the user wants Modelica3D])
MODELICA3D_TARGET="yes"
Expand All @@ -57,15 +66,24 @@ AC_MSG_RESULT([yes])
MODELICA3D_TARGET="omlibrary-modelica3d"
fi

for dir in OMCompiler OMPlot OMEdit OMNotebook OMOptim OMShell; do
if test ! -d "$dir"; then
AC_MSG_ERROR("Subproject $dir does not exist")
fi
if !(cd "$dir" && autoconf); then
AC_MSG_ERROR("Failed to autoconf $dir")
AC_SUBST(ALL_TARGETS)
for dir_target in OMCompiler-omc OMPlot-omplot OMEdit-omedit OMNotebook-omnotebook OMOptim-omoptim OMShell-omshell; do
dir=`echo $dir_target | cut -d- -f1`
if test ! -f "$dir/configure.ac"; then
AC_MSG_NOTICE("Subproject $dir does not exist")
else
if !(cd "$dir" && autoconf); then
AC_MSG_ERROR("Failed to autoconf $dir")
fi
ALL_TARGETS="$ALL_TARGETS `echo $dir_target | cut -d- -f2-`"
fi
done

AC_SUBST(ALL_TARGETS)
if test -f testsuite/Makefile; then
ALL_TARGETS="$ALL_TARGETS testsuite-depends"
fi

AC_CONFIG_SUBDIRS([OMCompiler OMPlot OMEdit OMNotebook OMOptim OMShell])

AC_OUTPUT(Makefile)

0 comments on commit a4f6d11

Please sign in to comment.