Makefile 16 KB

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