build.mk 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546
  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. for i in ADK_RUNTIME_PASSWORD ADK_RUNTIME_HOSTNAME ADK_TARGET_ROOTFS;do \
  73. if [ "$$(grep ^$$i .config|md5sum)" != "$$(grep ^$$i .config.old|md5sum)" ];then \
  74. touch .rebuild.base-files;\
  75. rebuild=1;\
  76. fi; \
  77. done; \
  78. if [ "$$(grep ^ADK_RUNTIME_TIMEZONE .config|md5sum)" != "$$(grep ^ADK_RUNTIME_TIMEZONE .config.old|md5sum)" ];then \
  79. touch .rebuild.eglibc .rebuild.uclibc .rebuild.glibc;\
  80. rebuild=1;\
  81. fi; \
  82. if [ "$$(grep ^ADK_RUNTIME_SSH_PUBKEY .config|md5sum)" != "$$(grep ^ADK_RUNTIME_SSH_PUBKEY .config.old|md5sum)" ];then \
  83. touch .rebuild.dropbear .rebuild.openssh;\
  84. rebuild=1;\
  85. fi; \
  86. if [ $$rebuild -eq 1 ];then \
  87. cp .config .config.old;\
  88. fi; \
  89. fi; \
  90. fi
  91. # Pull in the user's configuration file
  92. ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
  93. -include $(TOPDIR)/.config
  94. endif
  95. ifeq ($(strip $(ADK_HAVE_DOT_CONFIG)),y)
  96. include $(TOPDIR)/rules.mk
  97. all: world
  98. ${TOPDIR}/package/Depends.mk: ${TOPDIR}/.config $(wildcard ${TOPDIR}/package/*/Makefile)
  99. $(TOPDIR)/bin/tools/depmaker > ${TOPDIR}/package/Depends.mk
  100. .NOTPARALLEL:
  101. .PHONY: all world clean cleantarget cleandir distclean image_clean
  102. world: $(DISTDIR) $(BUILD_DIR) $(TARGET_DIR) $(PACKAGE_DIR)
  103. ${BASH} ${TOPDIR}/scripts/scan-pkgs.sh
  104. ifeq ($(ADK_NATIVE),y)
  105. $(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
  106. else
  107. ifeq ($(ADK_TOOLCHAIN_ONLY),y)
  108. $(MAKE) -f mk/build.mk toolchain/install tools/install package/compile
  109. else
  110. $(MAKE) -f mk/build.mk toolchain/install tools/install target/config-prepare target/compile package/compile root_clean package/install target/install package_index
  111. endif
  112. endif
  113. package_index:
  114. ifeq ($(ADK_TARGET_PACKAGE_IPKG),y)
  115. -cd ${PACKAGE_DIR} && \
  116. ${BASH} ${TOPDIR}/scripts/ipkg-make-index.sh . >Packages
  117. endif
  118. $(DISTDIR):
  119. mkdir -p $(DISTDIR)
  120. $(BUILD_DIR):
  121. mkdir -p $(BUILD_DIR)
  122. $(TARGET_DIR):
  123. mkdir -p $(TARGET_DIR)
  124. $(PACKAGE_DIR):
  125. mkdir -p ${PACKAGE_DIR}/.stamps
  126. ${STAGING_DIR} ${STAGING_DIR}/etc ${STAGING_TOOLS}:
  127. mkdir -p ${STAGING_DIR}/{bin,etc,lib,usr/include} \
  128. ${STAGING_TOOLS}/{bin,lib}
  129. ${STAGING_DIR}/etc/ipkg.conf: ${STAGING_DIR}/etc
  130. ifeq ($(ADK_TARGET_PACKAGE_IPKG),y)
  131. echo "dest root /" >${STAGING_DIR}/etc/ipkg.conf
  132. echo "option offline_root ${TARGET_DIR}" >>$(STAGING_DIR)/etc/ipkg.conf
  133. endif
  134. package/%: ${STAGING_DIR}/etc/ipkg.conf ${TOPDIR}/package/Depends.mk
  135. $(MAKE) -C package $(patsubst package/%,%,$@)
  136. target/%:
  137. $(MAKE) -C target $(patsubst target/%,%,$@)
  138. toolchain/%: ${STAGING_DIR}
  139. $(MAKE) -C toolchain $(patsubst toolchain/%,%,$@)
  140. tools/%:
  141. $(MAKE) -C tools $(patsubst tools/%,%,$@)
  142. image:
  143. $(MAKE) -C target image
  144. switch:
  145. echo "Saving configuration for target: ${ADK_TARGET}"
  146. cp -p .config .config.${ADK_TARGET}
  147. if [ -f .config.old ];then cp -p .config.old .config.old.${ADK_TARGET};fi
  148. if [ -f .config.${TARGET} ];then cp -p .config.${TARGET} .config; \
  149. cp -p .config.old.${TARGET} .config.old; \
  150. echo "Setting configuration to target: ${TARGET}"; \
  151. else echo "No old target config found";mv .config .config.bak; make TARGET=${TARGET};fi
  152. kernelconfig:
  153. ifeq ($(ADKtype),)
  154. cp $(TOPDIR)/target/$(ADK_TARGET)/kernel.config $(BUILD_DIR)/linux/.config
  155. $(MAKE) -C $(BUILD_DIR)/linux/ ARCH=$(ARCH) menuconfig
  156. cp $(BUILD_DIR)/linux/.config $(TOPDIR)/target/$(ADK_TARGET)/kernel.config
  157. else
  158. cp $(TOPDIR)/target/$(ADKtype)/kernel.config $(BUILD_DIR)/linux/.config
  159. $(MAKE) -C $(BUILD_DIR)/linux/ ARCH=$(ARCH) menuconfig
  160. cp $(BUILD_DIR)/linux/.config $(TOPDIR)/target/$(ADKtype)/kernel.config
  161. endif
  162. # create a new package from package/.template
  163. newpackage:
  164. @echo "Creating new package $(PKG)"
  165. $(CP) $(TOPDIR)/package/.template $(TOPDIR)/package/$(PKG)
  166. pkg=$$(echo $(PKG)|tr '[:lower:]-' '[:upper:]_'); \
  167. $(SED) "s#@UPKG@#$$pkg#" $(TOPDIR)/package/$(PKG)/Makefile
  168. $(SED) 's#@PKG@#$(PKG)#' $(TOPDIR)/package/$(PKG)/Makefile
  169. $(SED) 's#@VER@#$(VER)#' $(TOPDIR)/package/$(PKG)/Makefile
  170. @echo "Edit package/$(PKG)/Makefile to complete"
  171. root_clean:
  172. @$(TRACE) root_clean
  173. rm -rf $(TARGET_DIR)
  174. mkdir -p $(TARGET_DIR)
  175. # Do a per-package clean here, too. This way stale headers and
  176. # libraries from cross_*/target/ get wiped away, which keeps
  177. # future package build's configure scripts from returning false
  178. # dependencies information.
  179. clean:
  180. @$(TRACE) clean
  181. $(MAKE) -C $(CONFIG) clean
  182. for d in ${STAGING_PARENT}; do \
  183. for f in $$(ls $$d/pkg/[a-z]* 2>/dev/null); do \
  184. while read file ; do \
  185. rm $$d/target/$$file 2>/dev/null; \
  186. done < $$f ; \
  187. rm $$f ; \
  188. done \
  189. done
  190. rm -rf $(BUILD_DIR) $(BIN_DIR) $(TARGET_DIR) \
  191. ${TOPDIR}/package/pkglist.d
  192. rm -f ${TOPDIR}/package/Depends.mk
  193. cleankernel:
  194. @$(TRACE) cleankernel
  195. rm -rf $(TOOLCHAIN_BUILD_DIR)/w-linux* $(BUILD_DIR)/linux
  196. cleandir:
  197. @$(TRACE) cleandir
  198. @$(MAKE) -C $(CONFIG) clean $(MAKE_TRACE)
  199. rm -rf $(BUILD_DIR_PFX) $(BIN_DIR_PFX) $(TARGET_DIR_PFX) \
  200. ${TOPDIR}/package/pkglist.d ${TOPDIR}/package/pkgconfigs.d
  201. rm -rf $(TOOLCHAIN_BUILD_DIR_PFX) $(STAGING_PARENT_PFX) $(TOOLS_BUILD_DIR)
  202. rm -f .menu .tmpconfig.h .rebuild* \
  203. ${TOPDIR}/package/Depends.mk ${TOPDIR}/prereq.mk \
  204. cleantarget:
  205. @$(TRACE) cleantarget
  206. @$(MAKE) -C $(CONFIG) clean $(MAKE_TRACE)
  207. rm -rf $(BUILD_DIR) $(BIN_DIR) $(TARGET_DIR)
  208. rm -rf $(TOOLCHAIN_BUILD_DIR) $(STAGING_PARENT)
  209. rm -f .tmpconfig.h all.config .defconfig
  210. distclean:
  211. @$(TRACE) distclean
  212. @$(MAKE) -C $(CONFIG) clean $(MAKE_TRACE)
  213. @rm -rf $(BUILD_DIR_PFX) $(BIN_DIR_PFX) $(TARGET_DIR_PFX) $(DISTDIR) \
  214. ${TOPDIR}/package/pkglist.d ${TOPDIR}/package/pkgconfigs.d
  215. @rm -rf $(TOOLCHAIN_BUILD_DIR_PFX) $(STAGING_PARENT_PFX) $(TOOLS_BUILD_DIR)
  216. @rm -f .config* .defconfig .tmpconfig.h all.config ${TOPDIR}/prereq.mk \
  217. .menu ${TOPDIR}/package/Depends.mk .ADK_HAVE_DOT_CONFIG .rebuild.*
  218. else # ! ifeq ($(strip $(ADK_HAVE_DOT_CONFIG)),y)
  219. ifeq ($(filter-out distclean,${MAKECMDGOALS}),)
  220. include ${TOPDIR}/mk/vars.mk
  221. else
  222. include $(TOPDIR)/prereq.mk
  223. export BASH HOSTCC HOSTCFLAGS HOSTCXX HOSTCXXFLAGS MAKE LANGUAGE LC_ALL OStype PATH
  224. endif
  225. all: menuconfig
  226. @echo "Start the build with \"make\" or with \"make v\" to be verbose"
  227. # configuration
  228. # ---------------------------------------------------------------------------
  229. # force entering the subdir, as dependency checking is done there
  230. .PHONY: $(CONFIG)/conf $(CONFIG)/mconf $(CONFIG)/gconf
  231. $(CONFIG)/conf:
  232. @$(MAKE) -C $(CONFIG) conf
  233. $(CONFIG)/mconf:
  234. @$(MAKE) -C $(CONFIG)
  235. $(CONFIG)/gconf:
  236. @$(MAKE) -C $(CONFIG) gconf
  237. defconfig: .menu $(CONFIG)/conf
  238. ifeq (${OStype},Linux)
  239. @echo ADK_HOST_LINUX=y > $(TOPDIR)/.defconfig
  240. endif
  241. ifeq (${OStype},FreeBSD)
  242. @echo ADK_HOST_FREEBSD=y > $(TOPDIR)/.defconfig
  243. endif
  244. ifeq (${OStype},MirBSD)
  245. @echo ADK_HOST_MIRBSD=y > $(TOPDIR)/.defconfig
  246. endif
  247. ifeq (${OStype},OpenBSD)
  248. @echo ADK_HOST_OPENBSD=y > $(TOPDIR)/.defconfig
  249. endif
  250. ifeq (${OStype},NetBSD)
  251. @echo ADK_HOST_NETBSD=y > $(TOPDIR)/.defconfig
  252. endif
  253. ifeq (${OStype},Darwin)
  254. @echo ADK_HOST_DARWIN=y > $(TOPDIR)/.defconfig
  255. endif
  256. ifneq (,$(filter CYGWIN%,${OStype}))
  257. @echo ADK_HOST_CYGWIN=y > $(TOPDIR)/.defconfig
  258. endif
  259. ifeq ($(ADKtype),ibmx40)
  260. @echo ADK_HARDWARE_IBMX40=y >> $(TOPDIR)/.defconfig
  261. endif
  262. ifeq ($(ADKtype),lemote)
  263. @echo ADK_HARDWARE_YEELONG=y >> $(TOPDIR)/.defconfig
  264. endif
  265. @if [ ! -z "$(TARGET)" ];then \
  266. grep "^config" target/Config.in \
  267. |grep -i "$(TARGET)"\$$ \
  268. |sed -e "s#^config \(.*\)#\1=y#" \
  269. >> $(TOPDIR)/.defconfig; \
  270. fi
  271. @for symbol in ${DEFCONFIG}; do \
  272. echo $$symbol >> $(TOPDIR)/.defconfig; \
  273. done
  274. @if [ ! -z "$(FS)" ];then \
  275. grep "^config" target/Config.in \
  276. |grep -i "$(FS)" \
  277. |sed -e "s#^config \(.*\)#\1=y#" \
  278. >> $(TOPDIR)/.defconfig; \
  279. fi
  280. @if [ ! -z "$(PKG)" ];then \
  281. grep "^config" target/Config.in \
  282. |grep -i "$(PKG)" \
  283. |sed -e "s#^config \(.*\)#\1=y#" \
  284. >> $(TOPDIR)/.defconfig; \
  285. fi
  286. @if [ ! -z "$(LIBC)" ];then \
  287. grep "^config" target/Config.in \
  288. |grep -i "$(LIBC)" \
  289. |sed -e "s#^config \(.*\)#\1=y#" \
  290. >> $(TOPDIR)/.defconfig; \
  291. fi
  292. ifneq (,$(filter %_qemu,${TARGET}))
  293. @echo ADK_LINUX_QEMU=y >> $(TOPDIR)/.defconfig
  294. endif
  295. ifneq (,$(filter %_toolchain,${TARGET}))
  296. @echo ADK_LINUX_TOOLCHAIN=y >> $(TOPDIR)/.defconfig
  297. endif
  298. ifneq (,$(filter rescue%,${TARGET}))
  299. @echo ADK_LINUX_RESCUE=y >> $(TOPDIR)/.defconfig
  300. endif
  301. ifneq (,$(filter rb%,${TARGET}))
  302. @echo ADK_LINUX_MIKROTIK=y >> $(TOPDIR)/.defconfig
  303. endif
  304. ifneq (,$(filter alix%,${TARGET}))
  305. @echo ADK_LINUX_ALIX=y >> $(TOPDIR)/.defconfig
  306. endif
  307. ifneq (,$(filter wrap%,${TARGET}))
  308. @echo ADK_LINUX_ALIX=y >> $(TOPDIR)/.defconfig
  309. endif
  310. @if [ ! -z "$(TARGET)" ];then \
  311. $(CONFIG)/conf -D .defconfig $(CONFIG_CONFIG_IN); \
  312. fi
  313. modconfig:
  314. ifeq (${OStype},Linux)
  315. @echo ADK_HOST_LINUX=y > $(TOPDIR)/all.config
  316. endif
  317. ifeq (${OStype},FreeBSD)
  318. @echo ADK_HOST_FREEBSD=y > $(TOPDIR)/all.config
  319. endif
  320. ifeq (${OStype},MirBSD)
  321. @echo ADK_HOST_MIRBSD=y > $(TOPDIR)/all.config
  322. endif
  323. ifeq (${OStype},OpenBSD)
  324. @echo ADK_HOST_OPENBSD=y > $(TOPDIR)/all.config
  325. endif
  326. ifeq (${OStype},NetBSD)
  327. @echo ADK_HOST_NETBSD=y > $(TOPDIR)/all.config
  328. endif
  329. ifeq (${OStype},Darwin)
  330. @echo ADK_HOST_DARWIN=y > $(TOPDIR)/all.config
  331. endif
  332. ifneq (,$(filter CYGWIN%,${OStype}))
  333. @echo ADK_HOST_CYGWIN=y > $(TOPDIR)/all.config
  334. endif
  335. ifeq ($(ADKtype),ibmx40)
  336. @echo ADK_HARDWARE_IBMX40=y >> $(TOPDIR)/all.config
  337. endif
  338. ifeq ($(ADKtype),lemote)
  339. @echo ADK_HARDWARE_YEELONG=y >> $(TOPDIR)/all.config
  340. endif
  341. @if [ ! -z "$(TARGET)" ];then \
  342. grep "^config" target/Config.in \
  343. |grep -i "$(TARGET)"\$$ \
  344. |sed -e "s#^config \(.*\)#\1=y#" \
  345. >> $(TOPDIR)/all.config; \
  346. fi
  347. @for symbol in ${DEFCONFIG}; do \
  348. echo $$symbol >> $(TOPDIR)/all.config; \
  349. done
  350. @if [ ! -z "$(FS)" ];then \
  351. grep "^config" target/Config.in \
  352. |grep -i "$(FS)" \
  353. |sed -e "s#^config \(.*\)#\1=y#" \
  354. >> $(TOPDIR)/all.config; \
  355. fi
  356. @if [ ! -z "$(PKG)" ];then \
  357. grep "^config" target/Config.in \
  358. |grep -i "$(PKG)" \
  359. |sed -e "s#^config \(.*\)#\1=y#" \
  360. >> $(TOPDIR)/all.config; \
  361. fi
  362. @if [ ! -z "$(LIBC)" ];then \
  363. grep "^config" target/Config.in \
  364. |grep -i "$(LIBC)" \
  365. |sed -e "s#^config \(.*\)#\1=y#" \
  366. >> $(TOPDIR)/all.config; \
  367. fi
  368. ifneq (,$(filter %_qemu,${TARGET}))
  369. @echo ADK_LINUX_QEMU=y >> $(TOPDIR)/all.config
  370. endif
  371. ifneq (,$(filter %_toolchain,${TARGET}))
  372. @echo ADK_LINUX_TOOLCHAIN=y >> $(TOPDIR)/all.config
  373. endif
  374. ifneq (,$(filter %_rescue,${TARGET}))
  375. @echo ADK_LINUX_RESCUE=y >> $(TOPDIR)/all.config
  376. endif
  377. ifneq (,$(filter rb%,${TARGET}))
  378. @echo ADK_LINUX_MIKROTIK=y >> $(TOPDIR)/all.config
  379. endif
  380. ifneq (,$(filter alix%,${TARGET}))
  381. @echo ADK_LINUX_ALIX=y >> $(TOPDIR)/all.config
  382. endif
  383. ifneq (,$(filter wrap%,${TARGET}))
  384. @echo ADK_LINUX_ALIX=y >> $(TOPDIR)/all.config
  385. endif
  386. menuconfig: $(CONFIG)/mconf defconfig .menu package/Config.in.auto
  387. @if [ ! -f .config ];then \
  388. $(CONFIG)/conf -D .defconfig $(CONFIG_CONFIG_IN); \
  389. fi
  390. @$(CONFIG)/mconf $(CONFIG_CONFIG_IN)
  391. ${POSTCONFIG}
  392. guiconfig: $(CONFIG)/gconf defconfig .menu package/Config.in.auto
  393. @if [ ! -f .config ];then \
  394. $(CONFIG)/conf -D .defconfig $(CONFIG_CONFIG_IN); \
  395. fi
  396. @$(CONFIG)/gconf $(CONFIG_CONFIG_IN)
  397. ${POSTCONFIG}
  398. _config: $(CONFIG)/conf .menu package/Config.in.auto
  399. -@touch .config
  400. @$(CONFIG)/conf ${W} $(CONFIG_CONFIG_IN)
  401. ${POSTCONFIG}
  402. .NOTPARALLEL: _mconfig
  403. _mconfig: ${CONFIG}/conf _mconfig2 _config
  404. _mconfig2: ${CONFIG}/conf modconfig .menu
  405. @${CONFIG}/conf -m ${RCONFIG} >/dev/null
  406. distclean:
  407. @$(MAKE) -C $(CONFIG) clean
  408. @rm -rf $(BUILD_DIR_PFX) $(BIN_DIR_PFX) $(TARGET_DIR_PFX) $(DISTDIR) \
  409. ${TOPDIR}/package/pkglist.d ${TOPDIR}/package/pkgconfigs.d
  410. @rm -rf $(TOOLCHAIN_BUILD_DIR_PFX) $(STAGING_PARENT_PFX) $(TOOLS_BUILD_DIR)
  411. @rm -f .config* .defconfig .tmpconfig.h all.config ${TOPDIR}/prereq.mk \
  412. .menu .rebuild.* ${TOPDIR}/package/Depends.mk .ADK_HAVE_DOT_CONFIG
  413. endif # ! ifeq ($(strip $(ADK_HAVE_DOT_CONFIG)),y)
  414. # build all targets and combinations
  415. bulk:
  416. @while read target libc fs; do \
  417. mkdir -p $(TOPDIR)/bin/$${target}_$$libc; \
  418. ( \
  419. echo === building $$target $$libc $$fs on $$(date); \
  420. $(GMAKE) prereq && \
  421. $(GMAKE) TARGET=$$target LIBC=$$libc FS=$$fs defconfig; \
  422. $(GMAKE) VERBOSE=1 all; if [ $$? -ne 0 ]; then touch .exit;fi; \
  423. rm .config; \
  424. ) 2>&1 | tee $(TOPDIR)/bin/$${target}_$$libc/$$target-$$libc-$$fs.log; \
  425. if [ -f .exit ];then echo "Bulk build failed!"; rm .exit; exit 1;fi \
  426. done <${TOPDIR}/target/bulkdef.lst
  427. bulktoolchain:
  428. @while read target libc; do \
  429. mkdir -p $(TOPDIR)/bin/$${target}_$$libc; \
  430. ( \
  431. echo === building $$target $$libc on $$(date); \
  432. $(GMAKE) prereq && \
  433. $(GMAKE) TARGET=$$target LIBC=$$libc defconfig; \
  434. $(GMAKE) VERBOSE=1 all; if [ $$? -ne 0 ]; then touch .exit;fi; \
  435. rm .config; \
  436. ) 2>&1 | tee $(TOPDIR)/bin/$${target}_$$libc/$$target-$$libc.log; \
  437. if [ -f .exit ];then echo "Bulk build failed!"; rm .exit; exit 1;fi \
  438. done <${TOPDIR}/target/bulktool.lst
  439. bulkall:
  440. @while read target libc fs; do \
  441. mkdir -p $(TOPDIR)/bin/$${target}_$$libc; \
  442. ( \
  443. echo === building $$target $$libc $$fs on $$(date); \
  444. $(GMAKE) prereq && \
  445. $(GMAKE) TARGET=$$target LIBC=$$libc FS=$$fs allconfig; \
  446. $(GMAKE) VERBOSE=1 all; if [ $$? -ne 0 ]; then touch .exit;fi; \
  447. rm .config; \
  448. ) 2>&1 | tee $(TOPDIR)/bin/$${target}_$$libc/$$target-$$libc-$$fs.log; \
  449. if [ -f .exit ];then echo "Bulk build failed!"; rm .exit; exit 1;fi \
  450. done <${TOPDIR}/target/bulk.lst
  451. bulkallmod:
  452. @while read target libc fs; do \
  453. mkdir -p $(TOPDIR)/bin/$${target}_$$libc; \
  454. ( \
  455. echo === building $$target $$libc $$fs on $$(date); \
  456. $(GMAKE) prereq && \
  457. $(GMAKE) TARGET=$$target LIBC=$$libc FS=$$fs allmodconfig; \
  458. $(GMAKE) VERBOSE=1 all; if [ $$? -ne 0 ]; then touch .exit;fi; \
  459. rm .config; \
  460. ) 2>&1 | tee $(TOPDIR)/bin/$${target}_$$libc/$$target-$$libc-$$fs.log; \
  461. if [ -f .exit ];then echo "Bulk build failed!"; rm .exit; exit 1;fi \
  462. done <${TOPDIR}/target/bulk.lst
  463. ${TOPDIR}/bin/tools/pkgmaker:
  464. @mkdir -p $(TOPDIR)/bin/tools
  465. @$(HOSTCC) -g -o $@ tools/adk/pkgmaker.c tools/adk/sortfile.c tools/adk/strmap.c
  466. ${TOPDIR}/bin/tools/pkgrebuild:
  467. @mkdir -p $(TOPDIR)/bin/tools
  468. @$(HOSTCC) -g -o $@ tools/adk/pkgrebuild.c tools/adk/strmap.c
  469. package/Config.in.auto menu .menu: $(wildcard ${TOPDIR}/package/*/Makefile) ${TOPDIR}/bin/tools/pkgmaker ${TOPDIR}/bin/tools/pkgrebuild
  470. @echo "Generating menu structure ..."
  471. @$(TOPDIR)/bin/tools/pkgmaker
  472. @:>.menu
  473. dep:
  474. @echo "Generating dependencies ..."
  475. $(TOPDIR)/bin/tools/depmaker > ${TOPDIR}/package/Depends.mk
  476. .PHONY: menu dep
  477. include $(TOPDIR)/toolchain/gcc/Makefile.inc
  478. check:
  479. @-rm tests/adk.exp tests/master.exp
  480. @sed -e "s#@ADK_TARGET_IP@#$(ADK_TARGET_IP)#" tests/adk.exp.in > \
  481. tests/adk.exp
  482. @sed -e "s#@TOPDIR@#$(TOPDIR)#" tests/master.exp.in > \
  483. tests/master.exp
  484. env DEJAGNU=$(TOPDIR)/tests/master.exp \
  485. $(MAKE) -C $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/$(PKG_NAME)-$(PKG_VERSION)-final/gcc check-gcc