Results 1 to 9 of 9

Thread: Help-Makefile issue

Threaded View

  1. #1
    Join Date
    Feb 2012
    Beans
    93

    Help-Makefile issue

    I would like learn how to write Makefile and some issues:

    Code:
       objects = foo.o bar.o
    
        all: $(objects) 
    
        $(objects): %.o: %.c
                $(CC) -c $(CFLAGS) $< -o $@
    My questions is:

    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!
    Last edited by pellyhawk; July 24th, 2012 at 07:53 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •