Kbuild.src 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # Makefile for busybox
  2. #
  3. # Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org>
  4. #
  5. # Licensed under GPLv2, see file LICENSE in this source tree.
  6. obj-y :=
  7. obj-y += applets.o
  8. hostprogs-y:=
  9. hostprogs-y += usage usage_pod applet_tables
  10. always:= $(hostprogs-y)
  11. # Generated files need additional love
  12. # This trick decreases amount of rebuilds
  13. # if tree is merely renamed/copied
  14. ifeq ($(srctree),$(objtree))
  15. srctree_slash =
  16. else
  17. srctree_slash = $(srctree)/
  18. endif
  19. HOSTCFLAGS_usage.o = -I$(srctree_slash)include -Iinclude
  20. HOSTCFLAGS_usage_pod.o = -I$(srctree_slash)include -Iinclude
  21. applets/applets.o: include/usage_compressed.h include/applet_tables.h
  22. applets/applet_tables: .config include/applets.h
  23. applets/usage: .config include/applets.h
  24. applets/usage_pod: .config include/applets.h include/applet_tables.h
  25. quiet_cmd_gen_usage_compressed = GEN include/usage_compressed.h
  26. cmd_gen_usage_compressed = $(srctree_slash)applets/usage_compressed include/usage_compressed.h applets
  27. include/usage_compressed.h: applets/usage $(srctree_slash)applets/usage_compressed
  28. $(call cmd,gen_usage_compressed)
  29. quiet_cmd_gen_applet_tables = GEN include/applet_tables.h include/NUM_APPLETS.h
  30. cmd_gen_applet_tables = applets/applet_tables include/applet_tables.h include/NUM_APPLETS.h
  31. include/NUM_APPLETS.h: applets/applet_tables
  32. $(call cmd,gen_applet_tables)
  33. # In fact, include/applet_tables.h depends only on applets/applet_tables,
  34. # and is generated by it. But specifying only it can run
  35. # applets/applet_tables twice, possibly in parallel.
  36. # We say that it also needs NUM_APPLETS.h
  37. #
  38. # Unfortunately, we need to list the same command,
  39. # and it can be executed twice (sequentially).
  40. # The alternative is to not list any command,
  41. # and then if include/applet_tables.h is deleted, it won't be rebuilt.
  42. #
  43. include/applet_tables.h: include/NUM_APPLETS.h applets/applet_tables
  44. $(call cmd,gen_applet_tables)