Makefile 16 KB

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