Hands-on task
Object list from wildcard and substitution
In /root/proj there are several *.c files (how many and how they're named is not known in advance). Write a Makefile that finds all the .c files itself via $(wildcard *.c), derives a list of .o files from their list by suffix substitution ($(SRC:.c=.o)), and builds each .o from its .c with a pattern rule (which is really just a copy). A bare make (the all target) should build an .o for each .c. The Makefile is handy to write in the Editor tab above the terminal: in a Makefile it puts a real TAB at the start of a recipe line.
- make
- wildcard
- suffix substitution
- pattern rules