3 ms·
Lists of files are usually used more than once for more than one task. This would only make sense if the only rule that needed the list was that one that build
by Brian_K_White 3y ago
Lists of files are usually used more than once for more than one task.
This would only make sense if the only rule that needed the list was that one that builds, no install/uninstall/package/modify/audit/hash/clean/etc, which is never the case. You also don't want to use globbing in place of an explicit list either.
- bigdict 3y agoSure, I'm just pointing out you don't need to type out the C compiler invocation again. FOOOBJS = foo.o bar.o baz.o foo: $(FOOOBJS)
- Brian_K_White 3y agoAh got it. Agreed.
- e12e 3y agoSo: > The example Makefile in its entirety: CFLAGS += -Wall -Wextra LDLIBS = -lcurses OBJS = foo.o bar.o baz.o foo: $(OBJS) $(CC) $(LDFLAGS) $(OBJS) $(LDLIBS) -o $@ foo.o bar.o: foo.h clean: rm -f $(OBJS) foo Become: CFLAGS += -Wall -Wextra LDLIBS = -lcurses OBJS = foo.o bar.o baz.o ? foo: $(OBJS) foo.o bar.o: foo.h clean: rm -f $(OBJS) foo