Code: Select all
:
Code: Select all
::
Erwartung : Die Include -Richtlinie sollte die Zieldatei erzwingen, die zu generieren ist (unabhängig von den Regeltypen). Fügen Sie ein, aber Einzelkolonegeln funktionierten wie erwartet. (Fehler)
Inhalt von Makefile :
Code: Select all
test0.txt::
touch test0.txt
test.txt::
touch test.txt
include test.txt
Code: Select all
xuanyi@Shwan:~/try/playground$ tree
.
└── Makefile
1 directory, 1 file
xuanyi@Shwan:~/try/playground$ head -n 20 Makefile
test0.txt ::
touch test0.txt
test.txt ::
touch test.txt
include test.txt
xuanyi@Shwan:~/try/playground$ make
touch test0.txt
xuanyi@Shwan:~/try/playground$ tree
.
├── Makefile
└── test0.txt
1 directory, 2 files
xuanyi@Shwan:~/try/playground$
Code: Select all
test0.txt::
touch test0.txt
test.txt:
touch test.txt
include test.txt
Code: Select all
xuanyi@Shwan:~/try/playground$ tree
.
└── Makefile
1 directory, 1 file
xuanyi@Shwan:~/try/playground$ head -n 20 Makefile
test0.txt ::
touch test0.txt
test.txt :
touch test.txt
include test.txt
xuanyi@Shwan:~/try/playground$ make
touch test.txt
touch test0.txt
xuanyi@Shwan:~/try/playground$ tree
.
├── Makefile
├── test.txt
└── test0.txt
1 directory, 3 files
xuanyi@Shwan:~/try/playground$
< /code>
[b] Schlüsselunterschied < /strong>: < /p>
Einkolon-Regeln inklusive < /code>, während doppelkolonische Regeln mit leeren Voraussetzungen (Experiment 1) ausfallen. (Erfolg) [/b]
[b] Inhalt von Makefile [/b]:
test0.txt::
touch test0.txt
test.txt:: invalid_file
touch test.txt
include test.txt
Code: Select all
xuanyi@Shwan:~/try/playground$ tree
.
└── Makefile
1 directory, 1 file
xuanyi@Shwan:~/try/playground$ head -n 20 Makefile
test0.txt ::
touch test0.txt
test.txt :: invalid_file
touch test.txt
include test.txt
xuanyi@Shwan:~/try/playground$ touch invalid_file
xuanyi@Shwan:~/try/playground$ tree
.
├── Makefile
└── invalid_file
1 directory, 2 files
xuanyi@Shwan:~/try/playground$ make
touch test.txt
touch test0.txt
xuanyi@Shwan:~/try/playground$ tree
.
├── Makefile
├── invalid_file
├── test.txt
└── test0.txt
1 directory, 4 files
xuanyi@Shwan:~/try/playground$
< /code>
Über meine Umgebung: < /p>
xuanyi@Shwan:~/try/playground$ make --version
GNU Make 4.3
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
xuanyi@Shwan:~/try/playground$ hostnamectl
Static hostname: Shwan
Icon name: computer-container
Chassis: container ☐
Machine ID: #####
Boot ID: #####
Virtualization: wsl
Operating System: Ubuntu 24.04.1 LTS
Kernel: Linux 5.15.167.4-microsoft-standard-WSL2
Architecture: x86-64
Lassen Sie mich wissen, ob weitere Anpassungen erforderlich sind.