Find the answer to your Linux question:
Results 1 to 2 of 2
I am having a small problem in my output of makefile. After making my executable via 'make' I wish to execute my executable file but it gives me an error: ...
  1. #1
    Just Joined!
    Join Date
    Apr 2008
    Posts
    1

    Makefile Help

    I am having a small problem in my output of makefile. After making my executable via 'make' I wish to execute my executable file but it gives me an error:
    /code
    $: make

    gcc -c main.c
    gcc -c merge.c
    gcc -c mergesort.c
    gcc -o prog main.o merge.o mergesort.o
    424238335 596516649 719885386 846930886 1189641421 1649760492 1681692777 1714636915 1804289383 1957747793
    make: 424238335: Command not found
    make: *** [all] Error 127
    code/

    I do get the desired output , but whats with the "ERROR 127" and why does 'make' try to execute the first instance of my output.

    My makefile looks like this:
    /code

    .SUFFIXES: .o .c
    .c.o:
    gcc -c $*.c

    all: prog
    $(shell ./prog)

    prog: main.o merge.o mergesort.o
    gcc -o $@ $^

    clean:
    rm *.o prog

    code/

  2. #2
    Linux Newbie
    Join Date
    Sep 2007
    Posts
    161
    hi,

    I don't understand what you're trying to do with the $(shell ...) bit.
    I think
    Code:
    all: prog
            ./prog
    should do fine.

    cheers, kai

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...