build.mk 16 KB

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