This folder contains a script that allow Termux user to compile and run a script written in C/C++ language in an easy way (or shortcut).
bash x-clang.sh %script.c% [-e[-b]]
Required clang
& gcc
package to be installed
Parameters
- "-d = Prevent clearing the terminal"
- "-c = Compile only. This things also display warnings if possie"
- "-r = Execute current a.out file or the given filename in current directory"
- "-clear = Will clear left over binary file from temp directory"
$ bash script.sh myscript.c # Compile and Run C Language
$ bash script.sh myscript.cpp # Compile and Run C++ Language
$ bash script.sh myscript.c -c # Compile C Language Only
$ bash script.sh myscript.cpp -c # Compile C++ Language Only
$ bash script.sh myscript.c # Compile, clear the screen and run C Language
$ bash script.sh myscript.cpp # Compile, clear the screen and Run C++ Language
$ bash script.sh -r # Run the a.out binary file from current directory
$ bash script.sh -r %binaryfile% # Run the custom named binary file
The script is written in a common way. [I actually don't know what to say =)]
- clang
- g++
- gcc
- mv
- chmod
- rm
- cp
- clear
- exit
Enjoy