tests/build_win32.sh
author Edouard Tisserant <edouard.tisserant@gmail.com>
Thu, 20 Jul 2023 22:03:23 +0200
changeset 1102 1610b6528b27
parent 279 c0453b7f99df
permissions -rwxr-xr-x
Add .gitignore
57
db9cadaab2ea Now generated SoftPLC compiles with mingw32 and run windows.
etisserant
parents:
diff changeset
     1
#!/bin/bash
279
c0453b7f99df Re-generated std lib related code, with updated headers, updated all forgotten headers
Edouard Tisserant
parents: 132
diff changeset
     2
# matiec - a compiler for the programming languages defined in IEC 61131-3
c0453b7f99df Re-generated std lib related code, with updated headers, updated all forgotten headers
Edouard Tisserant
parents: 132
diff changeset
     3
#
c0453b7f99df Re-generated std lib related code, with updated headers, updated all forgotten headers
Edouard Tisserant
parents: 132
diff changeset
     4
# Copyright (C) 2003-2011  Mario de Sousa (msousa@fe.up.pt)
c0453b7f99df Re-generated std lib related code, with updated headers, updated all forgotten headers
Edouard Tisserant
parents: 132
diff changeset
     5
# Copyright (C) 2007-2011  Laurent Bessard and Edouard Tisserant
c0453b7f99df Re-generated std lib related code, with updated headers, updated all forgotten headers
Edouard Tisserant
parents: 132
diff changeset
     6
#
c0453b7f99df Re-generated std lib related code, with updated headers, updated all forgotten headers
Edouard Tisserant
parents: 132
diff changeset
     7
# This program is free software: you can redistribute it and/or modify
c0453b7f99df Re-generated std lib related code, with updated headers, updated all forgotten headers
Edouard Tisserant
parents: 132
diff changeset
     8
# it under the terms of the GNU General Public License as published by
c0453b7f99df Re-generated std lib related code, with updated headers, updated all forgotten headers
Edouard Tisserant
parents: 132
diff changeset
     9
# the Free Software Foundation, either version 3 of the License, or
c0453b7f99df Re-generated std lib related code, with updated headers, updated all forgotten headers
Edouard Tisserant
parents: 132
diff changeset
    10
# (at your option) any later version.
c0453b7f99df Re-generated std lib related code, with updated headers, updated all forgotten headers
Edouard Tisserant
parents: 132
diff changeset
    11
#
c0453b7f99df Re-generated std lib related code, with updated headers, updated all forgotten headers
Edouard Tisserant
parents: 132
diff changeset
    12
# This program is distributed in the hope that it will be useful,
c0453b7f99df Re-generated std lib related code, with updated headers, updated all forgotten headers
Edouard Tisserant
parents: 132
diff changeset
    13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
c0453b7f99df Re-generated std lib related code, with updated headers, updated all forgotten headers
Edouard Tisserant
parents: 132
diff changeset
    14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
c0453b7f99df Re-generated std lib related code, with updated headers, updated all forgotten headers
Edouard Tisserant
parents: 132
diff changeset
    15
# GNU General Public License for more details.
c0453b7f99df Re-generated std lib related code, with updated headers, updated all forgotten headers
Edouard Tisserant
parents: 132
diff changeset
    16
#
c0453b7f99df Re-generated std lib related code, with updated headers, updated all forgotten headers
Edouard Tisserant
parents: 132
diff changeset
    17
# You should have received a copy of the GNU General Public License
c0453b7f99df Re-generated std lib related code, with updated headers, updated all forgotten headers
Edouard Tisserant
parents: 132
diff changeset
    18
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
c0453b7f99df Re-generated std lib related code, with updated headers, updated all forgotten headers
Edouard Tisserant
parents: 132
diff changeset
    19
#
c0453b7f99df Re-generated std lib related code, with updated headers, updated all forgotten headers
Edouard Tisserant
parents: 132
diff changeset
    20
# Shell script to build test for windows
57
db9cadaab2ea Now generated SoftPLC compiles with mingw32 and run windows.
etisserant
parents:
diff changeset
    21
db9cadaab2ea Now generated SoftPLC compiles with mingw32 and run windows.
etisserant
parents:
diff changeset
    22
STFILE=$1
db9cadaab2ea Now generated SoftPLC compiles with mingw32 and run windows.
etisserant
parents:
diff changeset
    23
db9cadaab2ea Now generated SoftPLC compiles with mingw32 and run windows.
etisserant
parents:
diff changeset
    24
shift
db9cadaab2ea Now generated SoftPLC compiles with mingw32 and run windows.
etisserant
parents:
diff changeset
    25
db9cadaab2ea Now generated SoftPLC compiles with mingw32 and run windows.
etisserant
parents:
diff changeset
    26
CFLAGS=$*
db9cadaab2ea Now generated SoftPLC compiles with mingw32 and run windows.
etisserant
parents:
diff changeset
    27
db9cadaab2ea Now generated SoftPLC compiles with mingw32 and run windows.
etisserant
parents:
diff changeset
    28
db9cadaab2ea Now generated SoftPLC compiles with mingw32 and run windows.
etisserant
parents:
diff changeset
    29
#CC=gcc
db9cadaab2ea Now generated SoftPLC compiles with mingw32 and run windows.
etisserant
parents:
diff changeset
    30
CC=i686-mingw32-gcc
db9cadaab2ea Now generated SoftPLC compiles with mingw32 and run windows.
etisserant
parents:
diff changeset
    31
132
39f88c3d803d Updated tests so that they compile again :-)
etisserant
parents: 57
diff changeset
    32
../iec2c $STFILE -I ../lib 
57
db9cadaab2ea Now generated SoftPLC compiles with mingw32 and run windows.
etisserant
parents:
diff changeset
    33
#2>/dev/null
db9cadaab2ea Now generated SoftPLC compiles with mingw32 and run windows.
etisserant
parents:
diff changeset
    34
db9cadaab2ea Now generated SoftPLC compiles with mingw32 and run windows.
etisserant
parents:
diff changeset
    35
$CC -I ../lib -c STD_RESSOURCE.c $CFLAGS
db9cadaab2ea Now generated SoftPLC compiles with mingw32 and run windows.
etisserant
parents:
diff changeset
    36
db9cadaab2ea Now generated SoftPLC compiles with mingw32 and run windows.
etisserant
parents:
diff changeset
    37
$CC -I ../lib -c  STD_CONF.c $CFLAGS
db9cadaab2ea Now generated SoftPLC compiles with mingw32 and run windows.
etisserant
parents:
diff changeset
    38
db9cadaab2ea Now generated SoftPLC compiles with mingw32 and run windows.
etisserant
parents:
diff changeset
    39
$CC -I ../lib -c  plc.c $CFLAGS
db9cadaab2ea Now generated SoftPLC compiles with mingw32 and run windows.
etisserant
parents:
diff changeset
    40
db9cadaab2ea Now generated SoftPLC compiles with mingw32 and run windows.
etisserant
parents:
diff changeset
    41
$CC -I ../lib main.c STD_CONF.o STD_RESSOURCE.o plc.o $CFLAGS -o test.exe