Root/Makefile

1# "PanGu Makefile" - for setting up the PanGu development environment
2#
3# Copyright 2009 (C) Qi Hardware inc.,
4# Author: Xiangfu Liu <xiangfu@qi-hardware.com>
5#
6# This program is free software; you can redistribute it and/or
7# modify it under the terms of the GNU General Public License
8# version 3 as published by the Free Software Foundation.
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, write to the Free Software
17# Foundation, Inc., 51 Franklin Street, Fifth Floor,
18# Boston, MA 02110-1301, USA
19
20# for the device stage
21FLASH_TOOL_PATH = ./usbboot
22STAGE1_PATH = $(FLASH_TOOL_PATH)/xburst_stage1
23STAGE2_PATH = $(FLASH_TOOL_PATH)/xburst_stage2
24CROSS_COMPILE ?= mipsel-openwrt-linux-
25
26CFLAGS="-O2"
27
28### u-boot
29.PHONY: u-boot
30u-boot:
31    git clone git://github.com/xiangfu/qi-u-boot.git u-boot
32    cd u-boot && \
33    make qi_lb60_config && \
34    make
35
36### kernel
37.PHONY: kernel
38kernel:
39    git clone git://github.com/xiangfu/qi-kernel.git kernel
40    cd kernel && \
41    make pi_defconfig && \
42    make uImage
43
44### flash-boot
45.PHONY: usbboot
46usbboot: stage1 stage2
47    cd $(FLASH_TOOL_PATH)
48    ./autogen.sh && \
49    ./configure && \
50    make
51
52stage1:
53    make CROSS_COMPILE=$(CROSS_COMPILE) -C $(STAGE1_PATH)
54
55stage2:
56    make CROSS_COMPILE=$(CROSS_COMPILE) -C $(STAGE2_PATH)
57
58### clean up
59distclean: clean clean-usbboot
60
61clean:
62
63clean-usbboot:
64    make clean CROSS_COMPILE=$(CROSS_COMPILE) -C $(STAGE1_PATH)
65    make clean CROSS_COMPILE=$(CROSS_COMPILE) -C $(STAGE2_PATH)
66    make clean -C $(FLASH_TOOL_PATH)
67
68help:
69    @make --print-data-base --question | \
70    awk '/^[^.%][-A-Za-z0-9_]*:/ \
71    { print substr($$1, 1, length($$1)-1) }' | \
72    sort | \
73    pr --omit-pagination --width=80 --columns=1
74

Archive Download this file



interactive