3
0

Makefile.IMA 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. # This is completely unsupported.
  2. # Fix COMBINED_COMPILE upstream (in the Kbuild) and propagate
  3. # the changes back
  4. srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR))
  5. objtree := $(CURDIR)
  6. src := $(srctree)
  7. obj := $(objtree)
  8. default: busybox
  9. include .config
  10. ifdef CONFIG_FEATURE_COMPRESS_USAGE
  11. usage_stuff = include/usage_compressed.h
  12. endif
  13. # pull in the config stuff
  14. lib-all-y := applets/applets.o
  15. lib-y:=
  16. include procps/Kbuild
  17. lib-all-y += $(patsubst %,procps/%,$(sort $(lib-y)))
  18. lib-y:=
  19. include networking/Kbuild
  20. lib-all-y += $(patsubst %,networking/%,$(sort $(lib-y)))
  21. lib-y:=
  22. include networking/udhcp/Kbuild
  23. lib-all-y += $(patsubst %,networking/udhcp/%,$(sort $(lib-y)))
  24. lib-y:=
  25. include networking/libiproute/Kbuild
  26. lib-all-y += $(patsubst %,networking/libiproute/%,$(sort $(lib-y)))
  27. lib-y:=
  28. include loginutils/Kbuild
  29. lib-all-y += $(patsubst %,loginutils/%,$(sort $(lib-y)))
  30. lib-y:=
  31. include archival/Kbuild
  32. lib-all-y += $(patsubst %,archival/%,$(sort $(lib-y)))
  33. lib-y:=
  34. include archival/libunarchive/Kbuild
  35. lib-all-y += $(patsubst %,archival/libunarchive/%,$(sort $(lib-y)))
  36. lib-y:=
  37. include applets/Kbuild
  38. lib-all-y += $(patsubst %,applets/%,$(sort $(lib-y)))
  39. lib-y:=
  40. include e2fsprogs/Kbuild
  41. lib-all-y += $(patsubst %,e2fsprogs/%,$(sort $(lib-y)))
  42. lib-y:=
  43. #include e2fsprogs/old_e2fsprogs/Kbuild
  44. #lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/%,$(sort $(lib-y)))
  45. #lib-y:=
  46. #include e2fsprogs/old_e2fsprogs/ext2fs/Kbuild
  47. #lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/ext2fs/%,$(sort $(lib-y)))
  48. #lib-y:=
  49. #include e2fsprogs/old_e2fsprogs/blkid/Kbuild
  50. #lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/blkid/%,$(sort $(lib-y)))
  51. #lib-y:=
  52. #include e2fsprogs/old_e2fsprogs/uuid/Kbuild
  53. #lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/uuid/%,$(sort $(lib-y)))
  54. #lib-y:=
  55. #include e2fsprogs/old_e2fsprogs/e2p/Kbuild
  56. #lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/e2p/%,$(sort $(lib-y)))
  57. #lib-y:=
  58. include debianutils/Kbuild
  59. lib-all-y += $(patsubst %,debianutils/%,$(sort $(lib-y)))
  60. lib-y:=
  61. include runit/Kbuild
  62. lib-all-y += $(patsubst %,runit/%,$(sort $(lib-y)))
  63. lib-y:=
  64. include modutils/Kbuild
  65. lib-all-y += $(patsubst %,modutils/%,$(sort $(lib-y)))
  66. lib-y:=
  67. include miscutils/Kbuild
  68. lib-all-y += $(patsubst %,miscutils/%,$(sort $(lib-y)))
  69. lib-y:=
  70. include coreutils/libcoreutils/Kbuild
  71. lib-all-y += $(patsubst %,coreutils/libcoreutils/%,$(sort $(lib-y)))
  72. lib-y:=
  73. include coreutils/Kbuild
  74. lib-all-y += $(patsubst %,coreutils/%,$(sort $(lib-y)))
  75. lib-y:=
  76. include sysklogd/Kbuild
  77. lib-all-y += $(patsubst %,sysklogd/%,$(sort $(lib-y)))
  78. lib-y:=
  79. include shell/Kbuild
  80. lib-all-y += $(patsubst %,shell/%,$(sort $(lib-y)))
  81. lib-y:=
  82. include console-tools/Kbuild
  83. lib-all-y += $(patsubst %,console-tools/%,$(sort $(lib-y)))
  84. lib-y:=
  85. include findutils/Kbuild
  86. lib-all-y += $(patsubst %,findutils/%,$(sort $(lib-y)))
  87. lib-y:=
  88. include util-linux/Kbuild
  89. lib-all-y += $(patsubst %,util-linux/%,$(sort $(lib-y)))
  90. lib-y:=
  91. include init/Kbuild
  92. lib-all-y += $(patsubst %,init/%,$(sort $(lib-y)))
  93. lib-y:=
  94. include libpwdgrp/Kbuild
  95. lib-all-y += $(patsubst %,libpwdgrp/%,$(sort $(lib-y)))
  96. lib-y:=
  97. include editors/Kbuild
  98. lib-all-y += $(patsubst %,editors/%,$(sort $(lib-y)))
  99. lib-y:=
  100. include selinux/Kbuild
  101. lib-all-y += $(patsubst %,selinux/%,$(sort $(lib-y)))
  102. lib-y:=
  103. include scripts/Kbuild
  104. lib-all-y += $(patsubst %,scripts/%,$(sort $(lib-y)))
  105. lib-y:=
  106. include libbb/Kbuild
  107. lib-all-y += $(patsubst %,libbb/%,$(sort $(lib-y)))
  108. lib-y:=
  109. include Makefile.flags
  110. ifndef BB_VER
  111. BB_VER:=""
  112. endif
  113. CPPFLAGS+= -D"KBUILD_STR(s)=\#s" #-Q
  114. HOSTCC = gcc
  115. AS = $(CROSS_COMPILE)as
  116. CC = $(CROSS_COMPILE)gcc
  117. LD = $(CC) -nostdlib
  118. CPP = $(CC) -E
  119. AR = $(CROSS_COMPILE)ar
  120. NM = $(CROSS_COMPILE)nm
  121. STRIP = $(CROSS_COMPILE)strip
  122. OBJCOPY = $(CROSS_COMPILE)objcopy
  123. OBJDUMP = $(CROSS_COMPILE)objdump
  124. WHOLE_PROGRAM:=$(call cc-option,-fwhole-program,)
  125. busybox: $(usage_stuff)
  126. $(CC) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) --combine $(WHOLE_PROGRAM) \
  127. -funit-at-a-time -Wno-error -std=gnu99 \
  128. -o $(@)_unstripped $(lib-all-y:.o=.c) \
  129. -Wl,--start-group -lcrypt -lm -Wl,--end-group
  130. cp -f $(@)_unstripped $@
  131. -$(STRIP) -s -R .note -R .comment -R .version $@
  132. applets/usage:
  133. $(HOSTCC) -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -I$(srctree)/include -o applets/usage applets/usage.c
  134. include/usage_compressed.h: $(srctree)/include/usage.h applets/usage
  135. $(srctree)/applets/usage_compressed include/usage_compressed.h applets