build.mk 15 KB

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