Search notes:

make: pattern rules

Example

The following Makefile builds executable if the current directory contains the four c files prog.c, foo.c, bar.c and baz.c.
executable: main.o foo.o bar.o baz.o
	$(CC) $^ -o $@

%.o : %c
	$(CC) $(CFLAGS) -c $<
Github repository about-Makefile, path: /rule/pattern/example-1/Makefile

See also

make

Index