source: trunk/rules/debwrt.mk @ 847

Last change on this file since 847 was 724, checked in by amain, 4 years ago

Simplyfy patch / release management. Restructure make menuconfig. Add auto upload for buildbot builds. Latest OpenWrt trunk fixes.

File size: 5.0 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:=trunk
19BUILD_CYCLE_ID:=
20VERSION:=$(BUILD_CYCLE_ID)
21RELEASE_DATE=$(shell LC_ALL=c date +"%d %B %Y")
22SVN_REVISION:=$(call get_svn_revision)
23ifeq ($(VERSION),)
24    DEBWRT_VERSION:=$(RELEASE)
25    DEBWRTVERSION:=$(RELEASE) - [ $(RELEASE_DATE) ($(SVN_REVISION)) ]
26else
27    DEBWRT_VERSION:=$(RELEASE)-$(VERSION)
28    DEBWRTVERSION:=$(RELEASE) - $(VERSION) - [ $(RELEASE_DATE) ($(SVN_REVISION)) ]
29endif
30
31empty:=
32space:= $(empty) $(empty)
33
34# Include DebWrt config
35-include $(TOPDIR)/.config
36
37# Target arch
38TARGET_ARCH:=$(call qstrip,$(CONFIG_ARCH))
39
40# Target arch linux (header install). OpenWrt has a different list of archs then
41# Linux kernel.
42TARGET_ARCH_LINUX := $(patsubst mips%,mips,$(TARGET_ARCH))
43
44# Board
45# Example:
46#      target    : ar71xx
47#      sub_target: generic
48#      profile   : ubntrspro
49TARGET:=$(shell $(SCRIPT_GET_TARGET) target $(TOPDIR)/.config)
50SUB_TARGET:=$(shell $(SCRIPT_GET_TARGET) subtarget $(TOPDIR)/.config)
51PROFILE:=$(shell $(SCRIPT_GET_TARGET) profile $(TOPDIR)/.config)
52
53# Linux version [2.6.X(.X)]
54LINUX_VERSION:=$(call qstrip,$(CONFIG_DEBWRT_KERNEL_VERSION))
55
56# OpenWrt Branch to checkout [trunk|<otherbranchname>]
57OPENWRT_BRANCH:=$(call qstrip,$(CONFIG_OPENWRT_BRANCH))
58
59# OpenWrt Release Tag to checkout
60OPENWRT_TAG:=$(call qstrip,$(CONFIG_OPENWRT_TAG))
61
62# OpenWrt Revision to checkout [suitable for `svn -r XXXXX`]
63OPENWRT_REVISION:=$(call qstrip,$(CONFIG_OPENWRT_REVISION))
64
65# bin/delivery dir
66BIN_DIR:=$(TOPDIR)/bin
67
68# build dir
69BUILD_DIR:=$(TOPDIR)/build
70
71# tmp dir
72TMP_DIR:=$(TOPDIR)/tmp
73
74# Config dir
75CONFIG_DIR:=$(TOPDIR)/config
76
77# Plugins dir
78PLUGINS_DIR:=$(TOPDIR)/plugins
79
80# Base BuildDir
81BUILD_DIR_BASE:=$(BUILD_DIR)/$(DEBWRT_VERSION)
82
83# Install dir
84INSTALL_DIR_BASE:=$(BIN_DIR)/$(DEBWRT_VERSION)
85
86# Install dir for OpenWrt binaries
87INSTALL_DIR_OPENWRT:=$(INSTALL_DIR_BASE)/firmware/${TARGET_ARCH}/$(TARGET)/$(SUB_TARGET)
88
89# Install dir OpenWrt kernel modules
90INSTALL_DIR_OPENWRT_MODULES:=$(INSTALL_DIR_OPENWRT)/modules
91
92# Install dir OpenWrt packages
93INSTALL_DIR_OPENWRT_PACKAGES:=$(INSTALL_DIR_OPENWRT)/packages
94
95# Install dic OpenWrt kernel headers
96INSTALL_DIR_OPENWRT_HEADERS:=$(INSTALL_DIR_OPENWRT)/headers
97
98# Image file containing OpenWrt kernel modules
99MODULES_TAR_GZ=debwrt-modules-$(TARGET_ARCH)-$(TARGET)-$(SUB_TARGET)-$(OPENWRT_LINUX_UNAME_VERSION)-$(DEBWRT_VERSION).tar.gz
100
101# Image file containing OpenWrt kernel headers
102HEADERS_TAR_GZ=debwrt-headers-$(TARGET_ARCH)-$(TARGET)-$(SUB_TARGET)-$(OPENWRT_LINUX_UNAME_VERSION)-$(DEBWRT_VERSION).tar.gz
103
104# Filename of DebWrt firmware image
105TARGET_IMAGE_NAME_BIN=debwrt-firmware-$(TARGET)-$(SUB_TARGET)-$(OPENWRT_LINUX_UNAME_VERSION)-$(DEBWRT_VERSION).bin
106TARGET_IMAGE_NAME_TRX=debwrt-firmware-$(TARGET)-$(SUB_TARGET)-$(OPENWRT_LINUX_UNAME_VERSION)-$(DEBWRT_VERSION).trx
107
108# OpenWrt patches directory
109PATCHES_DIR_OPENWRT=$(TOPDIR)/openwrt/patches
110
111# OpenWrt files directory
112FILES_DIR_OPENWRT=$(TOPDIR)/openwrt/files
113
114# OpenWrt Build (checkout) directory
115ifeq ($(OPENWRT_TAG),)
116OPENWRT_BUILD_DIR:=$(BUILD_DIR_BASE)/openwrt/$(TARGET_ARCH)/$(TARGET)/$(SUB_TARGET)/$(OPENWRT_BRANCH)-$(OPENWRT_REVISION)
117else
118OPENWRT_BUILD_DIR:=$(BUILD_DIR_BASE)/openwrt/$(TARGET_ARCH)/$(TARGET)/$(SUB_TARGET)/$(OPENWRT_TAG)
119endif
120
121# Special saved environment variables during OpenWrt's build process
122OPENWRT_SAVE_CONFIG_FILE:=$(OPENWRT_BUILD_DIR)/.openwrt_env
123
124# Alternate OpenWrt download directory
125OPENWRT_DOWNLOAD_DIR:=$(call qstrip,$(CONFIG_OPENWRT_DOWNLOAD_DIR))
126
127# Debian
128DEBIAN_BUILD_DIR:=$(BUILD_DIR_BASE)/debian-$(TARGET)-$(SUB_TARGET)-$(DEBIAN_BUILD_VERSION)
129
130# Debian packages dir
131DEBIAN_PACKAGES_DIR:=$(TOPDIR)/debian/package
132INSTALL_DIR_DEBIAN_PACKAGES:=$(INSTALL_DIR)/debian
133
134# Debian rootfs
135ROOTFS_DEBIAN_ARCH:=$(call qstrip,$(CONFIG_ROOTFS_DEBIAN_ARCH))
136ROOTFS_DEBIAN_RELEASE:=$(call qstrip,$(CONFIG_ROOTFS_DEBIAN_RELEASE))
137ROOTFS_BUILD_DIR:=$(BUILD_DIR_BASE)/rootfs/$(ROOTFS_DEBIAN_RELEASE)/${ROOTFS_DEBIAN_ARCH}
138ROOTFS_INSTALL_DIR:=$(INSTALL_DIR_BASE)/rootfs/$(ROOTFS_DEBIAN_RELEASE)/${ROOTFS_DEBIAN_ARCH}
139
140# Image file containing DebWrt rootfs
141ROOTFS_TAR_BZ2=debwrt-rootfs-$(ROOTFS_DEBIAN_RELEASE)-$(ROOTFS_DEBIAN_ARCH)-$(DEBWRT_VERSION).tar.bz2
142
143# Export defaults to other Makefiles
144export
145
146$(TMP_DIR) $(BIN_DIR) $(OPENWRT_BUILD_DIR) $(BUILD_DIR_BASE) $(INSTALL_DIR_BASE) $(INSTALL_DIR_OPENWRT) $(INSTALL_DIR_DEBIAN):
147        mkdir -p $@
148
Note: See TracBrowser for help on using the repository browser.