01.07.2013 18:46, Andreas Färber wrote:
[]
>> What's wrong with a single makefile for everything, except
>> of the need to use full pathnames from the top-level source
>> dir?
> 
> In short the problem we ran into was missing *.d inclusions.
> This got fixed by automatically expanding net/ to -include
> net/Makefile.objs and -include net/*.d or so.

-include $(pathsubst %.o=%.d,$(all-objs))

?  With a requiriment that all actually compiled objects be
listed in $(all-objs) somehow, either by adding them to one
of the common $(obj-y) or $(common-obj-m), or explicitly adding
them to $(all-objs) if it is used in some custom way.

Also, it can be done even funnier, something like this:

  subdirs = custom_subdir1 custom_subdir2
  subdirs := $(sort $(subdirs) $(dirname $(objs)))
  -include *.d $(pathsubst %=%/*.d,$(dirs))

or just list all subdirs explicitly in $(subdirs).
There's nothing fancy in there really.

Thanks,

/mjt

Reply via email to