how to use makefile?

Discussion in 'Programmer's Corner' started by simplytuff, Aug 26, 2010.

  1. simplytuff

    Thread Starter Active Member

    Mar 21, 2008
    37
    0
    I am working on a project which includes programming MSP430-449STK2 development board by Olimex,


    i am totally new to programming, i need to know how to make binary file using the header files which came with the program?

    the project instructions say

    "The software is written in C using the MSPGCC (http://mspgcc.sourceforge.net/), a port of the GCC to the MSP platform. The JTAG debugger is from Olimex (MSP430-JTAG http://www.olimex.com) and is used to download the firmware into the MSP430.

    The firmware comes with a makefile – unzip the sources to any directory and run make"
     
  2. davebee

    Well-Known Member

    Oct 22, 2008
    539
    46
    "make" is a program that reads a text file of instructions, then performs the instructions.

    Usually the instructions are things like calling a compiler to compile source code with a number of library files, sometimes calling a linker program, sometimes renaming and moving the resulting files elsewhere in your system.

    The point of a makefile is that somebody can supply you with the make text file so you don't need to know all the details. If they have done a good job, all you need to do is to unzip the zipfile to a directory, navigate a command console to that directory and type "make".

    It is not unusual for problems to come up. If that happens, then you might have a difficult time getting anywhere if you're totally new to programming.
     
  3. stellarpower

    Member

    Feb 19, 2009
    28
    0
    If you're using Linux or a posix-compliant OS (don't worry if you don't know what that means) you should be able to open a terminal/command prompt/console and use cd to go to the unzipped folder. Then, type ./configure and it should start to work out how to change itself based on your system. After that, type make and when that's finished, usually make install. If it doesn't work well, don't worry. It should make things easy, but I've never managed to get it to work successfully.
     
  4. simplytuff

    Thread Starter Active Member

    Mar 21, 2008
    37
    0
    where can i find command console?

    i am using windows 7!
     
  5. retched

    AAC Fanatic!

    Dec 5, 2009
    5,201
    312
  6. simplytuff

    Thread Starter Active Member

    Mar 21, 2008
    37
    0
    Command Prompt doesn't seem to recognize any of the commands, i have tried several !

    below is a screen shot from instructions, when i try "make" nothing happens1

    [​IMG]
     
  7. someonesdad

    Senior Member

    Jul 7, 2009
    1,585
    141
    make is a program, just like any other tool. There are probably many ways of getting it on Windows; here are two:

    1. Install cygwin and ensure that the proper package is installed that includes make.
    2. Install MSYS from MinGW.
    Unless you're familiar with UNIX-type stuff, I don't recommend cygwin because you'll likely get hopelessly confused by all the stuff (it's actually pretty simple, but you won't grok that until after you've learned to deal with the complexity). MSYS is intended to give you tools like bash, make, awk, and grep (basic UNIX-type utilities); this is to be able to let you use mingw to build things that e.g. use the autotools framework.

    You can get by without using make; this can be done by reading the makefile and understanding its instructions. If you already have make, you can type 'make -n <target_to_build>' and see what will be done. Then you can replace those commands with e.g. a batch file to do the work (but you won't have the build avoidance benefits of make).

    You could post the makefile in this thread and one of us could run 'make -n' for you, so that might be a nice workaround.
     
  8. simplytuff

    Thread Starter Active Member

    Mar 21, 2008
    37
    0
Loading...