Ensure you have the following installed:
- GCC (GNU Compiler Collection)
- Make
-
Clone the Repository
git clone <repository_url> cd makefile_assignment
-
Build and run the program using the default rule (first rule)
make
-
Build and run the program
make
This command compiles the source files, creates the executable, and runs it automatically.
-
Clean the build files
make clean
This command removes the compiled object files and the executable.
-
Rebuild the program
make rebuild
This command cleans the build files, recompiles the source files and runs the program.
-
Print the value of a Make variable
make print-VARIABLE_NAME
This command prints the value of the specified make variable.
-
Generate assembly files
make filename.s
This command generates an assembly file from the specified source file (replace
filename
with the actual source file name without the.c
extension).