Ausführung einer Datei

Ausführung einer Datei

Wie führt man eine aus makefile? Diese Datei ist in der Datei sts-2.1.2 enthalten, die heruntergeladen werden kann unterHier:

Gemäß der NIST-Dokumentation (Abschnitt 5.3) muss ich das bearbeiten makefile.

Ändern Sie die folgenden Zeilen:
(a) CC (Ihr ANSI C-Compiler)
(b) ROOTDIR (das Stammverzeichnis, das zuvor im Prozess festgelegt wurde, z. B. rng/)

user@SC13-VM:~/Documents/sts-2.1.2$ ./makefile
./makefile: line 1: CC: command not found
./makefile: line 2: GCCFLAGS: command not found
./makefile: line 3: ROOTDIR: command not found
./makefile: line 4: ROOTDIR: command not found
./makefile: line 4: SRCDIR: command not found
./makefile: line 5: ROOTDIR: command not found
./makefile: line 5: OBJDIR: command not found
./makefile: line 6: VPATH: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
./makefile: line 8: OBJDIR: command not found
 ......

Insgesamt gibt es 94 Zeilen.

Dann habe ich getan, was Sie gesagt haben:

 user@SC13-VM:~/Documents/sts-2.1.2$ make makefile
 make: Nothing to be done for `makefile'.
 user@SC13-VM:~/Documents/sts-2.1.2$ ls
 data  experiments  include  makefile  makefile~  obj  src  templates

 user@SC13-VM:~/Documents/sts-2.1.2$ make  makefile
 make: Nothing to be done for `makefile'.

Antwort1

Ausführen make, um ein Makefile auszuführen. Dabei wird vorausgesetzt, dass Sie sich im selben Verzeichnis befinden, in dem sich die Datei Makefilebefindet.

Wenn Sie sich in einem anderen Verzeichnis befinden, führen Sie aus make -C directory, wobei directoryder Pfad zum Verzeichnis ist, das die Datei enthält Makefile.

Antwort2

Wenn man die Kommentare zur obigen Antwort liest, könnte es sein, dass Sie denselben Fehler gemacht haben wie ich:

Falscher Befehl: make makefile Dies führt zu der Fehlermeldung „Es gibt nichts zu machen“

Richtiger Befehl:make -f makefile

Ich sollte erwähnen, dass ich es bereits zu einer ausführbaren Datei gemacht habe und auf die gleiche Fehlermenge gestoßen bin. Außerdem wurde der oben genannte Befehl zunächst ohne Fehler ausgeführt, aber die assessDatei erschien nicht wie versprochen. Ich habe es wiederholt und es hat funktioniert. Ich bin ein Anfänger, also kann ich dazu nicht viel sagen.

verwandte Informationen