As an ALX student, are you tired of having to compile your C programs everytime using this 'long command':
pasmac@ubuntumachine$: gcc -Wall -Werror -Wextra -pedantic -std=gnu89 examplefile.c
then having to run it afterwards to see its result?
pasmac@ubuntumachine$: ./a.out
*** USING THE "comrunc" COMMAND WILL RESOLVE THIS FOR YOU! ***
- Clone this repository:
pasmac@ubuntumachine$: git clone https://github.com/PaschalPM/compile_and_run_c.git
- CD into compile_and_run_c repository:
pasmac@ubuntumachine$: cd compile_and_run_c
- Run the install script:
pasmac@ubuntumachine$: sudo ./install.sh
-
pasmac@ubuntumachine$: comrunc example.c
NOTE: If you do not specify a second argument, the output file will be "a.out" as usual.
-
pasmac@ubuntumachine$: comrunc "example1.c example2.c example3.c"
NOTE: Use double quotes to hold together all C files you wish to compile.
-
pasmac@ubuntumachine$: comrunc example.c outputfile
-
pasmac@ubuntumachine$: comrunc "example1.c example2.c example3.c" outputfile
NOTE: The specified outputfile comes after the double quotes.
The comrunc command detects when you pass in an outputfile argument or a stage switch flag argument (Preprocessing -E, Compilation -S, Assembly -c) or both and gives the result of the specified stage regardless of how the arguments are arranged.
pasmac@ubuntumachine$: comrunc "example1.c example2.c example3.c" outputfile -E
OR
pasmac@ubuntumachine$: comrunc "example1.c example2.c example3.c" -E outputfile
The above commands will give same result which is the Preprocessing Stage output of the compiled files. Please NOTE, when using any of the stage switch flags, the program is not ran automatically after compilation.