CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2005
    Posts
    58

    how to write makefile

    suppose I have a project named Proj, which include to folders, one is Proj1, another is Prjo2;
    in Proj1, there are 3 cpp files : p1.cpp, p2.cpp, p3.cpp
    in Proj2, there are another 2 files: p4.cpp, p5.cpp, p6.cpp

    now I need write makefile to compile the Proj in linux environment. I think each folder there need a makefile, so total 3 makefiles are needed. How to write the makefiles to compile the project? Thanks!

  2. #2
    Join Date
    Jan 2005
    Posts
    58

    Re: how to write makefile

    Nodody wants to help?
    Then how to link several object file into one object file, rather than an executable file?



    Quote Originally Posted by greghua
    suppose I have a project named Proj, which include to folders, one is Proj1, another is Prjo2;
    in Proj1, there are 3 cpp files : p1.cpp, p2.cpp, p3.cpp
    in Proj2, there are another 2 files: p4.cpp, p5.cpp, p6.cpp

    now I need write makefile to compile the Proj in linux environment. I think each folder there need a makefile, so total 3 makefiles are needed. How to write the makefiles to compile the project? Thanks!

  3. #3
    Join Date
    Apr 2004
    Location
    In the back seat of New Horizons.
    Posts
    1,238

    Re: how to write makefile

    I don't know how to write a Makefile myself, but here is a tutorial that I found.

    If you can, find an existing Makefile and study it, play around with the different file names and such and see what you get, it will help you learn how to write an actual Makefile.
    Here are the rules, you must obey them or the gender bender will get you.

    And if you ever think of posting without code-tags, the evil monkey will come after you.

  4. #4
    Join Date
    May 2003
    Location
    Islamabad, Pakistan
    Posts
    284

    Arrow Re: how to write makefile

    I think you sould post you question to www.linuxquestions.org

    From there you can get answer of your linux related questions.

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

Featured