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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Makefile...?

  • 24-08-2009 10:15pm
    #1
    Registered Users, Registered Users 2 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, Registered Users 2 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, Registered Users 2 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, Registered Users 2 Posts: 3,945 ✭✭✭Anima


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


Advertisement