- Published
- Author
- Vaibhav YadavSenior System Analyst
Using Makefile for tedious commands
A Makefile can be used to automate a commands, simplifying the execution process. Hereβs a concise example:
Running the Makefile
1. Create a Makefile: Save the above content as Makefile in your project directory.
2. Run Make: In your terminal, navigate to the project directory and execute:
Benefits
β’ Simplicity: Easily run a long command without remembering the syntax.
β’ Automation: Reduces manual effort and potential errors.
#cli #automation #makefile #commands
A Makefile can be used to automate a commands, simplifying the execution process. Hereβs a concise example:
Code
.PHONY: run-script
# Target to run a long command
run-script:
@echo "Running a long command..."
sleep 5 # Simulate a long-running command
@echo "Command completed."Running the Makefile
1. Create a Makefile: Save the above content as Makefile in your project directory.
2. Run Make: In your terminal, navigate to the project directory and execute:
Code
make run-scriptBenefits
β’ Simplicity: Easily run a long command without remembering the syntax.
β’ Automation: Reduces manual effort and potential errors.
#cli #automation #makefile #commands