Thread: Makefiles

  1. #1
    Registered User
    Join Date
    Mar 2002
    Posts
    51

    Makefiles

    Can someone explain to me how microsoft visual c++ handles make file? I remember in unix that "makefile" can be run to create a a.out just by typing "makefile". How can I do something similar in visual c++?

    thx
    Which is the master, which is the student?

  2. #2
    geek SilentStrike's Avatar
    Join Date
    Aug 2001
    Location
    NJ
    Posts
    1,141
    It handles the compiling/linking itself.. you don't have to muck with makefiles.
    Prove you can code in C++ or C# at TopCoder, referrer rrenaud
    Read my livejournal

  3. #3
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    Code:
    Foo.exe : Foo.obj
            link Foo.obj user32.lib gdi32.lib
    
    Foo.obj : Foo.cpp
            cl -c Foo.cpp
    That's pretty much the composition on a simple makefile. In this case I'd name that Foo.mak. When running in a build enviornment under VC++ just go to the directory and type "NMAKE /F FOO.MAK" and it should handle everything for you. Also in VC++ if you go to NEW there is an option to make a makefile but I have never personally tryed it. Hope this helps.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Makefiles, GCC's -ggdb option, and Valgrind
    By Jesdisciple in forum C Programming
    Replies: 5
    Last Post: 03-14-2009, 04:25 PM
  2. Makefiles
    By TriKri in forum Windows Programming
    Replies: 3
    Last Post: 03-30-2008, 06:57 AM
  3. Benefits of makefiles
    By Ganoosh in forum C++ Programming
    Replies: 2
    Last Post: 06-27-2005, 09:42 PM
  4. programming linux with gcc, emacs, and makefiles
    By Captain Penguin in forum Linux Programming
    Replies: 1
    Last Post: 11-02-2002, 12:04 PM
  5. Help with Makefiles
    By WebmasterMattD in forum Linux Programming
    Replies: 3
    Last Post: 05-24-2002, 08:51 AM