|
% = wildcard character - match 0 or more characters
$< = first item in the list of dependent filenames
$^ = all items in the list of dependent filenames
$@ = current target name including the extension
$* = current target name not including the extension
|
%.o: %.c func5b.h
gcc -c $<
|
Meaning:
|
main: func5a.o func5b.o gcc -o main func5a.o func5b.o func5a.o: func5a.c func5b.h gcc -c func5a.c func5b.o: func5b.c func5b.h gcc -c func5b.c |
main: func5a.o func5b.o
gcc -o main func5a.o func5b.o
%.o: %.c func5b.h
gcc -c $<
|
main: func5a.o func5b.o
gcc -o $@ $^
# $@ = current target name including the extension (= main)
# $^ = all items in the list of dependent filenames (= func5a.o func5b.o)
%.o: %.c func5b.h
gcc -c $<
|
How to run the program:
|