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 | |
---|
18 | RELEASE:=testing |
---|
19 | BUILD_CYCLE_ID:=-1 |
---|
20 | VERSION:=2.1$(BUILD_CYCLE_ID) |
---|
21 | RELEASE_DATE=$(shell LC_ALL=c date +"%d %B %Y") |
---|
22 | SVN_REVISION:=$(shell $(SCRIPT_GET_SVN_REVISION)) |
---|
23 | DEBWRTVERSION:=$(RELEASE) - $(VERSION) - [ $(RELEASE_DATE) ($(SVN_REVISION)) ] |
---|
24 | DEBWRT_VERSION:=$(RELEASE)-$(VERSION) |
---|
25 | |
---|
26 | empty:= |
---|
27 | space:= $(empty) $(empty) |
---|
28 | |
---|
29 | # Include DebWrt config |
---|
30 | -include $(TOPDIR)/.config |
---|
31 | |
---|
32 | # Target arch |
---|
33 | TARGET_ARCH:=$(call qstrip,$(CONFIG_ARCH)) |
---|
34 | |
---|
35 | # Board [example: ar7xx] |
---|
36 | BOARD:=$(call qstrip,$(CONFIG_TARGET_BOARD)) |
---|
37 | |
---|
38 | # Sub board [example: ubnt-rspro] |
---|
39 | SUB_BOARD:=$(shell $(SCRIPT_GET_BOARD) $(TOPDIR)/.config $(BOARD)) |
---|
40 | |
---|
41 | # Linux version [2.6.X(.X)] |
---|
42 | LINUX_VERSION:=$(call qstrip,$(CONFIG_DEBWRT_KERNEL_VERSION)) |
---|
43 | |
---|
44 | # OpenWrt Revision to checkout [rXXXX] |
---|
45 | OPENWRT_REVISION:=$(call qstrip,$(CONFIG_OPENWRT_REVISION)) |
---|
46 | |
---|
47 | # OpenWrt Revision is trunk [y or emtpy] |
---|
48 | IS_OPENWRT_TRUNK:=$(call qstrip,$(CONFIG_OPENWRT_REVISION_TRUNK)) |
---|
49 | |
---|
50 | # OpenWrt Revision is branch [y or empty] |
---|
51 | IS_OPENWRT_BACKFIRE:=$(call qstrip,$(CONFIG_OPENWRT_REVISION_BACKFIRE)) |
---|
52 | |
---|
53 | # Base BuildDir |
---|
54 | BUILD_DIR_BASE:=$(TOPDIR)/build |
---|
55 | |
---|
56 | # Config dir |
---|
57 | CONFIG_DIR:=$(TOPDIR)/config |
---|
58 | |
---|
59 | # Plugins dir |
---|
60 | PLUGINS_DIR:=$(TOPDIR)/plugins |
---|
61 | |
---|
62 | # bin/delivery dir |
---|
63 | BIN_DIR:=$(TOPDIR)/bin |
---|
64 | |
---|
65 | # tmp dir |
---|
66 | TMP_DIR:=$(TOPDIR)/tmp |
---|
67 | |
---|
68 | # Install dir |
---|
69 | INSTALL_DIR:=$(BIN_DIR)/$(BOARD)-$(DEBWRT_VERSION)-$(LINUX_VERSION) |
---|
70 | |
---|
71 | # Install dir for OpenWrt binaries |
---|
72 | INSTALL_DIR_OPENWRT:=$(INSTALL_DIR)/openwrt |
---|
73 | |
---|
74 | # Install dir OpenWrt kernel modules |
---|
75 | INSTALL_DIR_OPENWRT_MODULES:=$(INSTALL_DIR_OPENWRT)/modules |
---|
76 | |
---|
77 | # Install dir OpenWrt packages |
---|
78 | INSTALL_DIR_OPENWRT_PACKAGES:=$(INSTALL_DIR_OPENWRT)/packages |
---|
79 | |
---|
80 | # Install dic OpenWrt kernel headers |
---|
81 | INSTALL_DIR_OPENWRT_HEADERS:=$(INSTALL_DIR_OPENWRT)/headers |
---|
82 | |
---|
83 | # Image file containing OpenWrt kernel modules |
---|
84 | MODULES_TAR_GZ=debwrt-modules-${BOARD}-${SUB_BOARD}-${OPENWRT_LINUX_UNAME_VERSION}-$(DEBWRT_VERSION).tar.gz |
---|
85 | |
---|
86 | # Image file containing OpenWrt kernel headers |
---|
87 | HEADERS_TAR_GZ=debwrt-headers-${BOARD}-${SUB_BOARD}-${OPENWRT_LINUX_UNAME_VERSION}-$(DEBWRT_VERSION).tar.gz |
---|
88 | |
---|
89 | # Filename of DebWrt firmware image |
---|
90 | TARGET_IMAGE_NAME_BIN=debwrt-firmware-${BOARD}-${SUB_BOARD}-${OPENWRT_LINUX_UNAME_VERSION}-$(DEBWRT_VERSION).bin |
---|
91 | TARGET_IMAGE_NAME_TRX=debwrt-firmware-${BOARD}-${SUB_BOARD}-${OPENWRT_LINUX_UNAME_VERSION}-$(DEBWRT_VERSION).trx |
---|
92 | |
---|
93 | # OpenWrt patches directory |
---|
94 | PATCHES_DIR_OPENWRT=$(TOPDIR)/openwrt/patches |
---|
95 | |
---|
96 | # OpenWrt files directory |
---|
97 | FILES_DIR_OPENWRT=$(TOPDIR)/openwrt/files |
---|
98 | |
---|
99 | # OpenWrt Build (checkout) directory |
---|
100 | OPENWRT_BUILD_DIR:=$(BUILD_DIR_BASE)/openwrt-$(BOARD)-$(SUB_BOARD)-$(OPENWRT_REVISION)-$(LINUX_VERSION) |
---|
101 | |
---|
102 | # Special saved environment variables during OpenWrt's build process |
---|
103 | OPENWRT_SAVE_CONFIG_FILE:=$(OPENWRT_BUILD_DIR)/.openwrt_env |
---|
104 | |
---|
105 | # Alternate OpenWrt download directory |
---|
106 | OPENWRT_DOWNLOAD_DIR:=$(call qstrip,$(CONFIG_OPENWRT_DOWNLOAD_DIR)) |
---|
107 | |
---|
108 | # Debian build environment version |
---|
109 | DEBIAN_BUILD_VERSION:=$(call qstrip,$(CONFIG_DEBWRT_DEBIAN_RELEASE)) |
---|
110 | |
---|
111 | # Debian |
---|
112 | DEBIAN_BUILD_DIR:=$(BUILD_DIR_BASE)/debian-$(BOARD)-$(SUB_BOARD)-$(DEBIAN_BUILD_VERSION) |
---|
113 | |
---|
114 | # Debian packages dir |
---|
115 | DEBIAN_PACKAGES_DIR:=$(TOPDIR)/debian/package |
---|
116 | INSTALL_DIR_DEBIAN_PACKAGES:=$(INSTALL_DIR)/debian |
---|
117 | |
---|
118 | # Debian rootfs |
---|
119 | ROOTFS_BUILD_DIR:=$(BUILD_DIR_BASE)/rootfs-$(TARGET_ARCH)-$(DEBWRT_VERSION) |
---|
120 | |
---|
121 | # Export defaults to other Makefiles |
---|
122 | export |
---|
123 | |
---|
124 | $(TMP_DIR) $(BIN_DIR) $(OPENWRT_BUILD_DIR) $(BUILD_DIR_BASE) $(INSTALL_DIR_BASE) $(INSTALL_DIR_OPENWRT) $(INSTALL_DIR_DEBIAN): |
---|
125 | mkdir -p $@ |
---|
126 | |
---|