Not sure how to put this into a Makefile

This is a discussion on Not sure how to put this into a Makefile within the C Programming forums, part of the General Programming Boards category; Hi , i'm not sure how to put this into a Makefile Code: spu-gcc-4.3 spe_example.c -o spe_example; embedspu test_handle spe_example ...

  1. #1
    Registered User redruby147's Avatar
    Join Date
    Sep 2008
    Location
    England
    Posts
    37

    Talking Not sure how to put this into a Makefile

    Hi , i'm not sure how to put this into a Makefile

    Code:
    spu-gcc-4.3 spe_example.c -o spe_example;
    embedspu test_handle spe_example spe_example_csf.o;
    gcc ppe_example.c spe_example_csf.o -lspe2 -o example;
    Here is my attempt so far

    Code:
    CC=gcc
    CFLAGS=-g -Wall
    SPUGCC=spu-gcc-4.3
    #EMBED=embedspu test_handle spe_example spe_example_csf.o
    
    example: ppe_example.c spe_example_csf.o
        $(CC) $(CFLAGS) ppe_example.c spe_example_csf.o -lspe2 -o example
        embedspu test_handle spe_example spe_example_csf.o
    
    spe_example: spe_example.c
        $(SPUGCC) spe_example.c -o spe_example        
    
    clean:
        rm -rf spe_example_csf.o example spe_example
    With regards to it's background, It's for some test code using all the cores on the PS3

    Changes in libspe: How libspe2 affects Cell Broadband Engine programming

    (Ignore the differences, much to my annoyance i found that Debian has different naming conventions from what was written in the guide.)

    Thanks!

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    You'd have to do the embedspu first, before the $(CC) etc., right?

  3. #3
    Registered User redruby147's Avatar
    Join Date
    Sep 2008
    Location
    England
    Posts
    37
    Still receiving the same error as before

    Code:
    make: *** No rule to make target `spe_example_csf.o', needed by `example'.  Stop.

  4. #4
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,246
    The Makefile says that spe_example_csf.o is required to create the example executable. The problem is your Makefile does not say how to create spe_example_csf.o anywhere. You need something like:
    Code:
    CC=gcc
    CFLAGS=-g -Wall
    SPUGCC=spu-gcc-4.3
    #EMBED=embedspu test_handle spe_example spe_example_csf.o
    
    example: ppe_example.c spe_example_csf.o
        $(CC) $(CFLAGS) ppe_example.c spe_example_csf.o -lspe2 -o example
        embedspu test_handle spe_example spe_example_csf.o
    
    spe_example_csf.o: spe_example_csf.c
        $(CC) $(CFLAGS) -c spe_example_csf.c
    
    spe_example: spe_example.c
        $(SPUGCC) spe_example.c -o spe_example        
    
    clean:
        rm -rf spe_example_csf.o example spe_example

  5. #5
    Registered User
    Join Date
    Oct 2008
    Location
    TX
    Posts
    2,047
    Quote Originally Posted by bithub View Post
    The Makefile says that spe_example_csf.o is required to create the example executable. The problem is your Makefile does not say how to create spe_example_csf.o anywhere.
    IMHO there's no need specify how to make "spe_example_csf.o" from "spe_example_csf.c" as those rules are built into make.
    Most likely cause is that there is no "spe_example_csf.c" file in the current working directory from which make is being invoked.
    Last edited by itCbitC; 07-07-2009 at 12:50 PM.

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. Need help with makefile
    By New_Programmer in forum C++ Programming
    Replies: 5
    Last Post: 03-31-2009, 04:55 PM
  3. Where to put local auxiliary functions?
    By draugr in forum C++ Programming
    Replies: 10
    Last Post: 03-17-2009, 08:46 PM
  4. Where to put files to be read in on a Mac
    By bassist11 in forum C Programming
    Replies: 3
    Last Post: 03-12-2009, 09:39 AM
  5. Building a project using a Makefile
    By starcatcher in forum Windows Programming
    Replies: 2
    Last Post: 11-23-2008, 10:50 PM

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