Results 1 to 5 of 5

Thread: Need help creating a makefile(unix)

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2005
    Posts
    112

    Need help creating a makefile(unix)

    Basically this is what I want the makefile to do:

    # Compile cpp2html.c to produce cpp2html.o.
    # Run the command

    flex cppscanner.l

    to produce the file lex.yy.c from the language description in cppscanner.l.
    # Compile lex.yy.c to produce lex.yy.o. (This often produces a warning message about extra tokens. Ignore it.)
    # Link the the .o files to produce an executable program named cpp2html
    Here is the current makefile I have and I was told the commands are not correct:
    CC=gcc
    cpp2html: cpp2html.o lex.yy.c lex.yy.o
    $(CC) -o cpp2html cpp2html.o lex.yy.c lex.yy.o

    cpp2html.o : cpp2html.c
    $(CC) -c cpp2html.c

    lex.yy.c: cppscanner.l
    flex cppscanner.l

    lex.yy.o : lex.yy.c
    $(CC) -c lex.yy.c
    I've also attached a text file with the error I receive.
    Attached Files Attached Files
    Last edited by celtik; Dec 6th, 2010 at 05:30 PM.

Posting Permissions

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



Click Here to Expand Forum to Full Width