Thread: Can't make sense of the makefile

  1. #1
    Registered User
    Join Date
    Aug 2010
    Posts
    9

    Can't make sense of the makefile

    To be honest, I've zero experience in C programming, so, give me just a minute.
    There is a free program that I need for my research, it's available only as C code, not as executables or anything, so, I grabbed the code.
    I've tried a couple of compilers, but they seem to have a problem with the makefile.

    Checking the readme, it says that the program "should" work on windows though it was written on Unix, I searched the forum here and I could conclude that makefile isn't usually portable from one platform to another, I tried to follow the quotes on the makefile, but having almost zero exp in C didn't help.

    Is there any specific advice on how to move forward?
    The program is available legally for free, I could provide a link if that's alright.

  2. #2
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675
    I think you're going to need to provide the link. You may need other software to do what you need to do.

  3. #3
    Registered User
    Join Date
    Aug 2010
    Posts
    9
    Here is the link from CSU "Colorado State University".
    http://www.cs.colostate.edu/~ross/do...IdEval_5.1.tgz

    Thanks for the reply.

  4. #4
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    A makefile contains a lot of shell commands. Even if the code is portable, the compile process might need to be tweaked for your machine to pull in the required dependencies, etc.... As well as posting the link - the exact problems you're having will help to pinpoint what the problem areas are.

    edit - I've gotta run to a meeting, otherwise I'd take a better look right now. But one option may be Cygwin - which is basically a Unix-like environment that runs in Windows. It might not be suitable for what you're wanting to do, but Linux code generally compiles with minimal problems inside it.

  5. #5
    Registered User
    Join Date
    Aug 2010
    Posts
    9
    Sean, I've provided the link, and my machine is using winxp 32bit, it's a regular dual core machine, nothing legacy.
    I've tried pelles C, I tried the command "pomake" as I think it's their version of the make command, the error is:
    POMAKE: makefile(192): fatal error: Rules must follow target.

    Thanks for the reply.

  6. #6
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675
    I think sean is right...you're going to need to install Cygwin.

  7. #7
    Registered User
    Join Date
    Aug 2010
    Posts
    9
    Downloading it now, though my slow connection is doing me no favors now, I'll sure let you know how things go.
    Well, a side question, I'm downloading TDM-GCC, should I go for the original cygwin instead.
    The reason is during my search I recall seeing someone mentioning that this TDM version is better for some reasons I don't remember.

  8. #8
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    TDM-GCC looks like a repackaging of MinGW, which is a native port of the gcc compiler to Windows. It produces better executables in a manner of speaking, because they depend on fewer libraries and are more Windows-y.

    Cygwin is a port of a huge number of Linux libraries and programs to Windows. It can do a much better job of compiling Linux programs on Windows because pretty much the whole environment is ported. It's a much bigger download and the executables you get with a cygwin compiler are slower and depend on more libraries, but you'd have a much better chance of compiling some random Linux program with it.

    I'd suggest installing cygwin actually. Better chance of it working.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  9. #9
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    my machine is using winxp 32bit, it's a regular dual core machine, nothing legacy
    Sorry - when I said for your machine, I was referring more to software than hardware. There are certain conventions that are generally followed on *nix like where to find libraries, etc... that either aren't defined as consistently or aren't defined at all when you move to a windows environment. So the way you've installed your compiler, what compler you're using etc tends to lead to a lot more variables.

    Having had a better look at stuff, it looked like if you were familiar with all the different components in building a project, you could port this to your system without too much trouble, but especially since you're just wanting to run the software so you can accomplish another task, I'm going to go throw another vote behind using cygwin. The long download is much less trouble than reconfiguring the whole makefile.

  10. #10
    Third Eye Babkockdood's Avatar
    Join Date
    Apr 2010
    Posts
    352
    Makefiles are just formatted shell scripts. They have shell commands in them that compile every source file and link all the objects. If you're running Windows, it's likely the Makefile won't execute. You might have to compile everything manually.

  11. #11
    Registered User
    Join Date
    Aug 2010
    Posts
    9
    Sorry all for being late to reply, I had to take off for a while and didn't have internet access, it was unavoidable, so, sorry again.

    Sean: I've installed cygwin with default settings, I can navigate easily as it supports windows naming as well, but I'm lost, I couldn't even compile anything, I will try to check the readme or the online manual for a list of commands.

    dwks: thanks for the reply, I've used your advice and now I'm trying cygwin.

    Babkockdood: -what a name lol-, thanks, I will try to compile it on cygwin, if that doesn't work, maybe I'll need further help to recompile, I hope it won't be a big task since I'm only interested in one specific task of the whole package, so I need to compile that only.

    Thanks for you cooperation all, actually surpassed my expectation.

  12. #12
    Registered User
    Join Date
    Aug 2010
    Posts
    9
    Update:
    I've downloaded some libraries for cygwin including things related to the make process.

    I don't seem to be able to figure out how to issue the make command.
    I've tried:
    make csufaceideval.*
    while in the parent directory that contains the "csufaceideval" directory, which in turn contains the project and its makefile.
    I've tried that also, from within the "csufaceideval" directory,and while there tried:
    make makefile
    The result is:
    make: *** No rule to make target `csufaceideval.*'. Stop.
    Excuse my lack of knowledge regarding coding, but I don't see what I'm missing here.

  13. #13
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Quote Originally Posted by Babkockdood View Post
    Makefiles are just formatted shell scripts. They have shell commands in them that compile every source file and link all the objects. If you're running Windows, it's likely the Makefile won't execute. You might have to compile everything manually.
    They're certainly not. Don't get confused with the inline bash.

    Tried just "make" from the same location as the Makefile/GNUMakefile ? :-)

  14. #14
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    FYI:

    from the "Cygwin Bash Shell" prompt you need to change directory to the folder with the make.

    The makefile for me is in this location

    Code:
    D:\Downloads\csuFaceIdEval_5.1\csuFaceIdEval_5.1
    You can just place "/cygdrive" in front of the drive letter and remove the : after the drive and then change each "\" to the proper forward "/"

    The $ sign is the default prompt shown by cygwin when it is ready for next command.
    You do NOT type the $ sign.
    Code:
    $ cd /cygdrive/d/Downloads/csuFaceIdEval_5.1/csuFaceIdEval_5.1
    Then type make on the command line after the $ prompt
    Code:
    $ make
    Note: The above commands required the GCC compiler and make to be installed under cygwin.

    Tim S.

  15. #15
    Registered User
    Join Date
    Aug 2010
    Posts
    9
    Thanks a lot zacs7 and stahta01. The command actually worked the way you've mentioned, but still something seems to be off with me.

    I get the following error:
    ************* Building stable analysis tools ************
    mkdir -p bin/i686
    mkdir -p lib/i686
    gcc -Isrc -O3 -g -Wall src/csuSubspaceEigen.c -c -o lib/i686/csuSubspaceEigen.o
    /usr/lib/gcc/i686-pc-cygwin/4.3.4/cc1.exe: error while loading shared libraries:
    cygmpfr-1.dll: cannot open shared object file: No such file or directory
    make: *** [lib/i686/csuSubspaceEigen.o] Error 1
    I'll have to step out now, I'll look into that later tonight, as I'm not sure where the problem is yet.

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. does it make any sense
    By ExDHaos in forum C++ Programming
    Replies: 0
    Last Post: 05-23-2009, 08:06 AM
  3. Make file trouble
    By kotoko in forum C Programming
    Replies: 5
    Last Post: 11-12-2008, 02:41 PM
  4. does this error make sense
    By chico1st in forum C Programming
    Replies: 6
    Last Post: 05-27-2008, 11:47 AM
  5. Junk pointer too high to make sense.
    By Yasir_Malik in forum C++ Programming
    Replies: 7
    Last Post: 03-21-2006, 01:42 PM