Commits

Gordon Tisher committed ca0e3b1

start of a build system for windows

Comments (0)

Files changed (13)

src/automata/automata.pro

 
 TARGET = automata
 
-include(../neurolab_version.txt)
+include(../version.txt)
 DEFINES += AUTOMATA_LIBRARY
 
 SOURCES += exception.cpp
+%echo off
+
+set QTDIR=C:\Qt\2010.02.1
+
+call :distclean
+if ERRORLEVEL 1 goto :EOF
+
+call :build utils\incversion incversion.pro
+if ERRORLEVEL 1 goto :EOF
+
+call :build . neurolab_all.pro
+
+goto :EOF
+
+:distclean
+pushd .
+call distclean.bat
+if ERRORLEVEL 1 goto error
+popd
+goto :EOF
+
+:build
+call :qmake %1 %2
+call :make %1
+goto :EOF
+
+:qmake
+echo running qmake in %1
+pushd "%1"
+"%QTDIR%\qt\bin\qmake.exe" "%2" -spec win32-g++ -r CONFIG+=release
+if ERRORLEVEL 1 goto error
+popd
+goto :EOF
+
+:make
+echo running make in %1
+pushd "%1"
+"%QTDIR%\mingw\bin\mingw32-make.exe" --no-print-directory
+if ERRORLEVEL 1 goto error
+popd
+goto :EOF
+
+:error
+popd
+echo aborted!
+exit /b 1
+goto :EOF

src/distclean.bat

-del /s /q Makefile* 
-del /s /q *.user 
-del /s /q debug 
-del /s /q *.o 
-del /s /q moc_* 
-del /s /q ui*.h 
-del /s /q object_script* 
+%echo off
+echo cleaning...
+
+echo > Makefile_dummy
+call :clean Makefile*
+
+echo > dummy.user
+call :clean *.user
+
+if not exist debug mkdir debug
+call :clean debug 
+
+echo > dummy.o
+call :clean *.o 
+
+echo > moc_dummy
+call :clean moc_* 
+
+echo > uidummy.h
+call :clean ui*.h 
+
+echo > object_scriptdummy
+call :clean object_script* 
+
+goto :EOF
+
+:clean
+del /s /q %* > %TEMP%\distclean.log
+goto :EOF

src/griditems/griditems.pro

 TARGET = griditems
 TEMPLATE = lib
 
-include(../neurolab_version.txt)
+include(../version.txt)
 INCLUDEPATH += ../thirdparty/qtpropertybrowser/qtpropertybrowser-2.5_1-opensource/src
 
 DEFINES += GRIDITEMS_LIBRARY

src/neurogui/mainwindow.cpp

 {
 
     const QString
-#include "../neurolab_version.txt"
+#include "../version.txt"
     ;
 
     MainWindow *MainWindow::_instance = 0;

src/neurogui/neurogui.pro

 TEMPLATE = lib
 TARGET = neurogui
 DEFINES += NEUROGUI_LIBRARY
-include(../neurolab_version.txt)
+include(../version.txt)
 INCLUDEPATH += ../thirdparty/qtpropertybrowser/qtpropertybrowser-2.5_1-opensource/src
 SOURCES += mainwindow.cpp \
     labnetwork.cpp \

src/neurolab/neurolab.pro

 TEMPLATE = app
 TARGET = neurolab
 
-include(../neurolab_version.txt)
+include(../version.txt)
 INCLUDEPATH += ../thirdparty/qtpropertybrowser/qtpropertybrowser-2.5_1-opensource/src
 
 SOURCES += main.cpp

src/neurolab_version.txt

-VERSION = "0.0.0"

src/neurolib/neurocell.cpp

         for (int i = 0; i < neighbor_indices.size(); ++i)
             input_sum += neighbors[i]->_output_value;
 
-        NeuroValue next_value;
+        NeuroValue next_value = 0;
 
         switch (prev._kind)
         {

src/neurolib/neurolib.pro

 QT += testlib
 TEMPLATE = lib
 TARGET = neurolib
-include(../neurolab_version.txt)
+include(../version.txt)
 
 DEFINES += NEUROLIB_LIBRARY
 

src/utils/incversion/incversion.pro

+#-------------------------------------------------
+#
+# Project created by QtCreator 2010-04-02T09:45:33
+#
+#-------------------------------------------------
+
+QT       -= gui
+
+TARGET = incversion
+CONFIG   += console static
+CONFIG   -= app_bundle
+
+TEMPLATE = app
+
+SOURCES += main.cpp
+
+QMAKE_LFLAGS += -static

src/utils/incversion/main.cpp

+/*
+Neurocognitive Linguistics Lab
+Copyright (c) 2010, Gordon Tisher
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without 
+modification, are permitted provided that the following conditions 
+are met:
+
+ - Redistributions of source code must retain the above copyright 
+   notice, this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright 
+   notice, this list of conditions and the following disclaimer in 
+   the documentation and/or other materials provided with the 
+   distribution.
+
+ - Neither the name of the Neurocognitive Linguistics Lab nor the 
+   names of its contributors may be used to endorse or promote 
+   products derived from this software without specific prior 
+   written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
+FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
+COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
+ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <QtCore/qglobal.h>
+#include <QString>
+#include <QFile>
+#include <QTextStream>
+#include <QList>
+#include <QRegExp>
+
+static QTextStream cout(stdout);
+
+static int num_printed = 0;
+
+static QString increment(const QString & line)
+{
+    QString result = line;
+    
+    QRegExp re("(\\d+)\\.(\\d+)\\.(\\d+)");
+    if (re.indexIn(line) >= 0)
+    {
+        QString cap = re.cap(3);
+        int lastNum = cap.toInt();
+        QString newNum = QString::number(lastNum+1);
+        result.replace(re.pos(3), cap.length(), newNum);
+        
+        if (num_printed++)
+            cout << '\n';
+        cout << re.cap(1) << "." << re.cap(2) << "." << newNum;
+        cout.flush();
+    }
+    
+    return result;
+}
+
+int main(int argc, char *argv[])
+{
+    for (int i = 1; i < argc; ++i)
+    {
+        QList<QString> lines;
+        QString fname(argv[i]);
+        
+        // read
+        QFile file(fname);
+        if (file.open(QIODevice::ReadOnly | QIODevice::Text))
+        {
+            QTextStream fs(&file);
+            while (!fs.atEnd())
+            {
+                QString line = increment(fs.readLine());
+                lines.append(line);
+            }
+        }
+        else
+        {
+            qFatal("Unable to open file for input.");
+        }
+        file.close();
+        
+        // write
+        if (file.open(QIODevice::WriteOnly | QIODevice::Text))
+        {
+            QTextStream fs(&file);
+            for (int i = 0; i < lines.size(); ++i)
+            {
+                fs << lines[i];
+                if (i+1 < lines.size())
+                    fs << '\n';
+            }
+            fs.flush();
+        }
+        else
+        {
+            qFatal("Unable to open file for input.");
+        }
+        file.close();
+    }
+    
+    return 0;
+}
+VERSION = "0.0.53"