source: debwrt/trunk/openwrt/openwrt.mk @ 2

Last change on this file since 2 was 2, checked in by amain, 13 years ago

Add OpenWrt checkout, patch and menuconfig.
Add general support for shell scripts and make functions
Set DebWrt RELEASE and REVISION

File size: 2.1 KB
Line 
1# DebWrt - Debian on Embedded devices
2#
3# Copyright (C) 2010 Johan van Zoomeren <amain@debwrt.net>
4#
5# This program is free software: you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation, either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
18OPENWRT_PATCHES_DIR=$(TOPDIR)/openwrt/patches
19
20openwrt/all: openwrt/deliver
21openwrt/deliver: openwrt/build
22openwrt/build: openwrt/prepare
23openwrt/prepare: openwrt/checkout openwrt/patch openwrt/merge-config openwrt/link-download
24openwrt/merge-config: openwrt/checkout openwrt/patch
25
26openwrt/link-download: openwrt/checkout
27        cd $(OPENWRT_BUILD_DIR) && if [ -d $(OPENWRT_DOWNLOAD_DIR) -a ! -e dl ]; then ln -snf $(OPENWRT_DOWNLOAD_DIR) dl; fi
28
29openwrt/patch: openwrt/checkout
30        patch -d $(OPENWRT_BUILD_DIR) -p 0 -N < $(OPENWRT_PATCHES_DIR)/001_disable_all_openwrt_packages
31        patch -d $(OPENWRT_BUILD_DIR) -p 0 -N < $(OPENWRT_PATCHES_DIR)/002_install_kernel_modules_and_merge_debwrt_config
32        #patch -d $(OPENWRT_BUILD_DIR) -p 0 -N < $(OPENWRT_PATCHES_DIR)/003_set_kernel_version
33        patch -d $(OPENWRT_BUILD_DIR) -p 0 -N < $(OPENWRT_PATCHES_DIR)/004_save_environment_variables
34        touch $@
35
36openwrt/checkout:
37        rm -rf $(OPENWRT_BUILD_DIR)
38        mkdir -p $(OPENWRT_BUILD_DIR)
39ifeq ($(IS_OPENWRT_TRUNK),y)
40        cd $(OPENWRT_BUILD_DIR) && svn co svn://svn.openwrt.org/openwrt/trunk/ .
41else
42        cd $(OPENWRT_BUILD_DIR) && svn co -r $(OPENWRT_REVISION) svn://svn.openwrt.org/openwrt/trunk/ .
43endif
44        touch $@
45
46openwrt/menuconfig: openwrt/prepare
47        $(SCRIPT_CLEAN_EXEC) $(MAKE) -C $(OPENWRT_BUILD_DIR) menuconfig
48
49openwrt/clean:
50        rm -rf $(OPENWRT_BUILD_DIR)
51        rm -f openwrt/checkout
52        rm -f openwrt/patch
53
Note: See TracBrowser for help on using the repository browser.