From 82ba818ff456bcd6d56a06226e3f27e98fbb55c3 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Thu, 14 Aug 2025 22:58:58 -0500 Subject: removing all downloaded devdocs files --- devdocs/gnu_make/wildcard-pitfall.html | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 devdocs/gnu_make/wildcard-pitfall.html (limited to 'devdocs/gnu_make/wildcard-pitfall.html') diff --git a/devdocs/gnu_make/wildcard-pitfall.html b/devdocs/gnu_make/wildcard-pitfall.html deleted file mode 100644 index eb0cb2b9..00000000 --- a/devdocs/gnu_make/wildcard-pitfall.html +++ /dev/null @@ -1,13 +0,0 @@ -

Pitfalls of Using Wildcards

Now here is an example of a naive way of using wildcard expansion, that does not do what you would intend. Suppose you would like to say that the executable file foo is made from all the object files in the directory, and you write this:

objects = *.o
-
-foo : $(objects)
-        cc -o foo $(CFLAGS) $(objects)
-
-

The value of objects is the actual string ‘*.o’. Wildcard expansion happens in the rule for foo, so that each existing.o’ file becomes a prerequisite of foo and will be recompiled if necessary.

But what if you delete all the ‘.o’ files? When a wildcard matches no files, it is left as it is, so then foo will depend on the oddly-named file *.o. Since no such file is likely to exist, make will give you an error saying it cannot figure out how to make *.o. This is not what you want!

Actually it is possible to obtain the desired result with wildcard expansion, but you need more sophisticated techniques, including the wildcard function and string substitution. See The Function wildcard.

Microsoft operating systems (MS-DOS and MS-Windows) use backslashes to separate directories in pathnames, like so:

  c:\foo\bar\baz.c
-
-

This is equivalent to the Unix-style c:/foo/bar/baz.c (the c: part is the so-called drive letter). When make runs on these systems, it supports backslashes as well as the Unix-style forward slashes in pathnames. However, this support does not include the wildcard expansion, where backslash is a quote character. Therefore, you must use Unix-style slashes in these cases.

-

- Copyright © 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 Free Software Foundation, Inc.
Licensed under the GNU Free Documentation License.
- https://www.gnu.org/software/make/manual/html_node/Wildcard-Pitfall.html -

-
-- cgit v1.2.3