Makefile 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506
  1. all:
  2. LC_ALL:=C
  3. LANG:=C
  4. export LC_ALL LANG
  5. export SHELL:=/usr/bin/env bash
  6. GLUONPATH ?= $(PATH)
  7. export GLUONPATH := $(GLUONPATH)
  8. empty:=
  9. space:= $(empty) $(empty)
  10. GLUONMAKE_EARLY = PATH=$(GLUONPATH) $(SUBMAKE) -C $(GLUON_ORIGOPENWRTDIR) -f $(GLUONDIR)/Makefile GLUON_TOOLS=0 QUILT=
  11. GLUONMAKE = PATH=$(GLUONPATH) $(SUBMAKE) -C $(GLUON_OPENWRTDIR) -f $(GLUONDIR)/Makefile
  12. ifneq ($(OPENWRT_BUILD),1)
  13. GLUONDIR:=${CURDIR}
  14. include $(GLUONDIR)/include/gluon.mk
  15. TOPDIR:=$(GLUON_ORIGOPENWRTDIR)
  16. export TOPDIR
  17. update: FORCE
  18. $(GLUONDIR)/scripts/update.sh
  19. $(GLUONDIR)/scripts/patch.sh
  20. update-patches: FORCE
  21. $(GLUONDIR)/scripts/update.sh
  22. $(GLUONDIR)/scripts/update-patches.sh
  23. $(GLUONDIR)/scripts/patch.sh
  24. -include $(TOPDIR)/include/host.mk
  25. _SINGLE=export MAKEFLAGS=$(space);
  26. override OPENWRT_BUILD=1
  27. override GLUON_TOOLS=1
  28. GREP_OPTIONS=
  29. export OPENWRT_BUILD GLUON_TOOLS GREP_OPTIONS
  30. -include $(TOPDIR)/include/debug.mk
  31. -include $(TOPDIR)/include/depends.mk
  32. include $(GLUONDIR)/include/toplevel.mk
  33. include $(GLUONDIR)/targets/targets.mk
  34. CheckTarget := [ -n '$(GLUON_TARGET)' -a -n '$(GLUON_TARGET_$(GLUON_TARGET)_BOARD)' ] \
  35. || (echo -e 'Please set GLUON_TARGET to a valid target. Gluon supports the following targets:$(subst $(space),\n * ,$(GLUON_TARGETS))'; false)
  36. CheckExternal := test -d $(GLUON_ORIGOPENWRTDIR) || (echo 'You don'"'"'t seem to have obtained the external repositories needed by Gluon; please call `make update` first!'; false)
  37. create-key: FORCE
  38. @$(CheckExternal)
  39. +@$(GLUONMAKE_EARLY) create-key
  40. prepare-target: FORCE
  41. @$(CheckExternal)
  42. @$(CheckTarget)
  43. +@$(GLUONMAKE_EARLY) prepare-target
  44. all: prepare-target
  45. +@$(GLUONMAKE) build-key
  46. +@$(GLUONMAKE) prepare
  47. +@$(GLUONMAKE) images
  48. +@$(GLUONMAKE) modules
  49. prepare: prepare-target
  50. +@$(GLUONMAKE) build-key
  51. +@$(GLUONMAKE) $@
  52. clean download images modules: FORCE
  53. @$(CheckExternal)
  54. @$(CheckTarget)
  55. +@$(GLUONMAKE_EARLY) maybe-prepare-target
  56. +@$(GLUONMAKE) build-key
  57. +@$(GLUONMAKE) $@
  58. toolchain/% package/% target/% image/%: FORCE
  59. @$(CheckExternal)
  60. @$(CheckTarget)
  61. +@$(GLUONMAKE_EARLY) maybe-prepare-target
  62. +@$(GLUONMAKE) build-key
  63. +@$(GLUONMAKE) $@
  64. manifest: FORCE
  65. @[ -n '$(GLUON_BRANCH)' ] || (echo 'Please set GLUON_BRANCH to create a manifest.'; false)
  66. @echo '$(GLUON_PRIORITY)' | grep -qE '^([0-9]*\.)?[0-9]+$$' || (echo 'Please specify a numeric value for GLUON_PRIORITY to create a manifest.'; false)
  67. @$(CheckExternal)
  68. ( \
  69. echo 'BRANCH=$(GLUON_BRANCH)' && \
  70. echo 'DATE=$(shell $(GLUON_ORIGOPENWRTDIR)/staging_dir/host/bin/lua $(GLUONDIR)/scripts/rfc3339date.lua)' && \
  71. echo 'PRIORITY=$(GLUON_PRIORITY)' && \
  72. echo \
  73. ) > $(GLUON_BUILDDIR)/$(GLUON_BRANCH).manifest.tmp
  74. +($(foreach GLUON_TARGET,$(GLUON_TARGETS), \
  75. ( [ ! -e $(BOARD_BUILDDIR)/prepared ] || ( $(GLUONMAKE) manifest GLUON_TARGET='$(GLUON_TARGET)' V=s$(OPENWRT_VERBOSE) ) ) && \
  76. ) :)
  77. mkdir -p $(GLUON_IMAGEDIR)/sysupgrade
  78. mv $(GLUON_BUILDDIR)/$(GLUON_BRANCH).manifest.tmp $(GLUON_IMAGEDIR)/sysupgrade/$(GLUON_BRANCH).manifest
  79. dirclean : FORCE
  80. for dir in build_dir dl staging_dir tmp; do \
  81. rm -rf $(GLUON_ORIGOPENWRTDIR)/$$dir; \
  82. done
  83. rm -rf $(GLUON_BUILDDIR) $(GLUON_OUTPUTDIR)
  84. else
  85. TOPDIR=${CURDIR}
  86. export TOPDIR
  87. include rules.mk
  88. include $(GLUONDIR)/include/gluon.mk
  89. include $(INCLUDE_DIR)/host.mk
  90. include $(INCLUDE_DIR)/depends.mk
  91. include $(INCLUDE_DIR)/subdir.mk
  92. include package/Makefile
  93. include tools/Makefile
  94. include toolchain/Makefile
  95. include target/Makefile
  96. PROFILES :=
  97. PROFILE_PACKAGES :=
  98. define Profile
  99. $(eval $(call Profile/Default))
  100. $(eval $(call Profile/$(1)))
  101. endef
  102. define GluonProfile
  103. PROFILES += $(1)
  104. PROFILE_PACKAGES += $(filter-out -%,$(2) $(GLUON_$(1)_SITE_PACKAGES))
  105. GLUON_$(1)_PROFILE := $(if $(3),$(3),$(1))
  106. GLUON_$(1)_DEFAULT_PACKAGES := $(2)
  107. GLUON_$(1)_FACTORY_SUFFIX := -squashfs-factory
  108. GLUON_$(1)_SYSUPGRADE_SUFFIX := -squashfs-sysupgrade
  109. GLUON_$(1)_FACTORY_EXT := .bin
  110. GLUON_$(1)_SYSUPGRADE_EXT := .bin
  111. GLUON_$(1)_FACTORY_EXTRA :=
  112. GLUON_$(1)_SYSUPGRADE_EXTRA :=
  113. GLUON_$(1)_MODELS :=
  114. endef
  115. define GluonProfileFactorySuffix
  116. GLUON_$(1)_FACTORY_SUFFIX := $(2)
  117. GLUON_$(1)_FACTORY_EXT := $(3)
  118. GLUON_$(1)_FACTORY_EXTRA := $(4)
  119. endef
  120. define GluonProfileSysupgradeSuffix
  121. GLUON_$(1)_SYSUPGRADE_SUFFIX := $(2)
  122. GLUON_$(1)_SYSUPGRADE_EXT := $(3)
  123. GLUON_$(1)_SYSUPGRADE_EXTRA := $(4)
  124. endef
  125. define GluonModel
  126. GLUON_$(1)_MODELS += $(3)
  127. GLUON_$(1)_MODEL_$(3) := $(2)
  128. GLUON_$(1)_MODEL_$(3)_ALIASES :=
  129. endef
  130. define GluonModelAlias
  131. GLUON_$(1)_MODEL_$(2)_ALIASES += $(3)
  132. endef
  133. export SHA512SUM := $(GLUONDIR)/scripts/sha512sum.sh
  134. prereq: FORCE
  135. +$(NO_TRACE_MAKE) prereq
  136. prepare-tmpinfo: FORCE
  137. @+$(MAKE) -r -s staging_dir/host/.prereq-build OPENWRT_BUILD= QUIET=0
  138. mkdir -p tmp/info
  139. $(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="packageinfo" SCAN_DIR="package" SCAN_NAME="package" SCAN_DEPS="$(TOPDIR)/include/package*.mk $(TOPDIR)/overlay/*/*.mk" SCAN_EXTRA=""
  140. $(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="targetinfo" SCAN_DIR="target/linux" SCAN_NAME="target" SCAN_DEPS="profiles/*.mk $(TOPDIR)/include/kernel*.mk $(TOPDIR)/include/target.mk" SCAN_DEPTH=2 SCAN_EXTRA="" SCAN_MAKEOPTS="TARGET_BUILD=1"
  141. for type in package target; do \
  142. f=tmp/.$${type}info; t=tmp/.config-$${type}.in; \
  143. [ "$$t" -nt "$$f" ] || ./scripts/metadata.pl $${type}_config "$$f" > "$$t" || { rm -f "$$t"; echo "Failed to build $$t"; false; break; }; \
  144. done
  145. [ tmp/.config-feeds.in -nt tmp/.packagefeeds ] || ./scripts/feeds feed_config > tmp/.config-feeds.in
  146. ./scripts/metadata.pl package_mk tmp/.packageinfo > tmp/.packagedeps || { rm -f tmp/.packagedeps; false; }
  147. ./scripts/metadata.pl package_feeds tmp/.packageinfo > tmp/.packagefeeds || { rm -f tmp/.packagefeeds; false; }
  148. touch $(TOPDIR)/tmp/.build
  149. feeds: FORCE
  150. rm -rf $(TOPDIR)/package/feeds
  151. mkdir $(TOPDIR)/package/feeds
  152. [ ! -f $(GLUON_SITEDIR)/modules ] || . $(GLUON_SITEDIR)/modules && for feed in $$GLUON_SITE_FEEDS; do ln -s ../../../packages/$$feed $(TOPDIR)/package/feeds/$$feed; done
  153. ln -s ../../../package $(TOPDIR)/package/feeds/gluon
  154. . $(GLUONDIR)/modules && for feed in $$GLUON_FEEDS; do ln -s ../../../packages/$$feed $(TOPDIR)/package/feeds/module_$$feed; done
  155. +$(GLUONMAKE_EARLY) prepare-tmpinfo
  156. gluon-tools: FORCE
  157. +$(GLUONMAKE_EARLY) tools/patch/install
  158. +$(GLUONMAKE_EARLY) tools/sed/install
  159. +$(GLUONMAKE_EARLY) tools/cmake/install
  160. +$(GLUONMAKE_EARLY) package/lua/host/install package/usign/host/install
  161. early_prepared_stamp := $(GLUON_BUILDDIR)/prepared_$(shell \
  162. ( \
  163. $(SHA512SUM) $(GLUONDIR)/modules; \
  164. [ ! -r $(GLUON_SITEDIR)/modules ] || $(SHA512SUM) $(GLUON_SITEDIR)/modules \
  165. ) | $(SHA512SUM) )
  166. prepare-early: FORCE
  167. for dir in build_dir dl staging_dir; do \
  168. mkdir -p $(GLUON_ORIGOPENWRTDIR)/$$dir; \
  169. done
  170. +$(GLUONMAKE_EARLY) feeds
  171. +$(GLUONMAKE_EARLY) gluon-tools
  172. mkdir -p $$(dirname $(early_prepared_stamp))
  173. touch $(early_prepared_stamp)
  174. $(early_prepared_stamp):
  175. rm -f $(GLUON_BUILDDIR)/prepared_*
  176. +$(GLUONMAKE_EARLY) prepare-early
  177. $(GLUON_OPKG_KEY): $(early_prepared_stamp) FORCE
  178. [ -s $(GLUON_OPKG_KEY) -a -s $(GLUON_OPKG_KEY).pub ] || \
  179. ( mkdir -p $$(dirname $(GLUON_OPKG_KEY)) && $(STAGING_DIR_HOST)/bin/usign -G -s $(GLUON_OPKG_KEY) -p $(GLUON_OPKG_KEY).pub -c "Gluon opkg key" )
  180. $(GLUON_OPKG_KEY).pub: $(GLUON_OPKG_KEY)
  181. create-key: $(GLUON_OPKG_KEY).pub
  182. include $(GLUONDIR)/targets/targets.mk
  183. ifneq ($(GLUON_TARGET),)
  184. include $(GLUONDIR)/targets/$(GLUON_TARGET)/profiles.mk
  185. BOARD := $(GLUON_TARGET_$(GLUON_TARGET)_BOARD)
  186. override SUBTARGET := $(GLUON_TARGET_$(GLUON_TARGET)_SUBTARGET)
  187. target_prepared_stamp := $(BOARD_BUILDDIR)/target-prepared
  188. gluon_prepared_stamp := $(BOARD_BUILDDIR)/prepared
  189. PREPARED_RELEASE = $$(cat $(gluon_prepared_stamp))
  190. IMAGE_PREFIX = gluon-$(GLUON_SITE_CODE)-$(PREPARED_RELEASE)
  191. MODULE_PREFIX = gluon-$(GLUON_SITE_CODE)-$(PREPARED_RELEASE)
  192. include $(INCLUDE_DIR)/target.mk
  193. build-key: FORCE
  194. rm -f $(BUILD_KEY) $(BUILD_KEY).pub
  195. cp $(GLUON_OPKG_KEY) $(BUILD_KEY)
  196. cp $(GLUON_OPKG_KEY).pub $(BUILD_KEY).pub
  197. config: FORCE
  198. +$(NO_TRACE_MAKE) scripts/config/conf OPENWRT_BUILD= QUIET=0
  199. +$(GLUONMAKE) prepare-tmpinfo
  200. ( \
  201. cat $(GLUONDIR)/include/config; \
  202. echo 'CONFIG_TARGET_$(GLUON_TARGET_$(GLUON_TARGET)_BOARD)=y'; \
  203. $(if $(GLUON_TARGET_$(GLUON_TARGET)_SUBTARGET), \
  204. echo 'CONFIG_TARGET_$(GLUON_TARGET_$(GLUON_TARGET)_BOARD)_$(GLUON_TARGET_$(GLUON_TARGET)_SUBTARGET)=y'; \
  205. ) \
  206. cat $(GLUONDIR)/targets/$(GLUON_TARGET)/config 2>/dev/null; \
  207. echo 'CONFIG_BUILD_SUFFIX="gluon-$(GLUON_TARGET)"'; \
  208. echo '$(patsubst %,CONFIG_PACKAGE_%=m,$(sort $(filter-out -%,$(DEFAULT_PACKAGES) $(GLUON_DEFAULT_PACKAGES) $(GLUON_SITE_PACKAGES) $(PROFILE_PACKAGES))))' \
  209. | sed -e 's/ /\n/g'; \
  210. echo '$(patsubst %,CONFIG_LUCI_LANG_%=y,$(GLUON_LANGS))' \
  211. | sed -e 's/ /\n/g'; \
  212. ) > $(BOARD_BUILDDIR)/config.tmp
  213. scripts/config/conf --defconfig=$(BOARD_BUILDDIR)/config.tmp Config.in
  214. +$(SUBMAKE) tools/install
  215. prepare-target: $(GLUON_OPKG_KEY).pub
  216. rm $(GLUON_OPENWRTDIR)/tmp || true
  217. mkdir -p $(GLUON_OPENWRTDIR)/tmp
  218. for link in build_dir config Config.in dl include Makefile package rules.mk scripts staging_dir target toolchain tools; do \
  219. ln -sf $(GLUON_ORIGOPENWRTDIR)/$$link $(GLUON_OPENWRTDIR); \
  220. done
  221. +$(GLUONMAKE) config
  222. touch $(target_prepared_stamp)
  223. $(target_prepared_stamp):
  224. +$(GLUONMAKE_EARLY) prepare-target
  225. maybe-prepare-target: $(target_prepared_stamp)
  226. +$(GLUONMAKE_EARLY) $(GLUON_OPKG_KEY).pub
  227. $(BUILD_DIR)/.prepared: Makefile
  228. @mkdir -p $$(dirname $@)
  229. @touch $@
  230. $(toolchain/stamp-install): $(tools/stamp-install)
  231. $(package/stamp-compile): $(package/stamp-cleanup)
  232. clean: FORCE
  233. +$(SUBMAKE) clean
  234. rm -f $(gluon_prepared_stamp)
  235. download: FORCE
  236. +$(SUBMAKE) tools/download
  237. +$(SUBMAKE) toolchain/download
  238. +$(SUBMAKE) package/download
  239. +$(SUBMAKE) target/download
  240. toolchain: $(toolchain/stamp-install) $(tools/stamp-install)
  241. include $(INCLUDE_DIR)/kernel.mk
  242. kernel: FORCE
  243. +$(NO_TRACE_MAKE) -C $(TOPDIR)/target/linux/$(BOARD) $(LINUX_DIR)/.image TARGET_BUILD=1
  244. +$(NO_TRACE_MAKE) -C $(TOPDIR)/target/linux/$(BOARD) $(LINUX_DIR)/.modules TARGET_BUILD=1
  245. packages: $(package/stamp-compile)
  246. $(_SINGLE)$(SUBMAKE) -r package/index
  247. prepare-image: FORCE
  248. rm -rf $(BOARD_KDIR)
  249. mkdir -p $(BOARD_KDIR)
  250. -cp $(KERNEL_BUILD_DIR)/* $(BOARD_KDIR)/
  251. +$(SUBMAKE) -C $(TOPDIR)/target/linux/$(BOARD)/image image_prepare KDIR="$(BOARD_KDIR)"
  252. prepare: FORCE
  253. @$(STAGING_DIR_HOST)/bin/lua $(GLUONDIR)/scripts/site_config.lua \
  254. || (echo 'Your site configuration did not pass validation.'; false)
  255. mkdir -p $(GLUON_IMAGEDIR) $(BOARD_BUILDDIR)
  256. echo 'src packages file:../openwrt/bin/$(BOARD)/packages' > $(BOARD_BUILDDIR)/opkg.conf
  257. +$(GLUONMAKE) toolchain
  258. +$(GLUONMAKE) kernel
  259. +$(GLUONMAKE) packages
  260. +$(GLUONMAKE) prepare-image
  261. echo "$(GLUON_RELEASE)" > $(gluon_prepared_stamp)
  262. $(gluon_prepared_stamp):
  263. +$(GLUONMAKE) prepare
  264. modules: FORCE $(gluon_prepared_stamp)
  265. -rm -f $(GLUON_MODULEDIR)/*/$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic)/*
  266. -rmdir -p $(GLUON_MODULEDIR)/*/$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic)
  267. mkdir -p $(GLUON_MODULEDIR)/$(MODULE_PREFIX)/$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic)
  268. cp $(PACKAGE_DIR)/kmod-*.ipk $(GLUON_MODULEDIR)/$(MODULE_PREFIX)/$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic)
  269. $(_SINGLE)$(SUBMAKE) -r package/index PACKAGE_DIR=$(GLUON_MODULEDIR)/$(MODULE_PREFIX)/$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic)
  270. include $(INCLUDE_DIR)/package-ipkg.mk
  271. # override variables from rules.mk
  272. PACKAGE_DIR = $(GLUON_OPENWRTDIR)/bin/$(BOARD)/packages
  273. PROFILE_BUILDDIR = $(BOARD_BUILDDIR)/profiles/$(PROFILE)
  274. PROFILE_KDIR = $(PROFILE_BUILDDIR)/kernel
  275. BIN_DIR = $(PROFILE_BUILDDIR)/images
  276. TARGET_DIR = $(PROFILE_BUILDDIR)/root
  277. OPKG:= \
  278. TMPDIR="$(TMP_DIR)" \
  279. IPKG_INSTROOT="$(TARGET_DIR)" \
  280. IPKG_CONF_DIR="$(TMP_DIR)" \
  281. IPKG_OFFLINE_ROOT="$(TARGET_DIR)" \
  282. $(STAGING_DIR_HOST)/bin/opkg \
  283. -f $(BOARD_BUILDDIR)/opkg.conf \
  284. --cache $(TMP_DIR)/dl \
  285. --offline-root $(TARGET_DIR) \
  286. --force-postinstall \
  287. --add-dest root:/ \
  288. --add-arch all:100 \
  289. --add-arch $(ARCH_PACKAGES):200
  290. EnableInitscript = ! grep -q '\#!/bin/sh /etc/rc.common' $(1) || bash ./etc/rc.common $(1) enable
  291. enable_initscripts: FORCE
  292. cd $(TARGET_DIR) && ( export IPKG_INSTROOT=$(TARGET_DIR); \
  293. $(foreach script,$(wildcard $(TARGET_DIR)/etc/init.d/*), \
  294. $(call EnableInitscript,$(script)); \
  295. ) : \
  296. )
  297. # Generate package list
  298. $(eval $(call merge-lists,INSTALL_PACKAGES,DEFAULT_PACKAGES GLUON_DEFAULT_PACKAGES GLUON_SITE_PACKAGES GLUON_$(PROFILE)_DEFAULT_PACKAGES GLUON_$(PROFILE)_SITE_PACKAGES))
  299. package_install: FORCE
  300. $(OPKG) update
  301. $(OPKG) install $(PACKAGE_DIR)/base-files_*.ipk $(PACKAGE_DIR)/libc_*.ipk
  302. $(OPKG) install $(PACKAGE_DIR)/kernel_*.ipk
  303. $(OPKG) install $(INSTALL_PACKAGES)
  304. +$(GLUONMAKE) enable_initscripts
  305. rm -f $(TARGET_DIR)/usr/lib/opkg/lists/* $(TARGET_DIR)/tmp/opkg.lock
  306. rm -f $(TARGET_DIR)/usr/lib/opkg/info/*.postinst*
  307. # Remove opkg database when opkg is not intalled
  308. if [ ! -x $(TARGET_DIR)/bin/opkg ]; then rm -rf $(TARGET_DIR)/usr/lib/opkg; fi
  309. include $(INCLUDE_DIR)/version.mk
  310. opkg_config: FORCE
  311. for d in base packages luci routing telephony management; do \
  312. echo "src/gz %n_$$d %U/$$d"; \
  313. done > $(TARGET_DIR)/etc/opkg/distfeeds.conf
  314. $(VERSION_SED) $(TARGET_DIR)/etc/opkg/distfeeds.conf
  315. image: FORCE
  316. rm -rf $(TARGET_DIR) $(BIN_DIR) $(PROFILE_KDIR)
  317. mkdir -p $(TARGET_DIR) $(BIN_DIR) $(TARGET_DIR)/tmp $(GLUON_IMAGEDIR)/factory $(GLUON_IMAGEDIR)/sysupgrade
  318. cp -r $(BOARD_KDIR) $(PROFILE_KDIR)
  319. +$(GLUONMAKE) package_install
  320. +$(GLUONMAKE) opkg_config
  321. $(call Image/mkfs/prepare)
  322. $(_SINGLE)$(NO_TRACE_MAKE) -C $(TOPDIR)/target/linux/$(BOARD)/image install TARGET_BUILD=1 IMG_PREFIX=gluon \
  323. PROFILE="$(GLUON_$(PROFILE)_PROFILE)" KDIR="$(PROFILE_KDIR)" TARGET_DIR="$(TARGET_DIR)" BIN_DIR="$(BIN_DIR)" TMP_DIR="$(TMP_DIR)"
  324. $(foreach model,$(GLUON_$(PROFILE)_MODELS), \
  325. $(if $(GLUON_$(PROFILE)_SYSUPGRADE_EXT), \
  326. rm -f $(GLUON_IMAGEDIR)/sysupgrade/gluon-*-$(model)-sysupgrade$(GLUON_$(PROFILE)_SYSUPGRADE_EXT) && \
  327. cp $(BIN_DIR)/gluon-$(GLUON_$(PROFILE)_MODEL_$(model))$(GLUON_$(PROFILE)_SYSUPGRADE_SUFFIX)$(GLUON_$(PROFILE)_SYSUPGRADE_EXT) $(GLUON_IMAGEDIR)/sysupgrade/$(IMAGE_PREFIX)-$(model)-sysupgrade$(GLUON_$(PROFILE)_SYSUPGRADE_EXT) && \
  328. ) \
  329. $(if $(GLUON_$(PROFILE)_FACTORY_EXT), \
  330. rm -f $(GLUON_IMAGEDIR)/factory/gluon-*-$(model)$(GLUON_$(PROFILE)_FACTORY_EXT) && \
  331. cp $(BIN_DIR)/gluon-$(GLUON_$(PROFILE)_MODEL_$(model))$(GLUON_$(PROFILE)_FACTORY_SUFFIX)$(GLUON_$(PROFILE)_FACTORY_EXT) $(GLUON_IMAGEDIR)/factory/$(IMAGE_PREFIX)-$(model)$(GLUON_$(PROFILE)_FACTORY_EXT) && \
  332. ) \
  333. \
  334. $(if $(GLUON_$(PROFILE)_SYSUPGRADE_EXTRA), \
  335. rm -f $(GLUON_IMAGEDIR)/sysupgrade/gluon-*-$(model)-sysupgrade$(GLUON_$(PROFILE)_SYSUPGRADE_EXTRA) && \
  336. cp $(BIN_DIR)/gluon$(GLUON_$(PROFILE)_SYSUPGRADE_EXTRA) $(GLUON_IMAGEDIR)/sysupgrade/$(IMAGE_PREFIX)-$(model)-sysupgrade$(GLUON_$(PROFILE)_SYSUPGRADE_EXTRA) && \
  337. ) \
  338. $(if $(GLUON_$(PROFILE)_FACTORY_EXTRA), \
  339. rm -f $(GLUON_IMAGEDIR)/factory/gluon-*-$(model)$(GLUON_$(PROFILE)_FACTORY_EXTRA) && \
  340. cp $(BIN_DIR)/gluon$(GLUON_$(PROFILE)_FACTORY_EXTRA) $(GLUON_IMAGEDIR)/factory/$(IMAGE_PREFIX)-$(model)$(GLUON_$(PROFILE)_FACTORY_EXTRA) && \
  341. ) \
  342. \
  343. $(foreach alias,$(GLUON_$(PROFILE)_MODEL_$(model)_ALIASES), \
  344. $(if $(GLUON_$(PROFILE)_SYSUPGRADE_EXT), \
  345. rm -f $(GLUON_IMAGEDIR)/sysupgrade/gluon-*-$(alias)-sysupgrade$(GLUON_$(PROFILE)_SYSUPGRADE_EXT) && \
  346. ln -s $(IMAGE_PREFIX)-$(model)-sysupgrade$(GLUON_$(PROFILE)_SYSUPGRADE_EXT) $(GLUON_IMAGEDIR)/sysupgrade/$(IMAGE_PREFIX)-$(alias)-sysupgrade$(GLUON_$(PROFILE)_SYSUPGRADE_EXT) && \
  347. ) \
  348. $(if $(GLUON_$(PROFILE)_FACTORY_EXT), \
  349. rm -f $(GLUON_IMAGEDIR)/factory/gluon-*-$(alias)$(GLUON_$(PROFILE)_FACTORY_EXT) && \
  350. ln -s $(IMAGE_PREFIX)-$(model)$(GLUON_$(PROFILE)_FACTORY_EXT) $(GLUON_IMAGEDIR)/factory/$(IMAGE_PREFIX)-$(alias)$(GLUON_$(PROFILE)_FACTORY_EXT) && \
  351. ) \
  352. ) \
  353. ) :
  354. image/%: $(gluon_prepared_stamp)
  355. +$(GLUONMAKE) image PROFILE="$(patsubst image/%,%,$@)" V=s$(OPENWRT_VERBOSE)
  356. call_image/%: FORCE
  357. +$(GLUONMAKE) $(patsubst call_image/%,image/%,$@)
  358. images: $(patsubst %,call_image/%,$(PROFILES)) ;
  359. manifest: FORCE
  360. ( \
  361. cd $(GLUON_IMAGEDIR)/sysupgrade; \
  362. $(foreach profile,$(PROFILES), \
  363. $(if $(GLUON_$(profile)_SYSUPGRADE_EXT), \
  364. $(foreach model,$(GLUON_$(profile)_MODELS), \
  365. file="$(IMAGE_PREFIX)-$(model)-sysupgrade$(GLUON_$(profile)_SYSUPGRADE_EXT)"; \
  366. [ -e "$$file" ] && echo '$(model)' "$(PREPARED_RELEASE)" "$$($(SHA512SUM) "$$file")" "$$file"; \
  367. \
  368. $(foreach alias,$(GLUON_$(profile)_MODEL_$(model)_ALIASES), \
  369. file="$(IMAGE_PREFIX)-$(alias)-sysupgrade$(GLUON_$(profile)_SYSUPGRADE_EXT)"; \
  370. [ -e "$$file" ] && echo '$(alias)' "$(PREPARED_RELEASE)" "$$($(SHA512SUM) "$$file")" "$$file"; \
  371. ) \
  372. ) \
  373. ) \
  374. ) : \
  375. ) >> $(GLUON_BUILDDIR)/$(GLUON_BRANCH).manifest.tmp
  376. .PHONY: all create-key prepare images modules clean gluon-tools manifest
  377. endif
  378. endif