build.mk 15 KB

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