Cleaned up and fixed os4build.sh

This commit is contained in:
George Sokianos 2022-01-11 22:49:14 +00:00
parent 7a347ca436
commit 1279fde93b
1 changed files with 19 additions and 31 deletions

View File

@ -1,44 +1,32 @@
#!/bin/bash #!/bin/bash
cflags="-D__USE_INLINE__ -DLITE_XL_DATA_USE_EXEDIR -DLITE_USE_SDL_RENDERER -Wall -O3 -std=gnu11 -fno-strict-aliasing -Isrc -Ilib/font_renderer -I/sdk/local/newlib/include/SDL2 -lSDL2 -llua -lauto"
#cflags+=" $(pkg-config --cflags lua5.2) $(sdl2-config --cflags)"
lflags="-mcrt=newlib -static-libgcc -static-libstdc++ -lSDL2 -lagg -lfreetype -llua -lm -lpthread -athread=native"
#for package in libagg freetype2 lua5.2; do
# lflags+=" $(pkg-config --libs $package)"
#done
#lflags+=" $(sdl2-config --libs) -lm"
#if [[ $* == *windows* ]]; then
# echo "cross compiling for windows is not yet supported"
# exit 1
#else
outfile="lite" outfile="lite"
compiler="gcc" compiler="gcc"
cxxcompiler="g++" cxxcompiler="g++"
#fi
#lib/font_renderer/build.sh || exit 1 INCPATH="-Isrc -Ilib/font_renderer -I/sdk/local/newlib/include/SDL2"
#libs=libfontrenderer.a DFLAGS="-D__USE_INLINE__ -DLITE_XL_DATA_USE_EXEDIR -DLITE_USE_SDL_RENDERER"
libs="-lfontrenderer" CFLAGS="-Wall -O3 -std=gnu11 -fno-strict-aliasing"
LFLAGS="-mcrt=newlib -static-libgcc -static-libstdc++ -lauto -lSDL2 -lfontrenderer -lagg -lfreetype -llua -lm -lpthread -athread=native"
echo "compiling lite..." echo "compiling lite..."
gcc -c $cflags src/fontdesc.c -o fontdesc.o gcc -c src/fontdesc.c -o fontdesc.o $CFLAGS $INCPATH $DFLAGS
gcc -c $cflags src/main.c -o main.o gcc -c src/main.c -o main.o $CFLAGS $INCPATH $DFLAGS
gcc -c $cflags src/rencache.c -o rencache.o gcc -c src/rencache.c -o rencache.o $CFLAGS $INCPATH $DFLAGS
gcc -c $cflags src/renderer.c -o renderer.o gcc -c src/renderer.c -o renderer.o $CFLAGS $INCPATH $DFLAGS
gcc -c $cflags src/renwindow.c -o renwindow.o gcc -c src/renwindow.c -o renwindow.o $CFLAGS $INCPATH $DFLAGS
gcc -c $cflags src/api/api.c -o api.o gcc -c src/api/api.c -o api.o $CFLAGS $INCPATH $DFLAGS
gcc -c $cflags src/api/cp_replace.c -o cp_replace.o gcc -c src/api/cp_replace.c -o cp_replace.o $CFLAGS $INCPATH $DFLAGS
gcc -c $cflags src/api/renderer.c -o apirenderer.o gcc -c src/api/renderer.c -o apirenderer.o $CFLAGS $INCPATH $DFLAGS
gcc -c $cflags src/api/renderer_font.c -o renderer_font.o gcc -c src/api/renderer_font.c -o renderer_font.o $CFLAGS $INCPATH $DFLAGS
gcc -c $cflags src/api/system.c -o system.o gcc -c src/api/system.c -o system.o $CFLAGS $INCPATH $DFLAGS
gcc -c $cflags src/platform/amigaos4.c -o amigaos4.o gcc -c src/platform/amigaos4.c -o amigaos4.o $CFLAGS $INCPATH $DFLAGS
echo "linking..." echo "linking..."
g++ -o $outfile *.o $libs $lflags g++ -o $outfile *.o $LFLAGS
echo "cleaning up..." echo "cleaning up..."
rm *.o rm *.o