Depends.pp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //
  2. // Depends.pp
  3. //
  4. // This file is loaded and run after each Sources.pp is read. It
  5. // defines the inter-directory dependencies, which is useful for
  6. // determining build order.
  7. //
  8. #if $[or $[eq $[DIR_TYPE], src], $[eq $[DIR_TYPE], metalib]]
  9. #if $[eq $[DEPEND_DIRS],]
  10. #define DEPENDABLE_HEADERS
  11. #forscopes metalib_target static_lib_target ss_lib_target lib_target noinst_lib_target bin_target noinst_bin_target
  12. // We can optimize quite a bit by evaluating now several of the key
  13. // deferred variables defined in Globals.pp. This way they won't need
  14. // to get repeatedly reevaluated as each directory examines each
  15. // other.
  16. #define build_directory $[build_directory]
  17. #define build_target $[build_target]
  18. #define active_local_libs $[active_local_libs]
  19. #define active_component_libs $[active_component_libs]
  20. #define active_libs $[active_libs]
  21. #define get_sources $[get_sources]
  22. // Report a warning for nonexisting dependencies.
  23. #define nonexisting $[unmapped all_libs,$[LOCAL_LIBS]]
  24. #if $[ne $[nonexisting],]
  25. Warning: Lib(s) $[nonexisting], referenced in $[DIRNAME]/$[TARGET], not found.
  26. #endif
  27. #set DEPENDABLE_HEADERS $[DEPENDABLE_HEADERS] $[filter %.h %.I,$[all_sources]]
  28. #end metalib_target static_lib_target ss_lib_target lib_target noinst_lib_target bin_target noinst_bin_target
  29. #forscopes test_bin_target
  30. #set DEPENDABLE_HEADERS $[DEPENDABLE_HEADERS] $[filter %.h %.I,$[all_sources]]
  31. #end test_bin_target
  32. // Allow the user to define additional EXTRA_DEPENDS targets in each
  33. // Sources.pp.
  34. #define DEPEND_DIRS \
  35. $[sort $[EXTRA_DEPENDS] $[all_libs $[DIRNAME],$[get_depend_libs]]]
  36. #set DEPENDABLE_HEADERS $[sort $[DEPENDABLE_HEADERS]]
  37. #endif
  38. #endif // DIR_TYPE