Makefile 15 KB

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