Commit e5002f48 authored by Mathieu Faverge's avatar Mathieu Faverge

Add Makefile for plugins and adapt configure

parent bb31d48a
......@@ -42,6 +42,8 @@
#
#!/bin/sh
echo $* >> ./config.log
relpath=`dirname $0`
relpath=`(cd "$relpath"; /bin/pwd)`
WHICH=`which which 2>/dev/null`
......@@ -65,8 +67,8 @@ qtcolorsrcdir="$qtcolordir/src"
config_specified=0
# where will we concatenate options like macros, libs...
compilation_src_pro="src.pro"
# Project file
project="src.pro"
# For qmake
config="\"CONFIG+="
......@@ -253,7 +255,7 @@ dependpath="$dependpath\"";
sources="$sources\"";
headers="$headers\"";
compilation_src_pro="$defines $config $libs $sources $headers $includepath $dependpath";
options="$defines $config $libs $sources $headers $includepath $dependpath";
# find a make command
if [ -z "$MAKE" ]; then
......@@ -271,79 +273,83 @@ if [ -z "$MAKE" ]; then
fi
fi
# Creates the makefile
cat > "$makefile" <<EOF
########################################################################
## ##
## This file was autogenerated by configure, all changes will be lost ##
## ##
################### It has by done for ViTE project ####################
## ##
########################################################################
all:
EOF
makecmd=$MAKE
if "$WHICH" qmake-qt4 >/dev/null 2>&1 ; then
cat >> "$makefile" <<EOF
cd ./src && qmake-qt4 -makefile -o Makefile $compilation_src_pro && make
EOF
qmakecmd="qmake-qt4 -makefile -o Makefile"
elif "$WHICH" qmake >/dev/null 2>&1 && [ "$UNAME_SYSTEM" = "Darwin" ] ; then # Mac
cat >> "$makefile" <<EOF
cd src/ && qmake -spec macx-xcode $compilation_src_pro && xcodebuild -project vite.xcodeproj -configuration Debug clean build
EOF
qmakecmd="qmake -spec macx-xcode "
makecmd="xcodebuild -project vite.xcodeproj -configuration Debug clean build"
elif "$WHICH" qmake >/dev/null 2>&1 ; then
cat >> "$makefile" <<EOF
cd ./src && qmake -makefile -o Makefile $compilation_src_pro && make
EOF
qmakecmd="qmake -makefile -o Makefile"
elif "$WHICH" qmake-mac >/dev/null 2>&1 ; then # Mac the return
cat >> "$makefile" <<EOF
cd ./src && qmake-mac -makefile -o Makefile $compilation_src_pro && make
EOF
qmakecmd="qmake-mac -makefile -o Makefile"
else # error
echo >&2 "Warning: Impossible to find qmake or qmake-qt4."
echo >&2 "Be sure that you have installed Qt and qmake (if it is not included in the Qt package)"
rm -f Makefile
exit
fi
cat >>"$makefile" <<EOF
# Creates the makefile.in
cat > "Makefile.in" <<EOF
VITEDIR = $relpath
DOCSDIR = ./docs
QMAKECMD = $qmakecmd
MAKECMD = $makecmd
EOF
# Creates the makefile
cat > "$makefile" <<EOF
########################################################################
## ##
## This file was autogenerated by configure, all changes will be lost ##
## ##
################### It has by done for ViTE project ####################
## ##
########################################################################
include Makefile.in
all:
( cd src && \$(QMAKECMD) $project $options)
( cd src && \$(MAKECMD) )
@echo " "
@echo "Compilation completed! File created in 'bin' folder."
@echo " "
DOCUMENTATION = ./docs/
doc:
doxygen Doxyfile
make -C \$(DOCUMENTATION)/latex
make -C \$(DOCUMENTATION)/user_manual
make -C \$(DOCUMENTATION)/technical_manual
$MAKE -C \${DOCSDIR}/latex
$MAKE -C \${DOCSDIR}/user_manual
$MAKE -C \${DOCSDIR}/technical_manual
@echo " "
@echo "Documentation generated successfully!"
@echo "It could be find in the \$(DOCUMENTATION) folder."
@echo "It could be find in the \${DOCSDIR} folder."
@echo " "
plugins:
( cd plugins && VITEDIR=\$(VITEDIR) $MAKE )
clean:
cd ./src && make clean
( cd plugins && VITEDIR=\$(VITEDIR) $MAKE clean )
( cd src && $MAKE clean )
\$(RM) log.txt
@echo " "
@echo "Cleaned!"
@echo " "
cleanall: clean
EOF
cat >>"$makefile" <<EOF
make -C \$(DOCUMENTATION)/user_manual cleanall
make -C \$(DOCUMENTATION)/technical_manual cleanall
@(cd bin/ && \$(RM) vite)
@(cd \$(DOCUMENTATION) && rm -rf html/ latex/)
( cd plugins && VITEDIR=\$(VITEDIR) $MAKE cleanall )
$MAKE -C \${DOCSDIR}/user_manual cleanall
$MAKE -C \${DOCSDIR}/technical_manual cleanall
@( cd \${DOCSDIR} && rm -rf html/ latex/)
@( cd bin/ && \$(RM) vite)
distclean: cleanall
EOF
cat >>"$makefile" <<EOF
( cd plugins && VITEDIR=\$(VITEDIR) $MAKE distclean )
\$(RM) Makefile
\$(RM) src/Makefile
EOF
# basename erase the path of acces of the command
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment