Skip to content

Instantly share code, notes, and snippets.

@tonejito
Last active September 10, 2018 16:12
Show Gist options
  • Save tonejito/7f2c25519bae996e91cb61c26dd599e2 to your computer and use it in GitHub Desktop.
Save tonejito/7f2c25519bae996e91cb61c26dd599e2 to your computer and use it in GitHub Desktop.
Makefile for OpenWRT configuration and build
# https://openwrt.org/docs/guide-developer/quickstart-build-images
SHELL=/bin/bash
DATE=$(shell date '+%s')
SRC_REPO=https://git.openwrt.org/openwrt/openwrt.git
SRC_DIR=openwrt
DEPS=\
subversion g++ zlib1g-dev build-essential git python rsync man-db \
libncurses5-dev gawk gettext unzip file libssl-dev wget zip time
all: code feeds menuconfig build
build:
time script --flush --return --command '$(MAKE) -j1 V=sc -C ${SRC_DIR}' make-${DATE}.log
deps:
sudo apt install ${DEPS}
code:
test -d ${SRC_DIR} || git clone ${SRC_REPO} ${SRC_DIR}
feeds:
time $(MAKE) -f ../Makefile -C ${SRC_DIR} do_$@
do_feeds:
./scripts/feeds update -a
./scripts/feeds install -a
menuconfig:
$(MAKE) -C ${SRC_DIR} menuconfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment