On Sat, Jul 4, 2009 at 9:53 AM, Mike Frysinger<[email protected]> wrote: > On Saturday 04 July 2009 03:18:10 Garrett Cooper wrote: >> 2. SOURCES =, TARGETS = is just plain silly as it wastes internal >> variables and increases Makefile length. This is better: TARGETS := >> $(patsubst %.c,%.o,$(wildcard *.c)) > > well, the default could do that, but we shouldnt force all subdirs to operate > this way as it makes the build system too strict. think about support .c > files that get included into other .c files, or linked into the final app.
Well, yes that's the way it is with implicit rules. I originally meant: $(patsubst %.c,%,$(wildcard *.c)) For basic apps (most of our apps are single-.c files). For multiple .c files, it's easy to remedy (just make the program's dependencies the .o files ;)...). >> 3. LOADLIBES is less of a standard variable than LDLIBS is. > > i think splitting between the two should be OK ... LDLIBS for system libs > (i.e. -lfoo) and LOADLIBES for internal LTP libs (i.e. libltp.a). Eh? We need to standardize on one variable instead of duplicating between both of them or it'll make folks cranky when they have to pass more vars on the command line... >> 4. Subdirectories that need to be traversed by make can generally be >> determined with $(patsubst %/Makefile,%,$(wildcard */Makefile)). > > again, a default like this is good, but it shouldnt be required. Yes. ?= is key to success. Thanks, -Garrett ------------------------------------------------------------------------------ _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
