I would like learn how to write Makefile and some issues:
My questions is:Code:objects = foo.o bar.o all: $(objects) $(objects): %.o: %.c $(CC) -c $(CFLAGS) $< -o $@
1)what does "all: %(objects)" mean? without this line, does it still work?
2)%.o equal to "foo.o bar.o", % equal to "foo bar" or *? In others words, % equal to all files? %.c equal to "foo.c bar.c" or "*.c"?
My material about Makefile is very limited, mainly for gcc and g++. Would you please tell me some material which clarifes Makefile in detail?
Thanks!
Bookmarks