]> rtime.felk.cvut.cz Git - omk.git/commitdiff
Added source-list pass.
authorMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 30 Jun 2006 14:44:00 +0000 (14:44 +0000)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 30 Jun 2006 14:44:00 +0000 (14:44 +0000)
This pass (invoked by make sources-list) creates the list of files,
which are used during compilation. The list reflects conditional
compilation depending on config.omk and other variables.

darcs-hash:20060630144442-f2ef6-4547f069cb1249405c10716338283453ce97ab67.gz

rulesdef.py
snippets/sources-list [new file with mode: 0644]

index 239a4e97745f1b505b74c522948c5e4e4dc412e3..5d771b668db89f5d4d8a84610157e9e02f38cb71 100755 (executable)
@@ -1,7 +1,7 @@
 #!/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' ],
     }
diff --git a/snippets/sources-list b/snippets/sources-list
new file mode 100644 (file)
index 0000000..67a8748
--- /dev/null
@@ -0,0 +1,28 @@
+
+# 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: