-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·53 lines (45 loc) · 2.29 KB
/
build.sh
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
# set -xe
RAYLIBDIR="raylib-5.0"
FFLAGS="-std=f2018 -fno-range-check -Wall -Wextra -Wno-conversion"
SRC="src/iofiles.f90 src/raylib.f90 src/game.f90 src/ui.f90 app/main.f90"
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
echo "[INFO] Détection d'une machine Linux"
echo "[INFO] Compilation en cours..."
LIBS="-I$RAYLIBDIR/include -L$RAYLIBDIR/lib -lraylib -Wl,-rpath=lib/"
mkdir -p build/
cp -r $RAYLIBDIR/lib build/
gfortran $FFLAGS -J build/ -o build/2048 $SRC $LIBS
elif [[ "$OSTYPE" == "darwin"* ]]; then
echo "[INFO] Détection d'une machine sous MacOS"
echo "[INFO] Compilation en cours..."
# LIBS="-static-libgfortran -static-libgcc -static-libquadmath -I$RAYLIBDIR/include -L$RAYLIBDIR/lib -lraylib -Xlinker -rpath -Xlinker lib/"
LIBS="-static-libgfortran -static-libgcc -static-libquadmath $RAYLIBDIR/lib/libraylib.a -framework IOKit -framework Cocoa -framework OpenGL"
# LIBS="-framework IOKit -framework Cocoa -framework OpenGL $(pkg-config --libs --cflags raylib)"
mkdir -p build/
# cp -r $RAYLIBDIR/lib build/
gfortran $FFLAGS -J build/ -o build/2048 $SRC $LIBS
elif [[ "$OSTYPE" == "cygwin" ]]; then
# POSIX compatibility layer and Linux environment emulation for Windows
echo "[INFO] Détection d'une machine Windows MinGW"
echo "[INFO] La compilation sous Windows n'est pas encore testée."
echo "[INFO] Compilation en cours..."
LIBS="-I$RAYLIBDIR/include -L$RAYLIBDIR/lib -lraylib -Wl,-rpath=lib/"
mkdir -p build/
cp -r $RAYLIBDIR/lib build/
gfortran $FFLAGS -J build/ -o build/2048.exe $SRC $LIBS
elif [[ "$OSTYPE" == "msys" ]]; then
# Lightweight shell and GNU utilities compiled for Windows (part of MinGW)
echo "[INFO] Détection d'une machine Windows MinGW"
echo "[INFO] La compilation sous Windows n'est pas encore testée."
echo "[INFO] Compilation en cours..."
LIBS="-I$RAYLIBDIR/include -L$RAYLIBDIR/lib -lraylib -Wl,-rpath=lib/"
mkdir -p build/
cp -r $RAYLIBDIR/lib build/
gfortran $FFLAGS -J build/ -o build/2048.exe $SRC $LIBS
# ...
else
echo "OS Inconnu"
fi
# LIBS="-I ./include/ -L ./lib/ -lraylib -lglfw -lpthread -ldl"
#LIBS="-I ./include/ -L ./lib/ -lraylib -Wl,-rpath=./lib/ -lc -lgfortran -lm"