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