When I was working with a lot of small source files for my C & C++ class projects, I created this script to simplify the task of compilation.
Just insert the name of the file after command and it'll do the everything you need like build, run, test etc.
I also added the capability to do memory test using valgrind later to help in data structure and algorithms class.
For detailed instructions and benefits see the description and use cases below.
If you're interested and want to contribute, send a patch or contact me if you need help/ideas. I'd really appreciate your help.
A tool to quickly compile and run different source files using same command
Universal Compiler allows you to quickly compile, build and run files. Universal Compiler make it very easy to compile any source code and create & execute corresponding files.
Let us say you want to compile batman.c.
gcc -g -O2 -std=gnu99 -static -Wall -Wextra -Isrc -rdynamic -fomit-frame-pointer -o batman.out batman.c -lm -lrt
That is around 114 keystrokes with these options that I use for ICPC practice. Now you need to type
./batman.out to execute.
How Universal Compiler helps you in programming?
You just need to type
Typing effort is reduces even more if you use tab for filename prediction i.e type
u followed by space and then first word of file
b and hit tab. Voila, hit enter.
After pressing enter universal compiler will do following things for you:
- It will compile your batman.c (with a lot of awesome gcc commandline options & flags already set).
- After compiling it will create an executable named batman.out
- Give you instructions to copy-paste for editing or executing.
- You may also use
u batman.out to execute the executable just created.
Universal Compiler way:
With universal compiler installed you just need to type 3 keystrokes to compile and execute any type of source code.
Best part you don't need to remember anything, not even the name of compiler. Forget the command name & its syntax and all those stupid, long but helpful command line options which are different for each compiler.
You can use the same command/syntax
u filename.extension to build & run any source code. Yes any type of source file. Universal Compiler will either run it or tell you how to install its compiler. Universal Compiler supports a large variety of languages including c, c++, java, python and many more.
To install download the files by clicking here
and unzip & run the install
You need to run it in the source directory, the one where you unzipped. Please provide password when required. You can always type
to get installation help directly
After completing installation you can type command name
universal --help or
universal -h or the easiest and fastest version of command
u -h and just hit enter to get usage instruction and help.
List of command line options:
u --help or
u -h - get help
u --update or
u -u - update software to the latest developement version with many bug fixes
u --download or
u -d - download latest source code in a .zip file
u --problem or
u -p - Report problems, bugs, issues etc.
u .c t - Perform a memory test while running the executable
To get latest version of Universal Compiler type
or Click here
It is recommended that you update the software after every few weeks.