build.mk 16 KB

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