build.mk 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507
  1. # This file is part of the OpenADK project. OpenADK is copyrighted
  2. # material, please see the LICENCE file in the top-level directory.
  3. TOPDIR=$(shell pwd)
  4. export TOPDIR
  5. ifneq ($(shell umask 2>/dev/null | sed 's/0*022/OK/'),OK)
  6. $(error your umask is not 022)
  7. endif
  8. CONFIG_CONFIG_IN = Config.in
  9. CONFIG = config
  10. DEFCONFIG= ADK_DEVELSYSTEM=n \
  11. ADK_DEBUG=n \
  12. ADK_STATIC=n \
  13. ADK_MAKE_PARALLEL=y \
  14. ADK_MAKE_JOBS=4 \
  15. ADK_FORCE_PARALLEL=n \
  16. ADK_PACKAGE_BZR=n \
  17. ADK_PACKAGE_GRUB=n \
  18. ADK_PACKAGE_XORG_SERVER_WITH_DRI=n \
  19. ADK_PACKAGE_AUFS2_UTIL=n \
  20. ADK_PACKAGE_BASE_FILES=y \
  21. ADK_PACKAGE_MGETTY=n \
  22. ADK_COMPILE_HEIMDAL=n \
  23. ADK_PACKAGE_HEIMDAL_PKINIT=n \
  24. ADK_PACKAGE_HEIMDAL_SERVER=n \
  25. ADK_PACKAGE_LIBHEIMDAL=n \
  26. ADK_PACKAGE_LIBHEIMDAL_CLIENT=n \
  27. BUSYBOX_BBCONFIG=n \
  28. BUSYBOX_SELINUX=n \
  29. BUSYBOX_INSTALL_NO_USR=n \
  30. BUSYBOX_MODPROBE_SMALL=n \
  31. BUSYBOX_EJECT=n \
  32. BUSYBOX_BUILD_LIBBUSYBOX=n \
  33. BUSYBOX_FEATURE_2_4_MODULES=n \
  34. BUSYBOX_LOCALE_SUPPORT=n \
  35. BUSYBOX_FEATURE_PREFER_APPLETS=n \
  36. BUSYBOX_FEATURE_SUID=n \
  37. BUSYBOX_SELINUXENABLED=n \
  38. BUSYBOX_FEATURE_INSTALLER=n \
  39. BUSYBOX_PAM=n \
  40. BUSYBOX_FLASH_LOCK=n \
  41. BUSYBOX_FLASH_UNLOCK=n \
  42. BUSYBOX_FLASH_ERASEALL=n \
  43. BUSYBOX_PIE=n \
  44. BUSYBOX_TASKSET=n \
  45. BUSYBOX_DEBUG=n \
  46. BUSYBOX_NOMMU=n \
  47. BUSYBOX_WERROR=n \
  48. BUSYBOX_STATIC=n \
  49. BUSYBOX_FEATURE_AIX_LABEL=n \
  50. BUSYBOX_FEATURE_SUN_LABEL=n \
  51. BUSYBOX_FEATURE_OSF_LABEL=n \
  52. BUSYBOX_FEATURE_SGI_LABEL=n \
  53. ADK_KERNEL_RT2X00_DEBUG=n \
  54. ADK_KERNEL_ATH5K_DEBUG=n \
  55. ADK_KERNEL_DEBUG_WITH_KGDB=n
  56. noconfig_targets:= menuconfig \
  57. guiconfig \
  58. _config \
  59. _mconfig \
  60. distclean \
  61. defconfig \
  62. tags
  63. POSTCONFIG= -@ \
  64. if [ -f .config.old ];then \
  65. rebuild=0; \
  66. if [ "$$(grep ^BUSYBOX .config|md5sum)" != "$$(grep ^BUSYBOX .config.old|md5sum)" ];then \
  67. touch .rebuild.busybox;\
  68. rebuild=1;\
  69. fi; \
  70. if [ "$$(grep ^ADK_RUNTIME_PASSWORD .config|md5sum)" != "$$(grep ^ADK_RUNTIME_PASSWORD .config.old|md5sum)" ];then \
  71. touch .rebuild.base-files;\
  72. rebuild=1;\
  73. fi; \
  74. if [ $$rebuild -eq 1 ];then \
  75. cp .config .config.old; \
  76. fi; \
  77. fi
  78. # Pull in the user's configuration file
  79. ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
  80. -include $(TOPDIR)/.config
  81. endif
  82. ifeq ($(strip $(ADK_HAVE_DOT_CONFIG)),y)
  83. include $(TOPDIR)/rules.mk
  84. include ${TOPDIR}/mk/split-cfg.mk
  85. all: world
  86. ${TOPDIR}/package/Depends.mk: ${TOPDIR}/.config $(wildcard ${TOPDIR}/package/*/Makefile)
  87. mksh ${TOPDIR}/package/depmaker
  88. .NOTPARALLEL:
  89. .PHONY: all world clean cleantarget cleandir distclean image_clean
  90. world: $(DISTDIR) $(BUILD_DIR) $(TARGET_DIR) $(PACKAGE_DIR) ${TOPDIR}/.ADK_HAVE_DOT_CONFIG
  91. ${BASH} ${TOPDIR}/scripts/scan-pkgs.sh
  92. ifeq ($(ADK_NATIVE),y)
  93. $(MAKE) -f mk/build.mk toolchain/kernel-headers-prepare tools/install target/config-prepare target/compile package/compile root_clean package/install package_index target/install
  94. else
  95. ifeq ($(ADK_TOOLCHAIN_ONLY),y)
  96. $(MAKE) -f mk/build.mk toolchain/install tools/install package/compile
  97. else
  98. $(MAKE) -f mk/build.mk toolchain/install tools/install target/config-prepare target/compile package/compile root_clean package/install target/install package_index
  99. endif
  100. endif
  101. package_index:
  102. ifeq ($(ADK_TARGET_PACKAGE_IPKG),y)
  103. -cd ${PACKAGE_DIR} && \
  104. ${BASH} ${TOPDIR}/scripts/ipkg-make-index.sh . >Packages
  105. endif
  106. $(DISTDIR):
  107. mkdir -p $(DISTDIR)
  108. $(BUILD_DIR):
  109. mkdir -p $(BUILD_DIR)
  110. $(TARGET_DIR):
  111. mkdir -p $(TARGET_DIR)
  112. $(PACKAGE_DIR):
  113. mkdir -p ${PACKAGE_DIR}/.stamps
  114. ${STAGING_DIR} ${STAGING_DIR}/etc ${STAGING_TOOLS}:
  115. mkdir -p ${STAGING_DIR}/{bin,etc,lib,usr/include} \
  116. ${STAGING_TOOLS}/{bin,lib}
  117. ${STAGING_DIR}/etc/ipkg.conf: ${STAGING_DIR}/etc
  118. ifeq ($(ADK_TARGET_PACKAGE_IPKG),y)
  119. echo "dest root /" >${STAGING_DIR}/etc/ipkg.conf
  120. echo "option offline_root ${TARGET_DIR}" >>$(STAGING_DIR)/etc/ipkg.conf
  121. endif
  122. package/%: ${TOPDIR}/.ADK_HAVE_DOT_CONFIG ${STAGING_DIR}/etc/ipkg.conf ${TOPDIR}/package/Depends.mk
  123. $(MAKE) -C package $(patsubst package/%,%,$@)
  124. target/%: ${TOPDIR}/.ADK_HAVE_DOT_CONFIG
  125. $(MAKE) -C target $(patsubst target/%,%,$@)
  126. toolchain/%: ${STAGING_DIR}
  127. $(MAKE) -C toolchain $(patsubst toolchain/%,%,$@)
  128. tools/%:
  129. $(MAKE) -C tools $(patsubst tools/%,%,$@)
  130. image:
  131. $(MAKE) -C target image
  132. switch:
  133. echo "Saving configuration for target: ${ADK_TARGET}"
  134. cp -p .config .config.${ADK_TARGET}
  135. if [ -f .config.old ];then cp -p .config.old .config.old.${ADK_TARGET};fi
  136. if [ -f .config.split ];then cp -p .config.split .config.split.${ADK_TARGET};fi
  137. if [ -f .config.${TARGET} ];then cp -p .config.${TARGET} .config; \
  138. cp -p .config.old.${TARGET} .config.old; \
  139. cp -p .config.split.${TARGET} .config.split; \
  140. echo "Setting configuration to target: ${TARGET}"; \
  141. else echo "No old target config found";mv .config .config.bak; make TARGET=${TARGET};fi
  142. kernelconfig:
  143. cp $(TOPDIR)/target/$(ADK_TARGET)/kernel.config $(BUILD_DIR)/linux/.config
  144. $(MAKE) -C $(BUILD_DIR)/linux/ ARCH=$(ARCH) menuconfig
  145. cp $(BUILD_DIR)/linux/.config $(TOPDIR)/target/$(ADK_TARGET)/kernel.config
  146. # create a new package from package/.template
  147. newpackage:
  148. @echo "Creating new package $(PKG)"
  149. $(CP) $(TOPDIR)/package/.template $(TOPDIR)/package/$(PKG)
  150. pkg=$$(echo $(PKG)|tr '[:lower:]-' '[:upper:]_'); \
  151. $(SED) "s#@UPKG@#$$pkg#" $(TOPDIR)/package/$(PKG)/Makefile
  152. $(SED) 's#@PKG@#$(PKG)#' $(TOPDIR)/package/$(PKG)/Makefile
  153. $(SED) 's#@VER@#$(VER)#' $(TOPDIR)/package/$(PKG)/Makefile
  154. @echo "Edit package/$(PKG)/Makefile to complete"
  155. @echo "choose PKG_SECTION to add it to an existent submenu"
  156. #############################################################
  157. #
  158. # Cleanup and misc junk
  159. #
  160. #############################################################
  161. root_clean:
  162. @$(TRACE) root_clean
  163. rm -rf $(TARGET_DIR)
  164. mkdir -p $(TARGET_DIR)
  165. # Do a per-package clean here, too. This way stale headers and
  166. # libraries from cross_*/target/ get wiped away, which keeps
  167. # future package build's configure scripts from returning false
  168. # dependencies information.
  169. clean:
  170. @$(TRACE) clean
  171. $(MAKE) -C $(CONFIG) clean
  172. for d in ${STAGING_PARENT}; do \
  173. for f in $$(ls $$d/pkg/[a-z]* 2>/dev/null); do \
  174. while read file ; do \
  175. rm $$d/target/$$file 2>/dev/null; \
  176. done < $$f ; \
  177. rm $$f ; \
  178. done \
  179. done
  180. rm -rf $(BUILD_DIR) $(BIN_DIR) $(TARGET_DIR) \
  181. ${TOPDIR}/.cfg_${ADK_TARGET}_${ADK_LIBC} \
  182. ${TOPDIR}/package/pkglist.d
  183. rm -f ${TOPDIR}/package/*/info.mk ${TOPDIR}/package/Depends.mk
  184. cleankernel:
  185. @$(TRACE) cleankernel
  186. rm -rf $(TOOLCHAIN_BUILD_DIR)/w-linux* $(BUILD_DIR)/linux
  187. cleandir:
  188. @$(TRACE) cleandir
  189. @$(MAKE) -C $(CONFIG) clean $(MAKE_TRACE)
  190. rm -rf $(BUILD_DIR_PFX) $(BIN_DIR_PFX) $(TARGET_DIR_PFX) \
  191. ${TOPDIR}/.cfg* ${TOPDIR}/package/pkglist.d
  192. rm -rf $(TOOLCHAIN_BUILD_DIR_PFX) $(STAGING_PARENT_PFX) \
  193. $(TOOLS_BUILD_DIR)
  194. rm -f .menu .tmpconfig.h ${TOPDIR}/package/*/info.mk \
  195. ${TOPDIR}/package/Depends.mk ${TOPDIR}/prereq.mk \
  196. .busyboxcfg
  197. cleantarget:
  198. @$(TRACE) cleantarget
  199. @$(MAKE) -C $(CONFIG) clean $(MAKE_TRACE)
  200. rm -rf $(BUILD_DIR) $(BIN_DIR) $(TARGET_DIR) \
  201. ${TOPDIR}/.cfg_${ADK_TARGET}_${ADK_LIBC}
  202. rm -rf $(TOOLCHAIN_BUILD_DIR) $(STAGING_PARENT)
  203. rm -f .tmpconfig.h ${TOPDIR}/package/*/info.mk \
  204. .busyboxcfg all.config .defconfig
  205. distclean:
  206. @$(TRACE) distclean
  207. @$(MAKE) -C $(CONFIG) clean $(MAKE_TRACE)
  208. @rm -rf $(BUILD_DIR_PFX) $(BIN_DIR_PFX) $(TARGET_DIR_PFX) $(DISTDIR) \
  209. ${TOPDIR}/.cfg* ${TOPDIR}/package/pkglist.d
  210. @rm -rf $(TOOLCHAIN_BUILD_DIR_PFX) $(STAGING_PARENT_PFX) \
  211. $(TOOLS_BUILD_DIR)
  212. @rm -f .config* .defconfig .tmpconfig.h all.config ${TOPDIR}/prereq.mk \
  213. .menu ${TOPDIR}/package/*/info.mk ${TOPDIR}/package/Depends.mk \
  214. .busyboxcfg .ADK_HAVE_DOT_CONFIG
  215. else # ! ifeq ($(strip $(ADK_HAVE_DOT_CONFIG)),y)
  216. ifeq ($(filter-out distclean,${MAKECMDGOALS}),)
  217. include ${TOPDIR}/mk/vars.mk
  218. else
  219. include $(TOPDIR)/prereq.mk
  220. export BASH HOSTCC HOSTCFLAGS HOSTCXX HOSTCXXFLAGS MAKE LANGUAGE LC_ALL OStype PATH
  221. endif
  222. all: menuconfig
  223. @echo "Start the build with \"make\" or with \"make v\" to be verbose"
  224. # configuration
  225. # ---------------------------------------------------------------------------
  226. # force entering the subdir, as dependency checking is done there
  227. .PHONY: $(CONFIG)/conf $(CONFIG)/mconf $(CONFIG)/gconf
  228. $(CONFIG)/conf:
  229. @$(MAKE) -C $(CONFIG) conf
  230. $(CONFIG)/mconf:
  231. @$(MAKE) -C $(CONFIG)
  232. $(CONFIG)/gconf:
  233. @$(MAKE) -C $(CONFIG) gconf
  234. defconfig: .menu $(CONFIG)/conf
  235. ifeq (${OStype},Linux)
  236. @echo ADK_HOST_LINUX=y > $(TOPDIR)/.defconfig
  237. endif
  238. ifeq (${OStype},FreeBSD)
  239. @echo ADK_HOST_FREEBSD=y > $(TOPDIR)/.defconfig
  240. endif
  241. ifeq (${OStype},MirBSD)
  242. @echo ADK_HOST_MIRBSD=y > $(TOPDIR)/.defconfig
  243. endif
  244. ifeq (${OStype},OpenBSD)
  245. @echo ADK_HOST_OPENBSD=y > $(TOPDIR)/.defconfig
  246. endif
  247. ifeq (${OStype},NetBSD)
  248. @echo ADK_HOST_NETBSD=y > $(TOPDIR)/.defconfig
  249. endif
  250. ifeq (${OStype},Darwin)
  251. @echo ADK_HOST_DARWIN=y > $(TOPDIR)/.defconfig
  252. endif
  253. ifneq (,$(filter CYGWIN%,${OStype}))
  254. @echo ADK_HOST_CYGWIN=y > $(TOPDIR)/.defconfig
  255. endif
  256. @if [ ! -z "$(TARGET)" ];then \
  257. grep "^config" target/Config.in \
  258. |grep -i "$(TARGET)"\$$ \
  259. |sed -e "s#^config \(.*\)#\1=y#" \
  260. >> $(TOPDIR)/.defconfig; \
  261. fi
  262. @for symbol in ${DEFCONFIG}; do \
  263. echo $$symbol >> $(TOPDIR)/.defconfig; \
  264. done
  265. @if [ ! -z "$(FS)" ];then \
  266. grep "^config" target/Config.in \
  267. |grep -i "$(FS)" \
  268. |sed -e "s#^config \(.*\)#\1=y#" \
  269. >> $(TOPDIR)/.defconfig; \
  270. fi
  271. @if [ ! -z "$(PKG)" ];then \
  272. grep "^config" target/Config.in \
  273. |grep -i "$(PKG)" \
  274. |sed -e "s#^config \(.*\)#\1=y#" \
  275. >> $(TOPDIR)/.defconfig; \
  276. fi
  277. @if [ ! -z "$(LIBC)" ];then \
  278. grep "^config" target/Config.in \
  279. |grep -i "$(LIBC)" \
  280. |sed -e "s#^config \(.*\)#\1=y#" \
  281. >> $(TOPDIR)/.defconfig; \
  282. fi
  283. ifneq (,$(filter %_qemu,${TARGET}))
  284. @echo ADK_LINUX_QEMU=y >> $(TOPDIR)/.defconfig
  285. endif
  286. ifneq (,$(filter %_toolchain,${TARGET}))
  287. @echo ADK_LINUX_TOOLCHAIN=y >> $(TOPDIR)/.defconfig
  288. endif
  289. ifneq (,$(filter rescue%,${TARGET}))
  290. @echo ADK_LINUX_RESCUE=y >> $(TOPDIR)/.defconfig
  291. endif
  292. ifneq (,$(filter rb%,${TARGET}))
  293. @echo ADK_LINUX_MIKROTIK=y >> $(TOPDIR)/.defconfig
  294. endif
  295. ifneq (,$(filter alix%,${TARGET}))
  296. @echo ADK_LINUX_ALIX=y >> $(TOPDIR)/.defconfig
  297. endif
  298. ifneq (,$(filter wrap%,${TARGET}))
  299. @echo ADK_LINUX_ALIX=y >> $(TOPDIR)/.defconfig
  300. endif
  301. @if [ ! -z "$(TARGET)" ];then \
  302. $(CONFIG)/conf -D .defconfig $(CONFIG_CONFIG_IN); \
  303. fi
  304. modconfig:
  305. ifeq (${OStype},Linux)
  306. @echo ADK_HOST_LINUX=y > $(TOPDIR)/all.config
  307. endif
  308. ifeq (${OStype},FreeBSD)
  309. @echo ADK_HOST_FREEBSD=y > $(TOPDIR)/all.config
  310. endif
  311. ifeq (${OStype},MirBSD)
  312. @echo ADK_HOST_MIRBSD=y > $(TOPDIR)/all.config
  313. endif
  314. ifeq (${OStype},OpenBSD)
  315. @echo ADK_HOST_OPENBSD=y > $(TOPDIR)/all.config
  316. endif
  317. ifeq (${OStype},NetBSD)
  318. @echo ADK_HOST_NETBSD=y > $(TOPDIR)/all.config
  319. endif
  320. ifeq (${OStype},Darwin)
  321. @echo ADK_HOST_DARWIN=y > $(TOPDIR)/all.config
  322. endif
  323. ifneq (,$(filter CYGWIN%,${OStype}))
  324. @echo ADK_HOST_CYGWIN=y > $(TOPDIR)/all.config
  325. endif
  326. @if [ ! -z "$(TARGET)" ];then \
  327. grep "^config" target/Config.in \
  328. |grep -i "$(TARGET)"\$$ \
  329. |sed -e "s#^config \(.*\)#\1=y#" \
  330. >> $(TOPDIR)/all.config; \
  331. fi
  332. @for symbol in ${DEFCONFIG}; do \
  333. echo $$symbol >> $(TOPDIR)/all.config; \
  334. done
  335. @if [ ! -z "$(FS)" ];then \
  336. grep "^config" target/Config.in \
  337. |grep -i "$(FS)" \
  338. |sed -e "s#^config \(.*\)#\1=y#" \
  339. >> $(TOPDIR)/all.config; \
  340. fi
  341. @if [ ! -z "$(PKG)" ];then \
  342. grep "^config" target/Config.in \
  343. |grep -i "$(PKG)" \
  344. |sed -e "s#^config \(.*\)#\1=y#" \
  345. >> $(TOPDIR)/all.config; \
  346. fi
  347. @if [ ! -z "$(LIBC)" ];then \
  348. grep "^config" target/Config.in \
  349. |grep -i "$(LIBC)" \
  350. |sed -e "s#^config \(.*\)#\1=y#" \
  351. >> $(TOPDIR)/all.config; \
  352. fi
  353. ifneq (,$(filter %_qemu,${TARGET}))
  354. @echo ADK_LINUX_QEMU=y >> $(TOPDIR)/all.config
  355. endif
  356. ifneq (,$(filter %_toolchain,${TARGET}))
  357. @echo ADK_LINUX_TOOLCHAIN=y >> $(TOPDIR)/all.config
  358. endif
  359. ifneq (,$(filter %_rescue,${TARGET}))
  360. @echo ADK_LINUX_RESCUE=y >> $(TOPDIR)/all.config
  361. endif
  362. ifneq (,$(filter rb%,${TARGET}))
  363. @echo ADK_LINUX_MIKROTIK=y >> $(TOPDIR)/all.config
  364. endif
  365. ifneq (,$(filter alix%,${TARGET}))
  366. @echo ADK_LINUX_ALIX=y >> $(TOPDIR)/all.config
  367. endif
  368. ifneq (,$(filter wrap%,${TARGET}))
  369. @echo ADK_LINUX_ALIX=y >> $(TOPDIR)/all.config
  370. endif
  371. menuconfig: $(CONFIG)/mconf defconfig .menu
  372. @if [ ! -f .config ];then \
  373. $(CONFIG)/conf -D .defconfig $(CONFIG_CONFIG_IN); \
  374. fi
  375. @$(CONFIG)/mconf $(CONFIG_CONFIG_IN)
  376. ${POSTCONFIG}
  377. guiconfig: $(CONFIG)/gconf defconfig .menu
  378. @if [ ! -f .config ];then \
  379. $(CONFIG)/conf -D .defconfig $(CONFIG_CONFIG_IN); \
  380. fi
  381. @$(CONFIG)/gconf $(CONFIG_CONFIG_IN)
  382. ${POSTCONFIG}
  383. _config: $(CONFIG)/conf .menu
  384. -@touch .config
  385. @$(CONFIG)/conf ${W} $(CONFIG_CONFIG_IN)
  386. ${POSTCONFIG}
  387. .NOTPARALLEL: _mconfig
  388. _mconfig: ${CONFIG}/conf _mconfig2 _config
  389. _mconfig2: ${CONFIG}/conf modconfig .menu
  390. @${CONFIG}/conf -m ${RCONFIG} >/dev/null
  391. distclean:
  392. @$(MAKE) -C $(CONFIG) clean
  393. @rm -rf $(BUILD_DIR_PFX) $(BIN_DIR_PFX) $(TARGET_DIR_PFX) $(DISTDIR) \
  394. ${TOPDIR}/.cfg* ${TOPDIR}/package/pkglist.d
  395. @rm -rf $(TOOLCHAIN_BUILD_DIR_PFX) $(STAGING_PARENT_PFX) $(TOOLS_BUILD_DIR)
  396. @rm -f .config* .defconfig .tmpconfig.h all.config ${TOPDIR}/prereq.mk \
  397. .menu ${TOPDIR}/package/*/info.mk ${TOPDIR}/package/Depends.mk .ADK_HAVE_DOT_CONFIG
  398. endif # ! ifeq ($(strip $(ADK_HAVE_DOT_CONFIG)),y)
  399. # build all targets and combinations
  400. bulk:
  401. @while read target libc fs; do \
  402. mkdir -p $(TOPDIR)/bin/$${target}_$$libc; \
  403. ( \
  404. echo === building $$target $$libc $$fs on $$(date); \
  405. $(GMAKE) prereq && \
  406. $(GMAKE) TARGET=$$target LIBC=$$libc FS=$$fs defconfig; \
  407. $(GMAKE) VERBOSE=1 all; \
  408. rm .config; \
  409. ) 2>&1 | tee $(TOPDIR)/bin/$${target}_$$libc/$$target-$$libc-$$fs.log; \
  410. done <${TOPDIR}/target/bulkdef.lst
  411. bulktoolchain:
  412. @while read target libc; do \
  413. mkdir -p $(TOPDIR)/bin/$${target}_$$libc; \
  414. ( \
  415. echo === building $$target $$libc on $$(date); \
  416. $(GMAKE) prereq && \
  417. $(GMAKE) TARGET=$$target LIBC=$$libc defconfig; \
  418. $(GMAKE) VERBOSE=1 all; \
  419. rm .config; \
  420. ) 2>&1 | tee $(TOPDIR)/bin/$${target}_$$libc/$$target-$$libc.log; \
  421. done <${TOPDIR}/target/bulktool.lst
  422. bulkall:
  423. @while read target libc fs; do \
  424. mkdir -p $(TOPDIR)/bin/$${target}_$$libc; \
  425. ( \
  426. echo === building $$target $$libc $$fs on $$(date); \
  427. $(GMAKE) prereq && \
  428. $(GMAKE) TARGET=$$target LIBC=$$libc FS=$$fs allconfig; \
  429. $(GMAKE) VERBOSE=1 all; \
  430. rm .config; \
  431. ) 2>&1 | tee $(TOPDIR)/bin/$${target}_$$libc/$$target-$$libc-$$fs.log; \
  432. done <${TOPDIR}/target/bulk.lst
  433. bulkallmod:
  434. @while read target libc fs; do \
  435. mkdir -p $(TOPDIR)/bin/$${target}_$$libc; \
  436. ( \
  437. echo === building $$target $$libc $$fs on $$(date); \
  438. $(GMAKE) prereq && \
  439. $(GMAKE) TARGET=$$target LIBC=$$libc FS=$$fs allmodconfig; \
  440. $(GMAKE) VERBOSE=1 all; \
  441. rm .config; \
  442. ) 2>&1 | tee $(TOPDIR)/bin/$${target}_$$libc/$$target-$$libc-$$fs.log; \
  443. done <${TOPDIR}/target/bulk.lst
  444. menu .menu: $(wildcard ${TOPDIR}/package/*/Makefile)
  445. @echo "Generating menu structure ..."
  446. mksh $(TOPDIR)/package/pkgmaker
  447. @:>.menu
  448. dep:
  449. @echo "Generating dependencies ..."
  450. mksh $(TOPDIR)/package/depmaker
  451. .PHONY: menu dep