Thread: make file

  1. #1
    Registered User
    Join Date
    Mar 2007

    make file

    I am trying to make a makefile(makeSupersonic) for the following compilation:

    > g++ -o supersonic_ob supersonic_ob.C flow_field.C function_declarations.C Boundary.C Time_Step.C -lm

    GCOMPILE = g++-4.0
    CODE     = supersonic_ob1
    OBJECTS = $(CODE).o  flow_field.o  Boundary.o   Time_step.o   function_declarations.o 
    $(CODE): $(OBJECTS)
    $*.o:   $*.C 
    It gives the following error messages when I type

    ./makeSupersonic: line 1: GCOMPILE: command not found
    ./makeSupersonic: line 2: FOPTIONS: command not found
    ./makeSupersonic: line 3: CODE: command not found

    Last edited by Ken Fitlike; 05-03-2007 at 02:26 PM. Reason: fixed [code][/code] tags

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Moved: build tool question.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    int x = *((int *) NULL); Cactus_Hugger's Avatar
    Join Date
    Jul 2003
    Banks of the River Styx
    It sort of looks like you're trying to execute the makefile itself... (should it have executable permission + it lacks a shebang? Not a *nix expert here...)
    Just run make. ie:
    make -f makeSupersonic
    Also, "GCOMPILE" seems... outlandish. I believe most people use CPP there, and it might already (depending on your make and system) be already set to g++.
    You should also have tabs before the commands (but not the rules) but this may have been lost to the board's formating. IIRC, it's:
    %.o : %.c
    (without $s, and using %s.) (And COMPILE is undefined...)
    long time; /* know C? */
    Unprecedented performance: Nothing ever ran this slow before.
    Any sufficiently advanced bug is indistinguishable from a feature.
    Real Programmers confuse Halloween and Christmas, because dec 25 == oct 31.
    The best way to accelerate an IBM is at 9.8 m/s/s.
    recursion (re - cur' - zhun) n. 1. (see recursion)

  4. #4
    Registered User
    Join Date
    Sep 2001
    Attach the file. It is likely an indentation issue.
    Callou collei we'll code the way
    Of prime numbers and pings!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A development process
    By Noir in forum C Programming
    Replies: 37
    Last Post: 07-10-2011, 10:39 PM
  2. help with text input
    By Alphawaves in forum C Programming
    Replies: 8
    Last Post: 04-08-2007, 04:54 PM
  3. Encryption program
    By zeiffelz in forum C Programming
    Replies: 1
    Last Post: 06-15-2005, 03:39 AM
  4. what does this mean to you?
    By pkananen in forum C++ Programming
    Replies: 8
    Last Post: 02-04-2002, 03:58 PM
  5. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 02:58 AM