3 # Optional helper build script for Anarch.
4 # by drummyfish, released under CC0 1.0, public domain
8 # ./make.sh platform [compiler]
11 echo "need a parameter (sdl, pokitto, gb, emscripten, ...)"
17 C_FLAGS
="-std=c99 -Wall -Wextra -pedantic -O3 -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -o anarch"
24 if [ $2 = "tcc" ]; then # you'll probably want to modify this
25 C_FLAGS
="${C_FLAGS} -L/usr/lib/x86_64-linux-gnu/pulseaudio/
26 -I/home/tastyfish/git/tcc/tcc-0.9.27/include
27 -I/usr/lib/gcc/x86_64-linux-gnu/8/include/"
33 if [ $1 = "sdl" ]; then
34 # PC SDL build, requires:
36 # - SDL2 (dev) package
38 SDL_FLAGS
=`sdl2-config --cflags --libs --static-libs`
39 COMMAND
="${COMPILER} ${C_FLAGS} main_sdl.c -I/usr/local/include ${SDL_FLAGS}"
44 elif [ $1 = "ncurses" ]; then
45 # ncurses build, requires:
48 COMMAND
="${COMPILER} ${C_FLAGS} -lncurses main_ncurses.c"
53 elif [ $1 = "saf" ]; then
54 # SAF build using SDL, requires:
56 # - SDL2 (dev) package
58 SDL_FLAGS
=`sdl2-config --cflags --libs --static-libs`
59 COMMAND
="${COMPILER} ${C_FLAGS} main_saf.c -I/usr/local/include ${SDL_FLAGS}"
64 elif [ $1 = "terminal" ]; then
65 # PC terminal build, requires:
68 COMMAND
="${COMPILER} ${C_FLAGS} main_terminal.c"
73 elif [ $1 = "csfml" ]; then
74 # csfml build, requires:
77 COMMAND
="${COMPILER} ${C_FLAGS} main_csfml.c -lcsfml-graphics -lcsfml-window -lcsfml-system -lcsfml-audio"
82 elif [ $1 = "test" ]; then
83 # test build, requires:
86 COMMAND
="${COMPILER} ${C_FLAGS} main_test.c"
91 elif [ $1 = "pokitto" ]; then
92 # Pokitto build, requires:
93 # - PokittoLib, in this folder create a symlink named "PokittoLib" to the
94 # "Pokitto" subfolder of PokittoLib
96 # - GNU embedded toolchain, in this folder create a symlink named "gtc" to the
98 # - files like My_settings.h required by Pokitto
101 .
/PokittoEmu BUILD
/firmware.bin
102 elif [ $1 = "emscripten" ]; then
103 # emscripten (browser Javascript) build, requires:
106 ..
/emsdk
/upstream
/emscripten
/emcc .
/main_sdl.c
-s USE_SDL
=2 -O3 -lopenal --shell-file HTMLshell.html
-o anarch.html
-s EXPORTED_FUNCTIONS
='["_main","_webButton"]' -s EXPORTED_RUNTIME_METHODS
='["ccall","cwrap"]'
108 echo "unknown parameter: $1"