build.mk 16 KB

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