configure 4.85 KB
Newer Older
Mathieu Faverge's avatar
Mathieu Faverge committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
#
# This file is part of the ViTE project.
#
# This software is governed by the CeCILL-A license under French law
# and abiding by the rules of distribution of free software. You can
# use, modify and/or redistribute the software under the terms of the
# CeCILL-A license as circulated by CEA, CNRS and INRIA at the following
# URL: "http://www.cecill.info".
# 
# As a counterpart to the access to the source code and rights to copy,
# modify and redistribute granted by the license, users are provided
# only with a limited warranty and the software's author, the holder of
# the economic rights, and the successive licensors have only limited
# liability.
# 
# In this respect, the user's attention is drawn to the risks associated
# with loading, using, modifying and/or developing or reproducing the
# software by the user in light of its specific status of free software,
# that may mean that it is complicated to manipulate, and that also
# therefore means that it is reserved for developers and experienced
# professionals having in-depth computer knowledge. Users are therefore
# encouraged to load and test the software's suitability as regards
# their requirements in conditions enabling the security of their
# systems and/or data to be ensured and, more generally, to use and
# operate it in the same conditions as regards security.
# 
# The fact that you are presently reading this means that you have had
# knowledge of the CeCILL-A license and that you accept its terms.
#
#
31
# ViTE developers are (for version 0.* to 1.0):
Mathieu Faverge's avatar
Mathieu Faverge committed
32 33 34 35 36 37 38 39 40 41 42
#
#        - COULOMB Kevin
#        - FAVERGE Mathieu
#        - JAZEIX Johnny
#        - LAGRASSE Olivier
#        - MARCOUEILLE Jule
#        - NOISETTE Pascal
#        - REDONDY Arthur
#        - VUCHENER Clément 
#
#
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
#!/bin/sh

relpath=`dirname $0`
relpath=`(cd "$relpath"; /bin/pwd)`
WHICH=`which which 2>/dev/null`
UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
makefile="Makefile"

# find a make command
if [ -z "$MAKE" ]; then
    MAKE=
    for mk in gmake make; do
        if "$WHICH" $mk >/dev/null 2>&1; then
            MAKE=`$WHICH $mk`
            break
        fi
    done
    if [ -z "$MAKE" ]; then
        echo >&2 "You don't seem to have 'make' or 'gmake' in your PATH."
        echo >&2 "Cannot proceed."
        exit 1
    fi
fi

67
OTFLIB_DIR=./src/general/otf
68 69 70 71 72 73 74 75 76 77 78

# Creates the makefile
cat > "$makefile" <<EOF
########################################################################
##                                                                    ##
## This file was autogenerated by configure, all changes will be lost ##
##                                                                    ##
################### It has by done for ViTE project ####################
##                                                                    ##
########################################################################

79 80
OTFLIB_DIR = ./src/general/otf

81
all:
82
	make -C \$(OTFLIB_DIR)
83 84
	rm -rf \$(OTFLIB_DIR)/otflib/.libs/*so*
	rm -rf \$(OTFLIB_DIR)/otflib/.libs/*dylib* # For mac
85 86 87 88
EOF

if "$WHICH" qmake-qt4 >/dev/null 2>&1 ; then
    cat >> "$makefile" <<EOF
89
	cd ./src && qmake-qt4 -makefile -o Makefile src.pro && make
90
EOF
Johnny Jazeix's avatar
Johnny Jazeix committed
91
elif "$WHICH" qmake >/dev/null 2>&1 && [ "$UNAME_SYSTEM" = "Darwin" ] ; then # Mac
92
    cat >> "$makefile" <<EOF
93
	cd src/ && qmake -spec macx-xcode src.pro && xcodebuild -project vite.xcodeproj -configuration Debug clean build
94
EOF
95 96 97
elif "$WHICH" qmake >/dev/null 2>&1 ; then
    cat >> "$makefile" <<EOF
	cd ./src && qmake -makefile -o Makefile src.pro && make
98
EOF
99
elif "$WHICH" qmake-mac >/dev/null 2>&1 ; then # Mac the return
Xavier Lacoste's avatar
Xavier Lacoste committed
100 101 102
    cat >> "$makefile" <<EOF
	cd ./src && qmake-mac -makefile -o Makefile src.pro && make
EOF
103 104 105 106 107
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
108 109 110 111 112 113
fi
    cat >>"$makefile" <<EOF
	@echo " "
	@echo "Compilation completed! File created in 'bin' folder."
	@echo " "

114
DOCUMENTATION = ../documentation/
115 116
doc:
	doxygen Doxyfile
117 118 119
	make -C \$(DOCUMENTATION)/latex
	make -C \$(DOCUMENTATION)/user_manual
	make -C \$(DOCUMENTATION)/technical_manual
120 121
	@echo " "
	@echo "Documentation generated successfully!"
122
	@echo "It could be find in the \$(DOCUMENTATION) folder."
123 124 125 126
	@echo " "

clean:
	cd ./src && make clean
Johnny Jazeix's avatar
Johnny Jazeix committed
127
	\$(RM) log.txt
128 129 130 131 132
	@echo " "
	@echo "Cleaned!"
	@echo " "


133
cleanall:	clean
Olivier Lagrasse's avatar
Olivier Lagrasse committed
134
	make -C \$(OTFLIB_DIR) clean
135 136
	make -C \$(DOCUMENTATION)/user_manual cleanall
	make -C \$(DOCUMENTATION)/technical_manual cleanall
137
	@(cd bin/ && \$(RM) vite)
138
	@(cd \$(DOCUMENTATION) && rm -rf html/ latex/)
Johnny Jazeix's avatar
Johnny Jazeix committed
139 140

distclean:	cleanall
141
	make -C \$(OTFLIB_DIR) distclean
Johnny Jazeix's avatar
Johnny Jazeix committed
142 143
	\$(RM) Makefile
	\$(RM) src/Makefile
144

145 146 147
EOF


148 149
echo >&2 "Configuration of the otf library"
cd $OTFLIB_DIR && ./configure
150 151 152 153 154

# basename erase the path of acces of the command 
MAKE=`basename $MAKE`

echo ViTE is now configured for building. Just run \'$MAKE\'.