Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Makefile...?

Options
  • 24-08-2009 11:15pm
    #1
    Registered Users Posts: 170 ✭✭


    I need to create a makefile to submit for a competition in college, i got all the code written and the program works ok...
    But i dunno how to create a makefile, I know what it is from looking it up on the web but dunno how to make one.

    Im programming in C++, and tryed Dev C++ and Visual C++... Can you create the makefile from these programs?


Comments

  • Registered Users Posts: 3,945 ✭✭✭Anima


    If you dont have many files in the project or libraries/depenancies, they're really easy to make. Even then, its just takes a bit of time typing it out. Just follow a tutorial and adapt it for you're own program.


  • Hosted Moderators Posts: 7,486 ✭✭✭Red Alert


    Visual-C++ doesn't need a Makefile per-se, since it handles dependency tracking internally AFAIK. There's plenty of examples of them on the net, but this should give you a rough idea. (I've done it for the GCC compiler):


    program.exe: file1.obj file2.obj
    gcc -o program.exe file1.obj file2.obj

    %.obj: %.cpp
    gcc -c $<.cpp


  • Registered Users Posts: 170 ✭✭sudzy


    ok, i still don't get it...
    say i have a single source file, source.cpp, for example..

    how what would a makefile look like for that?
    and what are file1.obj, file2.obj?


  • Registered Users Posts: 3,945 ✭✭✭Anima


    Think this should cover it: http://mrbook.org/tutorials/make/


Advertisement