Make Utility Classwork: Work individually on the following tasks. Before You Start: - Command-Line Shell: Use "Bash" (Git for Windows) or "Terminal" (Mac). - Text Editor: Use "Notepad++" or your preferred editor. - Windows Users Only: Install the "make" command. See class webpage > "Start here" > "Only for Windows users" - Access to Linux/Unix Commands Sheet: Unix Commands PDF. http://www.cs.utexas.edu/~fares/cs330ef25/CS%20373_files/tutorials/UnixCommands.pdf Tasks: 1. Create a Python File: Name: "Avg.py" Content: def avg(marks): assert len(marks) != 0 return sum(marks)/len(marks) print("The average of 1, 2, and 3 is", avg([1,2,3])) - Note: Type the code manually instead of copying and pasting. 2. Run the Python File: - Command: "$ python Avg.py" - Expected Output: "The average of 1, 2, and 3 is 2.0" 3. Redirect Output to a File: - Command: "$ python Avg.py > Output.txt" - Question 1: What is the difference between the output of steps 2 and 3? 4. Delete Output File: - Command: "$ rm Output.txt" Note: This ensures your next make run shows the effect clearly 5. Verify Deletion: - Command: $ ls - Question 2: Do you see "Output.txt" listed? 6. Create a Makefile: - In the same directory as Avg.py, create a file named makefile with the following content: Output.txt: @echo "Creating Output.txt" python Avg.py > Output.txt - Question 3: Identify the target, dependencies, and actions in this make rule. 7. Run Make Command: - Command: "$ make Output.txt" - Question 4: What do you see as output? 8. List Files: - Command: "$ ls" - Question 5: Do you see "Output.txt"? 9. Re-run Make Command: Notice how make behaves differently depending on whether files are new, deleted, or updated - Command: "$ make Output.txt" - Question 6: What do you see as output? Why? 10. Delete Output File Again: - Command: "$ rm Output.txt" 11. Verify Deletion Again: - Command: "$ ls" 12. Update Makefile: - Add "Avg.py" as a dependency: Output.txt: Avg.py @echo "Creating Output.txt" python Avg.py > Output.txt 13. Run Make Command with Updated Makefile: - Command: "$ make Output.txt" - Question 7: What do you see the output displayed on the monitor? Note: "$" just represents the shell prompt. don’t type the $ itself. 14. Re-run Make Command Again: - Command: $ make Output.txt - Question 8: What do you see as output? Why? 15. Modify Python File: - Open "Avg.py", add a comment or print statement, and save the file. 16. Re-run Make Command After Modification: - Command: "$ make Output.txt" - Question 9: What do you see as output? Why?