build.mk 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480
  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 = adk/config
  10. DEFCONFIG= ADK_DEBUG=n \
  11. ADK_DISABLE_KERNEL_PATCHES=n \
  12. ADK_DISABLE_TARGET_KERNEL_PATCHES=n \
  13. ADK_WGET_TIMEOUT=180 \
  14. ADK_MAKE_PARALLEL=y \
  15. ADK_MAKE_JOBS=4 \
  16. ADK_LEAVE_ETC_ALONE=n \
  17. ADK_SIMPLE_NETWORK_CONFIG=n \
  18. ADK_USE_CCACHE=n \
  19. ADK_RUNTIME_START_SERVICES=n \
  20. ADK_PACKAGE_BASE_FILES=y \
  21. ADK_PACKAGE_KEXECINIT=n \
  22. ADK_PACKAGE_LM_SENSORS_DETECT=n \
  23. ADK_PACKAGE_CLASSPATH=n \
  24. ADK_PACKAGE_U_BOOT=n \
  25. ADK_PACKAGE_CRYPTINIT=n \
  26. ADK_PACKAGE_VIRTINST=n \
  27. ADK_PACKAGE_URLGRABBER=n \
  28. ADK_PACKAGE_LIBSSP=n \
  29. ADK_PACKAGE_OPENAFS=n \
  30. ADK_KERNEL_ADDON_YAFFS2=n \
  31. ADK_KERNEL_ADDON_GRSEC=n \
  32. ADK_KERNEL_ADDON_MPTCP=n \
  33. ADK_KERNEL_MPTCP=n \
  34. ADK_PKG_XORG=n \
  35. ADK_PKG_CONSOLE=n \
  36. ADK_PKG_TEST=n \
  37. ADK_PKG_MPDBOX=n \
  38. ADK_PKG_DEVELOPMENT=n \
  39. ADK_TOOLCHAIN_WITH_SSP=n \
  40. ADK_TARGET_USE_SSP=n \
  41. ADK_TOOLCHAIN_WITH_LTO=n \
  42. ADK_TARGET_USE_LTO=n \
  43. ADK_TOOLCHAIN_WITH_GOLD=n \
  44. ADK_TARGET_USE_GOLD=n \
  45. ADK_TARGET_USE_GNU_HASHSTYLE=n \
  46. ADK_TARGET_USE_PIE=n \
  47. ADK_TARGET_USE_STATIC_LIBS=n \
  48. ADK_TARGET_USE_LD_RELRO=n \
  49. ADK_TARGET_USE_LD_BIND_NOW=n \
  50. ADK_TARGET_USE_LD_GC=n \
  51. ADK_LINUX_ARM_WITH_THUMB=n \
  52. BUSYBOX_IFPLUGD=n \
  53. BUSYBOX_EXTRA_COMPAT=n \
  54. BUSYBOX_FEATURE_IFCONFIG_SLIP=n \
  55. BUSYBOX_BBCONFIG=n \
  56. BUSYBOX_SELINUX=n \
  57. BUSYBOX_INSTALL_NO_USR=n \
  58. BUSYBOX_MODPROBE_SMALL=n \
  59. BUSYBOX_EJECT=n \
  60. BUSYBOX_UBIDETACH=n \
  61. BUSYBOX_UBIATTACH=n \
  62. BUSYBOX_BUILD_LIBBUSYBOX=n \
  63. BUSYBOX_FEATURE_2_4_MODULES=n \
  64. BUSYBOX_LOCALE_SUPPORT=n \
  65. BUSYBOX_FEATURE_PREFER_APPLETS=n \
  66. BUSYBOX_FEATURE_SUID=n \
  67. BUSYBOX_SELINUXENABLED=n \
  68. BUSYBOX_FEATURE_INSTALLER=n \
  69. BUSYBOX_PAM=n \
  70. BUSYBOX_FLASH_LOCK=n \
  71. BUSYBOX_FLASH_UNLOCK=n \
  72. BUSYBOX_FLASH_ERASEALL=n \
  73. BUSYBOX_PIE=n \
  74. BUSYBOX_TASKSET=n \
  75. BUSYBOX_DEBUG=n \
  76. BUSYBOX_NOMMU=n \
  77. BUSYBOX_WERROR=n \
  78. BUSYBOX_STATIC=n \
  79. BUSYBOX_FEATURE_AIX_LABEL=n \
  80. BUSYBOX_FEATURE_SUN_LABEL=n \
  81. BUSYBOX_FEATURE_OSF_LABEL=n \
  82. BUSYBOX_FEATURE_SGI_LABEL=n \
  83. BUSYBOX_FEATURE_INETD_RPC=n \
  84. BUSYBOX_FEATURE_MOUNT_NFS=n \
  85. BUSYBOX_FEATURE_VI_REGEX_SEARCH=n \
  86. ADK_KERNEL_RT2X00_DEBUG=n \
  87. ADK_KERNEL_ATH5K_DEBUG=n \
  88. ADK_KERNEL_BUG=n \
  89. ADK_KERNEL_DEBUG_WITH_KGDB=n
  90. noconfig_targets:= menuconfig \
  91. _config \
  92. _mconfig \
  93. distclean \
  94. defconfig
  95. POSTCONFIG= -@\
  96. if [ -f .adkinit ];then rm .adkinit;\
  97. else \
  98. if [ -f .config.old ];then \
  99. $(TOPDIR)/adk/tools/pkgrebuild;\
  100. rebuild=0; \
  101. if [ "$$(grep ^BUSYBOX .config|md5sum)" != "$$(grep ^BUSYBOX .config.old|md5sum)" ];then \
  102. touch .rebuild.busybox;\
  103. rebuild=1;\
  104. fi; \
  105. for i in ADK_RUNTIME_PASSWORD ADK_RUNTIME_TMPFS_SIZE ADK_RUNTIME_HOSTNAME ADK_TARGET_ROOTFS ADK_RUNTIME_CONSOLE ADK_RUNTIME_GETTY ADK_RUNTIME_SHELL;do \
  106. if [ "$$(grep ^$$i .config|md5sum)" != "$$(grep ^$$i .config.old|md5sum)" ];then \
  107. touch .rebuild.base-files;\
  108. rebuild=1;\
  109. fi; \
  110. done; \
  111. if [ "$$(grep ^ADK_RUNTIME_TIMEZONE .config|md5sum)" != "$$(grep ^ADK_RUNTIME_TIMEZONE .config.old|md5sum)" ];then \
  112. touch .rebuild.musl .rebuild.uclibc .rebuild.glibc;\
  113. rebuild=1;\
  114. fi; \
  115. if [ "$$(grep ^ADK_RUNTIME_SSH_PUBKEY .config|md5sum)" != "$$(grep ^ADK_RUNTIME_SSH_PUBKEY .config.old|md5sum)" ];then \
  116. touch .rebuild.dropbear .rebuild.openssh;\
  117. rebuild=1;\
  118. fi; \
  119. if [ "$$(grep ^ADK_RUNTIME_KBD_LAYOUT .config|md5sum)" != "$$(grep ^ADK_RUNTIME_KBD_LAYOUT .config.old|md5sum)" ];then \
  120. touch .rebuild.bkeymaps;\
  121. rebuild=1;\
  122. fi; \
  123. if [ "$$(grep ^ADK_TARGET_GPU_MEM .config|md5sum)" != "$$(grep ^ADK_TARGET_GPU_MEM .config.old|md5sum)" ];then \
  124. touch .rebuild.bcm2835-bootloader;\
  125. rebuild=1;\
  126. fi; \
  127. if [ "$$(grep ^ADK_KERNEL_ADDON .config|md5sum)" != "$$(grep ^ADK_KERNEL_ADDON .config.old|md5sum)" ];then \
  128. make cleankernel;\
  129. fi; \
  130. if [ $$rebuild -eq 1 ];then \
  131. cp .config .config.old;\
  132. fi; \
  133. fi; \
  134. fi
  135. # Pull in the user's configuration file
  136. ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
  137. -include $(TOPDIR)/.config
  138. endif
  139. ifeq ($(strip $(ADK_HAVE_DOT_CONFIG)),y)
  140. include $(TOPDIR)/rules.mk
  141. all: world
  142. ${TOPDIR}/package/Depends.mk: ${TOPDIR}/.config $(wildcard ${TOPDIR}/package/*/Makefile) $(TOPDIR)/adk/tools/depmaker
  143. @echo "Generating dependencies ..."
  144. $(TOPDIR)/adk/tools/depmaker > ${TOPDIR}/package/Depends.mk
  145. .NOTPARALLEL:
  146. .PHONY: all world clean cleandir cleantoolchain distclean image_clean
  147. world:
  148. @mkdir -p $(DL_DIR) $(HOST_BUILD_DIR) $(BUILD_DIR) $(TARGET_DIR) $(FW_DIR) \
  149. $(STAGING_HOST_DIR) $(TOOLCHAIN_BUILD_DIR) $(STAGING_PKG_DIR)/stamps
  150. ${BASH} ${TOPDIR}/scripts/scan-pkgs.sh
  151. ifeq ($(ADK_TARGET_TOOLCHAIN),y)
  152. ifeq ($(ADK_TOOLCHAIN_ONLY),y)
  153. $(MAKE) -f mk/build.mk package/hostcompile toolchain/fixup package/compile
  154. else
  155. $(MAKE) -f mk/build.mk package/hostcompile toolchain/fixup package/compile root_clean package/install
  156. endif
  157. else
  158. $(MAKE) -f mk/build.mk package/hostcompile toolchain/fixup target/config-prepare target/compile package/compile root_clean package/install target/install package_index
  159. endif
  160. package_index:
  161. ifeq ($(ADK_TARGET_PACKAGE_IPKG),y)
  162. -cd ${PACKAGE_DIR} && \
  163. ${BASH} ${TOPDIR}/scripts/ipkg-make-index.sh . >Packages
  164. endif
  165. ${STAGING_TARGET_DIR} ${STAGING_TARGET_DIR}/etc ${STAGING_HOST_DIR}:
  166. @mkdir -p ${STAGING_TARGET_DIR}/{bin,etc,lib,usr/bin,usr/include,usr/lib/pkgconfig} \
  167. ${STAGING_HOST_DIR}/{usr/bin,usr/lib,usr/include}
  168. @for i in lib64 lib32 libx32;do \
  169. cd ${STAGING_TARGET_DIR}/; ln -sf lib $$i; \
  170. cd ${STAGING_TARGET_DIR}/usr; ln -sf lib $$i; \
  171. done
  172. ${STAGING_TARGET_DIR}/etc/ipkg.conf: ${STAGING_TARGET_DIR}/etc
  173. ifeq ($(ADK_TARGET_PACKAGE_IPKG),y)
  174. echo "dest root /" >${STAGING_TARGET_DIR}/etc/ipkg.conf
  175. echo "option offline_root ${TARGET_DIR}" >>$(STAGING_TARGET_DIR)/etc/ipkg.conf
  176. endif
  177. package/%: ${STAGING_TARGET_DIR}/etc/ipkg.conf ${TOPDIR}/package/Depends.mk
  178. $(MAKE) -C package $(patsubst package/%,%,$@)
  179. target/%:
  180. $(MAKE) -C target $(patsubst target/%,%,$@)
  181. toolchain/%: ${STAGING_TARGET_DIR}
  182. $(MAKE) -C toolchain $(patsubst toolchain/%,%,$@)
  183. image:
  184. $(MAKE) -C target image
  185. targethelp:
  186. $(MAKE) -C target targethelp
  187. kernelconfig:
  188. ${KERNEL_MAKE_ENV} ${MAKE} \
  189. ARCH=$(ADK_TARGET_ARCH) \
  190. ${KERNEL_MAKE_OPTS} \
  191. -C $(BUILD_DIR)/linux menuconfig
  192. # create a new package from package/.template
  193. newpackage:
  194. @echo "Creating new package $(PKG)"
  195. $(CP) $(TOPDIR)/package/.template$(TYPE) $(TOPDIR)/package/$(PKG)
  196. pkg=$$(echo $(PKG)|tr '[:lower:]-' '[:upper:]_'); \
  197. $(SED) "s#@UPKG@#$$pkg#" $(TOPDIR)/package/$(PKG)/Makefile
  198. $(SED) 's#@PKG@#$(PKG)#' $(TOPDIR)/package/$(PKG)/Makefile
  199. $(SED) 's#@VER@#$(VER)#' $(TOPDIR)/package/$(PKG)/Makefile
  200. @echo "Edit package/$(PKG)/Makefile to complete"
  201. root_clean:
  202. @$(TRACE) root_clean
  203. rm -rf $(TARGET_DIR)
  204. mkdir -p $(TARGET_DIR)
  205. touch $(TARGET_DIR)/.adk
  206. # Do a per-package clean here, too. This way stale headers and
  207. # libraries from target_*/ get wiped away, which keeps
  208. # future package build's configure scripts from returning false
  209. # dependencies information.
  210. clean:
  211. @$(TRACE) clean
  212. $(MAKE) -C $(CONFIG) clean
  213. for f in $$(ls ${STAGING_PKG_DIR}/ 2>/dev/null |grep -v [A-Z]|grep -v stamps 2>/dev/null); do \
  214. while read file ; do \
  215. rm ${STAGING_TARGET_DIR}/$$file 2>/dev/null;\
  216. done < ${STAGING_PKG_DIR}/$$f ; \
  217. rm ${STAGING_PKG_DIR}/$$f ; \
  218. done
  219. rm -rf $(BUILD_DIR) $(FW_DIR) $(TARGET_DIR) \
  220. ${TOPDIR}/package/pkglist.d
  221. rm -f ${TOPDIR}/package/Depends.mk
  222. cleankernel:
  223. @$(TRACE) cleankernel
  224. @rm -rf $(TOOLCHAIN_BUILD_DIR)/w-linux* $(BUILD_DIR)/linux
  225. cleandir:
  226. @$(TRACE) cleandir
  227. @$(MAKE) -C $(CONFIG) clean $(MAKE_TRACE)
  228. @rm -rf $(BUILD_DIR_PFX) $(FW_DIR_PFX) $(TARGET_DIR_PFX) \
  229. ${TOPDIR}/package/pkglist.d ${TOPDIR}/package/pkgconfigs.d
  230. @rm -rf $(TOOLCHAIN_DIR_PFX) $(STAGING_HOST_DIR_PFX)
  231. @rm -rf $(STAGING_TARGET_DIR_PFX) $(STAGING_PKG_DIR_PFX)
  232. @rm -f .menu .tmpconfig.h .rebuild* ${TOPDIR}/package/Depends.mk ${TOPDIR}/prereq.mk
  233. distclean:
  234. @$(TRACE) distclean
  235. @$(MAKE) -C $(CONFIG) clean $(MAKE_TRACE)
  236. @rm -rf $(BUILD_DIR_PFX) $(FW_DIR_PFX) $(TARGET_DIR_PFX) $(DL_DIR) \
  237. ${TOPDIR}/package/pkglist.d ${TOPDIR}/package/pkgconfigs.d
  238. @rm -rf $(TOOLCHAIN_DIR_PFX) $(STAGING_HOST_DIR_PFX)
  239. @rm -rf $(STAGING_TARGET_DIR_PFX) $(STAGING_PKG_DIR_PFX)
  240. @rm -f .adkinit .config* .defconfig .tmpconfig.h all.config ${TOPDIR}/prereq.mk \
  241. .menu ${TOPDIR}/package/Depends.mk .ADK_HAVE_DOT_CONFIG .rebuild.* \
  242. ${TOPDIR}/target/*/Config.in.{arch*,system*} ${TOPDIR}/package/Config.in.auto*
  243. else # ! ifeq ($(strip $(ADK_HAVE_DOT_CONFIG)),y)
  244. ifeq ($(filter-out distclean,${MAKECMDGOALS}),)
  245. include ${TOPDIR}/mk/vars.mk
  246. else
  247. include $(TOPDIR)/prereq.mk
  248. export BASH MAKE LANGUAGE LC_ALL OStype PATH CC_FOR_BUILD QEMU SHELL
  249. endif
  250. all: menuconfig
  251. @echo "Start the build with \"make\" or with \"make v\" to be verbose"
  252. # configuration
  253. # ---------------------------------------------------------------------------
  254. # force entering the subdir, as dependency checking is done there
  255. .PHONY: $(CONFIG)/conf $(CONFIG)/mconf
  256. $(CONFIG)/conf:
  257. @$(MAKE) -C $(CONFIG) conf
  258. $(CONFIG)/mconf:
  259. @$(MAKE) -C $(CONFIG)
  260. defconfig: .menu $(CONFIG)/conf
  261. ifeq (${OStype},Linux)
  262. @echo ADK_HOST_LINUX=y > $(TOPDIR)/.defconfig
  263. endif
  264. ifeq (${OStype},FreeBSD)
  265. @echo ADK_HOST_FREEBSD=y > $(TOPDIR)/.defconfig
  266. endif
  267. ifeq (${OStype},MirBSD)
  268. @echo ADK_HOST_MIRBSD=y > $(TOPDIR)/.defconfig
  269. endif
  270. ifeq (${OStype},OpenBSD)
  271. @echo ADK_HOST_OPENBSD=y > $(TOPDIR)/.defconfig
  272. endif
  273. ifeq (${OStype},NetBSD)
  274. @echo ADK_HOST_NETBSD=y > $(TOPDIR)/.defconfig
  275. endif
  276. ifeq (${OStype},Darwin)
  277. @echo ADK_HOST_DARWIN=y > $(TOPDIR)/.defconfig
  278. endif
  279. ifneq (,$(filter CYGWIN%,${OStype}))
  280. @echo ADK_HOST_CYGWIN=y > $(TOPDIR)/.defconfig
  281. endif
  282. @if [ ! -z "$(ADK_TARGET_ARCH)" ];then \
  283. grep "^config" target/config/Config.in.arch.choice \
  284. |grep -i "$(ADK_TARGET_ARCH)"\$$ \
  285. |sed -e "s#^config \(.*\)#\1=y#" \
  286. >> $(TOPDIR)/.defconfig; \
  287. fi
  288. @for symbol in ${DEFCONFIG}; do \
  289. echo $$symbol >> $(TOPDIR)/.defconfig; \
  290. done
  291. @if [ ! -z "$(ADK_TARGET_FS)" ];then \
  292. grep "^config" target/config/Config.in.target \
  293. |grep -i "$(ADK_TARGET_FS)" \
  294. |sed -e "s#^config \(.*\)#\1=y#" \
  295. >> $(TOPDIR)/.defconfig; \
  296. fi
  297. @if [ ! -z "$(ADK_TARGET_COLLECTION)" ];then \
  298. grep -h "^config" target/packages/pkg-available/* \
  299. |grep -i "$(ADK_TARGET_COLLECTION)" \
  300. |sed -e "s#^config \(.*\)#\1=y#" \
  301. >> $(TOPDIR)/.defconfig; \
  302. fi
  303. @if [ ! -z "$(ADK_TARGET_LIBC)" ];then \
  304. grep "^config" target/config/Config.in.libc.choice \
  305. |grep -i "$(ADK_TARGET_LIBC)" \
  306. |sed -e "s#^config \(.*\)#\1=y#" \
  307. >> $(TOPDIR)/.defconfig; \
  308. fi
  309. @if [ ! -z "$(ADK_TARGET_SYSTEM)" ];then \
  310. system=$$(echo "$(ADK_TARGET_SYSTEM)" |sed -e "s/-/_/g"); \
  311. grep -h "^config" target/*/Config.in.systems \
  312. |grep -i "$$system$$" \
  313. |sed -e "s#^config \(.*\)#\1=y#" \
  314. >> $(TOPDIR)/.defconfig; \
  315. fi
  316. @if [ ! -z "$(ADK_TARGET_SYSTEM)" ];then \
  317. $(CONFIG)/conf -D .defconfig $(CONFIG_CONFIG_IN); \
  318. fi
  319. modconfig:
  320. ifeq (${OStype},Linux)
  321. @echo ADK_HOST_LINUX=y > $(TOPDIR)/all.config
  322. endif
  323. ifeq (${OStype},FreeBSD)
  324. @echo ADK_HOST_FREEBSD=y > $(TOPDIR)/all.config
  325. endif
  326. ifeq (${OStype},MirBSD)
  327. @echo ADK_HOST_MIRBSD=y > $(TOPDIR)/all.config
  328. endif
  329. ifeq (${OStype},OpenBSD)
  330. @echo ADK_HOST_OPENBSD=y > $(TOPDIR)/all.config
  331. endif
  332. ifeq (${OStype},NetBSD)
  333. @echo ADK_HOST_NETBSD=y > $(TOPDIR)/all.config
  334. endif
  335. ifeq (${OStype},Darwin)
  336. @echo ADK_HOST_DARWIN=y > $(TOPDIR)/all.config
  337. endif
  338. ifneq (,$(filter CYGWIN%,${OStype}))
  339. @echo ADK_HOST_CYGWIN=y > $(TOPDIR)/all.config
  340. endif
  341. @if [ ! -z "$(ADK_TARGET_ARCH)" ];then \
  342. grep "^config" target/config/Config.in.arch.choice \
  343. |grep -i "$(ADK_TARGET_ARCH)"\$$ \
  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 "$(ADK_TARGET_FS)" ];then \
  351. grep "^config" target/config/Config.in.target \
  352. |grep -i "$(ADK_TARGET_FS)" \
  353. |sed -e "s#^config \(.*\)#\1=y#" \
  354. >> $(TOPDIR)/all.config; \
  355. fi
  356. @if [ ! -z "$(ADK_TARGET_LIBC)" ];then \
  357. grep "^config" target/config/Config.in.libc.choice \
  358. |grep -i "$(ADK_TARGET_LIBC)" \
  359. |sed -e "s#^config \(.*\)#\1=y#" \
  360. >> $(TOPDIR)/all.config; \
  361. fi
  362. @if [ ! -z "$(ADK_TARGET_SYSTEM)" ];then \
  363. system=$$(echo "$(ADK_TARGET_SYSTEM)" |sed -e "s/-/_/g"); \
  364. grep -h "^config" target/*/Config.in.systems \
  365. |grep -i "$$system" \
  366. |sed -e "s#^config \(.*\)#\1=y#" \
  367. >> $(TOPDIR)/all.config; \
  368. fi
  369. menuconfig: $(CONFIG)/mconf defconfig .menu
  370. @if [ ! -f .config ];then \
  371. $(CONFIG)/conf -D .defconfig $(CONFIG_CONFIG_IN); \
  372. fi
  373. @$(CONFIG)/mconf $(CONFIG_CONFIG_IN)
  374. ${POSTCONFIG}
  375. _config: $(CONFIG)/conf .menu
  376. -@touch .config
  377. @$(CONFIG)/conf ${W} $(CONFIG_CONFIG_IN)
  378. ${POSTCONFIG}
  379. .NOTPARALLEL: _mconfig
  380. _mconfig: ${CONFIG}/conf _mconfig2 _config
  381. _mconfig2: ${CONFIG}/conf modconfig .menu
  382. @${CONFIG}/conf -m ${RCONFIG} >/dev/null
  383. distclean:
  384. @$(MAKE) -C $(CONFIG) clean
  385. @rm -rf $(BUILD_DIR_PFX) $(FW_DIR_PFX) $(TARGET_DIR_PFX) $(DL_DIR) \
  386. ${TOPDIR}/package/pkglist.d ${TOPDIR}/package/pkgconfigs.d
  387. @rm -rf $(TOOLCHAIN_DIR_PFX) $(STAGING_TARGET_DIR_PFX)
  388. @rm -rf $(STAGING_HOST_DIR_PFX) $(STAGING_TARGET_DIR_PFX) $(STAGING_PKG_DIR_PFX)
  389. @rm -f .adkinit .config* .defconfig .tmpconfig.h all.config ${TOPDIR}/prereq.mk \
  390. .menu .rebuild.* ${TOPDIR}/package/Depends.mk .ADK_HAVE_DOT_CONFIG \
  391. ${TOPDIR}/target/*/Config.in.{arch*,system*} ${TOPDIR}/package/Config.in.auto*
  392. endif # ! ifeq ($(strip $(ADK_HAVE_DOT_CONFIG)),y)
  393. buildall:
  394. @mkdir -p firmware
  395. @echo "=== building $(ADK_TARGET_SYSTEM) ($(ADK_TARGET_ARCH)) with $(ADK_TARGET_LIBC) ==="
  396. $(GMAKE) ADK_TARGET_ARCH=$(ADK_TARGET_ARCH) ADK_TARGET_SYSTEM=$(ADK_TARGET_SYSTEM) ADK_TARGET_LIBC=$(ADK_TARGET_LIBC) allmodconfig
  397. $(GMAKE) VERBOSE=1 all 2>&1 | tee firmware/buildall.log
  398. $(TOPDIR)/adk/tools/pkgmaker: $(TOPDIR)/adk/tools/pkgmaker.c $(TOPDIR)/adk/tools/sortfile.c $(TOPDIR)/adk/tools/strmap.c
  399. @$(CC_FOR_BUILD) -g -o $@ adk/tools/pkgmaker.c adk/tools/sortfile.c adk/tools/strmap.c
  400. $(TOPDIR)/adk/tools/pkgrebuild: $(TOPDIR)/adk/tools/pkgrebuild.c $(TOPDIR)/adk/tools/strmap.c
  401. @$(CC_FOR_BUILD) -g -o $@ adk/tools/pkgrebuild.c adk/tools/strmap.c
  402. $(TOPDIR)/adk/tools/depmaker: $(TOPDIR)/adk/tools/depmaker.c
  403. $(CC_FOR_BUILD) -g -o $@ $(TOPDIR)/adk/tools/depmaker.c
  404. menu .menu: $(wildcard package/*/Makefile) $(wildcard target/*/systems) $(wildcard target/*/systems/*) $(TOPDIR)/adk/tools/pkgmaker $(TOPDIR)/adk/tools/pkgrebuild
  405. @echo "Generating menu structure ..."
  406. @$(BASH) $(TOPDIR)/scripts/create-menu
  407. @$(TOPDIR)/adk/tools/pkgmaker
  408. @:>.menu
  409. dep: $(TOPDIR)/adk/tools/depmaker
  410. @echo "Generating dependencies ..."
  411. @$(TOPDIR)/adk/tools/depmaker > ${TOPDIR}/package/Depends.mk
  412. .PHONY: menu dep
  413. include $(TOPDIR)/toolchain/gcc/Makefile.inc
  414. check-dejagnu:
  415. @-rm adk/tests/adk.exp adk/tests/master.exp >/dev/null 2>&1
  416. @sed -e "s#@ADK_TARGET_IP@#$(ADK_TARGET_IP)#" \
  417. -e "s#@ADK_TARGET_PORT@#$(ADK_TARGET_PORT)#" \
  418. adk/tests/adk.exp.in > adk/tests/adk.exp
  419. @sed -e "s#@TOPDIR@#$(TOPDIR)#" adk/tests/master.exp.in > \
  420. adk/tests/master.exp
  421. check-gcc: check-dejagnu
  422. env DEJAGNU=$(TOPDIR)/adk/tests/master.exp \
  423. $(MAKE) -C $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/$(PKG_NAME)-$(PKG_VERSION)-final/gcc check-gcc
  424. check-g++: check-dejagnu
  425. env DEJAGNU=$(TOPDIR)/adk/tests/master.exp \
  426. $(MAKE) -C $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/$(PKG_NAME)-$(PKG_VERSION)-final/gcc check-g++
  427. check: check-gcc check-g++