Skip to content

Commit

Permalink
Makefile: drop the "glue-code" for creating the modules-file
Browse files Browse the repository at this point in the history
When using the modules-file in place of config.mk and feeds.conf to
define the upstream-repos, there is no need to keep the code which
will synthesize it. This primarily reverts 7a72a84.
  • Loading branch information
SvenRoederer committed Apr 13, 2020
1 parent c83a1f8 commit 3443833
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 57 deletions.
49 changes: 1 addition & 48 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,18 @@ $(error config for $(TARGET) not defined)
endif

# if any of the following files have been changed: clean up openwrt dir
DEPS=$(TARGET_CONFIG) feeds.conf patches $(wildcard patches/*)
DEPS=$(TARGET_CONFIG) modules patches $(wildcard patches/*)

# profiles to be built (router models)
PROFILES=$(shell cat $(FW_DIR)/profiles/$(MAINTARGET)-$(SUBTARGET).profiles)

FW_REVISION=$(shell $(REVISION))

define FEEDS
$(shell ./scripts/ffberlin_feeds.sh)
endef

default: firmwares

## Gluon - Begin
# compatibility to Gluon.buildsystem
# * setup required makros and variables
# * create the modules-file from config.mk and feeds.conf

# check for spaces & resolve possibly relative paths
define mkabspath
Expand All @@ -68,47 +63,6 @@ $(eval $(call mkabspath,GLUON_PATCHESDIR))

export GLUON_TMPDIR GLUON_PATCHESDIR

# use .stamp-gluon-module-openwrt and .stamp-gluon-module- of each feed to create modules-file
$(FW_DIR)/modules: $(addprefix .stamp-gluon-module-,$(FEEDS)) .stamp-gluon-module-openwrt
rm -f $@
cat >>$@ .stamp-gluon-module-openwrt
cat >>$@ $(addprefix .stamp-gluon-module-,$(FEEDS))
echo >>$@ GLUON_FEEDS=\'$(FEEDS)\'

.stamp-gluon-module-openwrt: $(FW_DIR)/config.mk
rm -f $@
echo >>$@ "OPENWRT_REPO=$(OPENWRT_SRC)"
echo >>$@ "OPENWRT_COMMIT=$(OPENWRT_COMMIT)"
# set the $FEED-Branch
git clone $$(grep _REPO $@ | cut -d "=" -f 2) $(GLUON_TMPDIR)/gluon_$@
cd $(GLUON_TMPDIR)/gluon_$@; git name-rev --refs openwrt-* $$(grep _COMMIT $(FW_DIR)/$@ | \
cut -d "=" -f 2) | cut -d / -f 2 | cut -d \~ -f 1 >branchname.txt
cd $(GLUON_TMPDIR)/gluon_$@; grep -q master branchname.txt || \
printf >>$(FW_DIR)/$@ "OPENWRT_BRANCH=%s\n" \
$$(echo $* | tr '[:lower:]' '[:upper:]') \
$$(cat branchname.txt)
rm -rf $(GLUON_TMPDIR)/gluon_$@

.stamp-gluon-module-%: $(FW_DIR)/feeds.conf
rm -f $@
# set the $FEED-REPO
@echo -n "PACKAGES_$*_REPO=" | tr '[:lower:]' '[:upper:]' >>$@
@grep -E "^src-(git|svn)[[:space:]]$*[[:space:]].*" $(FW_DIR)/feeds.conf | \
awk -F '([[:space:]|^])' '{ print $$3 }' >>$@
# set the $FEED-COMMIT
@echo -n "PACKAGES_$*_COMMIT=" | tr '[:lower:]' '[:upper:]' >>$@
@grep -E "^src-(git|svn)[[:space:]]$*[[:space:]].*" $(FW_DIR)/feeds.conf | \
awk -F '([[:space:]|^])' '{ print $$4 }' >>$@
# set the $FEED-Branch
git clone $$(grep _REPO $@ | cut -d "=" -f 2) $(GLUON_TMPDIR)/gluon_$@
cd $(GLUON_TMPDIR)/gluon_$@; git name-rev $$(grep _COMMIT $(FW_DIR)/$@ | \
cut -d "=" -f 2) | cut -d / -f 3 | cut -d \~ -f 1 >branchname.txt
cd $(GLUON_TMPDIR)/gluon_$@; grep -q master branchname.txt || \
printf >>$(FW_DIR)/$@ "PACKAGES_%s_BRANCH=%s\n" \
$$(echo $* | tr '[:lower:]' '[:upper:]') \
$$(cat branchname.txt)
rm -rf $(GLUON_TMPDIR)/gluon_$@

## Gluon - End

# clean up openwrt working copy
Expand Down Expand Up @@ -287,7 +241,6 @@ stamp-clean-%:

stamp-clean:
rm -f .stamp-*
rm -f $(FW_DIR)/modules
rm -rf $(GLUON_TMPDIR)

clean: stamp-clean .stamp-openwrt-cleaned
Expand Down
9 changes: 0 additions & 9 deletions scripts/ffberlin_feeds.sh

This file was deleted.

0 comments on commit 3443833

Please sign in to comment.