How to create a Makefile?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Chris Winton
    New Member
    • Jan 2011
    • 22

    How to create a Makefile?

    Help! I need urgent help in creating a Makefile for 2 c source codes which are gen3D.c and KalmanTrack.c which i wish to link together and don't understand the correct syntax to create a makefile.

    Help would be much appreciated.
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    Makefiles nowadays are created by your IDE, like Visual Studio, rather than by hand. The fact that you need one inidcates you are on a non-Windows machine. That being the case, check your man pages for make. Also, the OReilly book on make has this information.

    Comment

    • Banfa
      Recognized Expert Expert
      • Feb 2006
      • 9067

      #3
      That is not strictly true weaknessforcats , make files (or their equivalent) can be created by most IDEs but you can create them by hand should you wish to, or have a good reason too like for instance you want to be sure that the makefile will work on all platforms you are using if you are targeting multiple platforms.

      Chris Winton not all make engines use precisely the same language in their make files so it rather depends on whose make engine (executable) you are using.

      Start, obviously, by downloading the documentation for the make engine you are using and read it.

      Alternatively if it really is urgent just download an IDE and create a project in that add your source files and then have the IDE output a make file.
      Last edited by Banfa; Mar 29 '11, 08:55 AM.

      Comment

      • donbock
        Recognized Expert Top Contributor
        • Mar 2008
        • 2427

        #4
        Warning: the space and tab characters are not always interchangeable in make. Be careful to use the proper whitespace characters.

        Comment

        Working...