makefile

This is a discussion on makefile within the Linux Programming forums, part of the Platform Specific Boards category; hay I have some problems with makefiles and I would appreciate any help first: I try to write a basic ...

  1. #1
    Registered User
    Join Date
    Jan 2009
    Posts
    5

    makefile

    hay
    I have some problems with makefiles and I would appreciate any help
    first:
    I try to write a basic makefile which looks like
    Code:

    read_init: read_initCon.c
    <tab>gcc -o read_init read_initCon.c -lm

    but the result is not the compilation of my program but the second line is printed to the shell and thats it... if I delete -lm at the end, the compilation is working, but I need the link, so the compilation is not successful. Where is my mistake?

    second: I have some Makefiles in a folder and they are named like galaxy.Makefile, cluster.Makefile etc. Does anybody know how I can execute this makefiles?
    thanks for any help
    best regards
    florian

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Without knowing exactly what error you get, I can't really say what is going wrong in your simple makefile - it looks fine as posted.

    If you want make to use a file not called Makefile or makefile, then
    Code:
    make -f somefilename
    will do the job of using "somefilename" as the input file.

    --
    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
    Jan 2009
    Posts
    5

    thanks

    thanks for the answer. I solved the problem with the makefile... just stupidity...:-)
    best regards
    florian

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Makefile Problem: None rule to make target
    By chris24300 in forum Linux Programming
    Replies: 25
    Last Post: 06-17-2009, 09:45 AM
  2. Building a project using a Makefile
    By starcatcher in forum Windows Programming
    Replies: 2
    Last Post: 11-23-2008, 10:50 PM
  3. unix makefile won't work but works in Dev C++
    By jk1998 in forum C++ Programming
    Replies: 1
    Last Post: 06-09-2007, 03:54 PM
  4. makefile blues....
    By WaterNut in forum C Programming
    Replies: 6
    Last Post: 05-30-2005, 08:22 PM
  5. Need help with Makefile
    By xshapirox in forum C++ Programming
    Replies: 14
    Last Post: 09-28-2004, 03:32 PM

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