"Nichts zu machen für makefile" - Meldung

Habe ich die folgenden Dateien:

Kind.c , Cookie.c , Cookie.h , CookieMonster.c , Glas.c , Glas.h-Milch.c , Milch.h

und das folgende makefile namens makePractice, die Sie ausführen soll, erstellen Sie zwei ausführbare Dateien, Kind und CookieMonster.

makefile:

CC = gcc    # the compiler
CFLAGS = -Wall  # the compiler flags
ChildObjects = Jar.o    # object files for the Child executable
CookieMonsterObjects = Jar.o Milk.o     #object files for the CookieMonster executable

all: Child CookieMonster    # the first target. Both executables are created when 
                # 'make' is invoked with no target

# general rule for compiling a source and producing an object file
.c.o:
    $(CC) $(CFLAGS) -c $<

# linking rule for the Child executable
Child: $(ChildObjects)
    $(CC) $(CFLAGS) $(ChildObjects) -o Child

# linking rule for the CookieMonster executable
CookieMonster: $(CookieMonsterObjects)
    $(CC) $(CFLAGS) $(CookieMonsterObjects) -o CookieMonster

# dependance rules for the .o files

Child.o: Child.c Cookie.h Jar.h

CookieMonster.o: CookieMonster.c Cookie.h Jar.h Milk.h

Jar.o: Jar.c Jar.h Cookie.h

Milk.o: Milk.c Milk.h

Cookie.o: Cookie.c Cookie.h

# gives the option to delete all the executable, .o and temporary files

clean: 
    rm -f *.o *~

Wenn ich versuche mit dem makefile zum erstellen der ausführbaren Dateien verwendet, indem Sie die folgende Zeile in der shell

make -f makePractice

Bekomme ich folgende Meldung:

make: Nothing to be done for `makefile'.

Ich verstehe nicht, was falsch ist...

  • Warum haben Sie makefile: an der Spitze? Entfernen Sie das!
  • Hinweis: Versuchen Sie zu machen die "alle" - Ziel.
  • make -f makePractice Child vielleicht?
InformationsquelleAutor Moshe | 2011-08-14
Schreibe einen Kommentar