#!/usr/bin/env python
rules = {
- 'sysless': [ 'sysless-setup', 'base', 'gcc', 'config_h', 'include', 'sysless', 'localeval' ],
- 'linux': [ 'linux-setup', 'base', 'config_h', 'include', 'linux' ],
- 'rtems': [ 'rtems-setup', 'base', 'config_h', 'include', 'rtems' ],
+ 'sysless': [ 'sysless-setup', 'base', 'gcc', 'config_h', 'include', 'sysless', 'sources-list', 'localeval' ],
+ 'linux': [ 'linux-setup', 'base', 'config_h', 'include', 'linux', 'sources-list' ],
+ 'rtems': [ 'rtems-setup', 'base', 'config_h', 'include', 'rtems', 'sources-list' ],
}
--- /dev/null
+
+# Rules that creates the list of files which are used during
+# compilation. The list reflects conditional compilation depending on
+# config.omk and other variables.
+
+.PHONY: sources-list
+sources-list sources-list-pass-local: SL:=$(MAKERULES_DIR)/sources.txt.tmp
+sources-list:
+ @echo -n "" > "$(SL)"
+ @$(MAKE) --no-print-directory sources-list-pass
+ @echo "# Automatically generated list of files in ./$(RELATIVE_DIR) that are used in OMK compilation" > "$(SL).tmp2"
+ @cat "$(SL)"|sort|uniq >> "$(SL).tmp2"
+ @mv "$(SL).tmp2" "$(SL:%.tmp=%)"
+ @rm "$(SL)"
+
+$(eval $(call omk_pass_template,sources-list-pass,$$(LOCAL_BUILD_DIR)))
+
+sources-list-pass-local:
+ @$(foreach h,$(include_HEADERS) $(nobase_include_HEADERS) $(kernel_HEADERS),\
+ echo "$(RELATIVE_DIR)/$(h)" >> "$(SL)";)
+ @$(foreach h,$(renamed_include_HEADERS),echo "FIXME: $(RELATIVE_DIR)/$(h)" >> "$(SL)";)
+ @$(foreach lib,$(lib_LIBRARIES) $(shared_LIBRARIES) $(bin_PROGRAMS) $(utils_PROGRAMS) \
+ $(kernel_LIBRARIES) $(rtlinux_LIBRARIES) $(kernel_MODULES),\
+ $(foreach src,$($(lib)_SOURCES),echo "$(RELATIVE_DIR)/$(src)" >> "$(SL)";))
+
+# Local Variables:
+# mode:makefile
+# End: