build.mk 16 KB

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