help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

About recipes cleanup 6.14 and 10.2


From: lijh8
Subject: About recipes cleanup 6.14 and 10.2
Date: Sun, 29 Dec 2024 17:11:17 +0800

Hi community,


CFLAGS remains in recipes for linking in examples in 6.14,
this is inconsistent with 10.2.


And in 10.2, can we spell out the recipes in complete, 
for example with $^ , $< , etc. , for compling and linking C programs:


$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@


$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<




```
# 6.14: .EXTRA_PREREQS
# https://www.gnu.org/software/make/manual/html_node/Special-Variables.html ,


myprog: myprog.o file1.o file2.o
&nbsp; &nbsp; $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)


myprog: myprog.o file1.o file2.o $(CC)
&nbsp; &nbsp; $(CC) $(CFLAGS) $(LDFLAGS) -o $@ \
&nbsp; &nbsp; &nbsp; &nbsp; $(filter-out $(CC),$^) $(LDLIBS)


myprog: myprog.o file1.o file2.o
&nbsp; &nbsp; $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
myprog: .EXTRA_PREREQS = $(CC)


# 10.2
# https://www.gnu.org/software/make/manual/html_node/Catalogue-of-Rules.html ,


$(CC) $(CPPFLAGS) $(CFLAGS) -c


$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c


$(CC) $(LDFLAGS) n.o $(LOADLIBES) $(LDLIBS)
```

reply via email to

[Prev in Thread] Current Thread [Next in Thread]