summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile34
1 files changed, 34 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..e8457a1
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,34 @@
+.NOTPARALLEL:
+
+.PHONY: openwrt/backfire
+openwrt/backfire/.repo_access:
+ mkdir -p openwrt
+ cd openwrt && svn co svn://svn.openwrt.org/openwrt/branches/backfire
+ cd $(@D) && ./scripts/feeds update
+ cd $(@D) && make package/symlinks
+ touch $@
+
+update/%: openwrt/%
+ cd $< && svn update
+ cd $< && ./scripts/feeds update
+ cd $< && make package/symlinks
+ touch $</.repo_access
+
+# format image/($repo)/openwrt-$(platform)-$(model).bin
+.SECONDEXPANSION:
+image/%: REPO=$(shell basename $(@D))
+image/%: PLATFORM=$(shell echo $(@F) | cut -f2 -d-)
+image/%: MODEL=$(shell echo $(@F) | cut -f3- -d-)
+image/%: openwrt/$$(REPO)/.repo_access config/$$(REPO).config \
+ config/$$(REPO)-$$(PLATFORM).patch config/$$(REPO)-$$(PLATFORM)-$$(MODEL).patch
+ @echo === Building $(REPO), $(PLATFORM), $(MODEL) ===
+ cp config/$(REPO).config openwrt/$(REPO)/.config
+ patch openwrt/$(REPO)/.config <config/$(REPO)-$(PLATFORM).patch
+ patch openwrt/$(REPO)/.config <config/$(REPO)-$(PLATFORM)-$(MODEL).patch
+ -rm -r openwrt/$(REPO)/files
+ cp -a files/common openwrt/$(REPO)/files
+ rsync -a files/$(PLATFORM)/ openwrt/$(REPO)/files/
+ rsync -a files/$(PLATFORM)-$(MODEL)/ openwrt/$(REPO)/files/
+ cd openwrt/$(REPO) && $(MAKE)
+ mkdir -p $@
+ rsync -a openwrt/$(REPO)/bin/$(PLATFORM)/ $@/ \ No newline at end of file
contact: Jan Huwald // Impressum