build.mk 15 KB

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