Problem with makefile

This is a discussion on Problem with makefile within the C++ Programming forums, part of the General Programming Boards category; Hi guys I have been given some code for a GAs program. It has five main and its all make ...

  1. #1
    Registered User
    Join Date
    May 2008
    Posts
    16

    Problem with makefile

    Hi guys

    I have been given some code for a GAs program. It has five main and its all make with just one makefile. The code was originally writtern in the Mac environment. My question is, is it possible in the window environment to use just one makefile to make all five program. If so, could someone please tell me how? I am currently using code::block, but also have access to VSC++ express. I am dying to get these code to compile, so please help

    Regards

    Grasshopper Esq.

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    So, do you want an explanation of how to change the makefile to produce .exe files for Windows, or an explanation of how you make Code::Blocks projects from a makefile?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    May 2008
    Posts
    16
    Hi buddy

    Sorry for not explaining properly, basiclly my teacher wants me to find a way to compile the programs using only one makefile, but they are 5 individual programs with 5 independent entry points (main). I was told the syntax and code are slightly different for the make in the window system. I know I can tell the IDE which makefile to use. Maybe i just need to change the details.
    Should i post the makefile on the board

    Many thanks

    Grasshopper Esq.

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Ok, so assuming these are independent executables, the normal way to do this to have a pseudo-target [which is called something else in Makefile terms] - usually called "all" so that you can type "make all" to get everything you'd expect:
    Code:
    all: app1 app2
    
    app1: ... dependent files needed by app1
           ... do stuff to build app1
    
    app2: ... dependent files needed by app2
           ... do stuff to build app2
    I hope this helps.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM
  2. problem with Makefile separator
    By luca in forum Tech Board
    Replies: 6
    Last Post: 01-15-2007, 09:20 AM
  3. Problem with makefile, how to use the -lm oh this?
    By Nazgulled in forum C Programming
    Replies: 1
    Last Post: 04-07-2006, 01:29 PM
  4. Laptop Problem
    By Boomba in forum Tech Board
    Replies: 1
    Last Post: 03-07-2006, 05:24 PM
  5. Replies: 5
    Last Post: 11-07-2005, 10:34 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21