Our server costs ~$56 per month to run. Please consider donating or becoming a Patron to help keep the site running. Help us gain new members by following us on Twitter and liking our page on Facebook!
Current time: July 14, 2025, 11:26 am

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Writing scripts for UNIX-like operating systems
#13
RE: Writing scripts for UNIX-like operating systems
I have modified the shell script to compile Analog Clock for x86, so that it might be able to run on Windows. Here is what it looks like now:
Code:
mkdir ArithmeticExpressionCompiler
cd ArithmeticExpressionCompiler
if [ $(command -v wget > /dev/null 2>&1 ; echo $?) -eq 0 ] # Check if "wget" exists, see those StackOverflow answers for more details:
                                                                                         # https://stackoverflow.com/a/75103891/8902065
                                                                                         # https://stackoverflow.com/a/75103209/8902065
then
  wget https://flatassembler.github.io/Duktape.zip
else
  curl -o Duktape.zip https://flatassembler.github.io/Duktape.zip
fi
unzip Duktape.zip
if [ $(command -v clang > /dev/null 2>&1 ; echo $?) -eq 0 ] # We prefer "clang" to "gcc" because... what if somebody tries to run this in CygWin terminal? GCC will not work then, CLANG might.
then
  c_compiler="clang"
else
  c_compiler="gcc"
fi
$c_compiler -o aec aec.c duktape.c -lm # The linker that comes with recent versions of Debian Linux insists that "-lm" is put AFTER the source files, or else it outputs some confusing error message.
if [ "$OS" = "Windows_NT" ]
then
  ./aec analogClockForWindows.aec
  $c_compiler -o analogClockForWindows analogClockForWindows.s -m32
  ./analogClockForWindows
else
  ./aec analogClock.aec
  $c_compiler -o analogClock analogClock.s -m32
  ./analogClock
fi
Reply



Messages In This Thread
RE: Writing scripts for UNIX-like operating systems - by FlatAssembler - January 17, 2023 at 12:55 pm

Possibly Related Threads...
Thread Author Replies Views Last Post
  License for operating social media Fake Messiah 2 1163 December 16, 2022 at 10:41 pm
Last Post: Rev. Rye
  TempleOS: a Christian Operating System Rev. Rye 5 1697 December 23, 2018 at 12:32 pm
Last Post: Rev. Rye
  Operating systems Wars! Sterben 60 8128 March 14, 2017 at 8:49 pm
Last Post: Sterben
  Using SSDs for dual boot systems emjay 9 2251 November 8, 2016 at 7:33 pm
Last Post: emjay



Users browsing this thread: 1 Guest(s)