source: debwrt/trunk/rules/debwrt.mk @ 44

Last change on this file since 44 was 44, checked in by amain, 9 years ago

Fix libnl ( now really cross-compile )
Add package iw

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