-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
90 lines (72 loc) · 2.22 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
TARGET := arm-none-eabi
PREFIX := $(PWD)/local-prefix
LANGUAGES := c
BINUTILS_HOST := http://ftp.gnu.org/gnu/binutils
BINUTILS_SRCDIR := binutils-2.23.1
BINUTILS_BUILDDIR := build-binutils
BINUTILS_FILENAME := binutils-2.23.1.tar.bz2
GCC_HOST := http://ftpmirror.gnu.org/gcc/gcc-4.7.3
GCC_SRCDIR := gcc-4.7.3
GCC_BUILDDIR := build-gcc
GCC_FILENAME := gcc-4.7.3.tar.bz2
GCC_MD5 := cc308a0891e778cfda7a151ab8a6e762
GDB_HOST := ftp://sourceware.org/pub/gdb/releases
GDB_SRCDIR := gdb-7.5.1
GDB_BUILDDIR := build-gdb
GDB_FILENAME := gdb-7.5.1.tar.bz2
.PHONY: all
all: gcc-all binutils-all gdb-all
.PHONY: fetch extract
fetch: $(GCC_FILENAME) $(BINUTILS_FILENAME) $(GDB_FILENAME)
extract: $(GCC_SRCDIR) $(BINUTILS_SRCDIR) $(GDB_SRCDIR)
.PHONY: clean realclean distclean
clean:
rm -rf $(GCC_BUILDDIR) $(BINUTILS_BUILDDIR) $(GDB_BUILDDIR)
realclean: clean
rm -rf $(GCC_SRCDIR) $(BINUTILS_SRCDIR) $(GDB_SRCDIR)
distclean: realclean
rm -f $(GCC_FILENAME) $(BINUTILS_FILENAME) $(GDB_FILENAME)
.PHONY: gcc-all
gcc-all: $(GCC_SRCDIR) | $(BINUTILS_BUILDDIR)
mkdir -p $(GCC_BUILDDIR) &&\
cd $(GCC_BUILDDIR) &&\
../$(GCC_SRCDIR)/configure \
--target=$(TARGET) \
--prefix=$(PREFIX) \
--enable-languages=$(LANGUAGES) \
--without-headers \
--disable-libssp \
--with-gmp=/usr/local
#LD_LIBRARY_PATH="/usr/local/lib"
$(MAKE) -C $(GCC_BUILDDIR)
$(MAKE) -C $(GCC_BUILDDIR) install
.PHONY: binutils-all
binutils-all $(BINUTILS_BUILDDIR): $(BINUTILS_SRCDIR)
mkdir -p $(BINUTILS_BUILDDIR) &&\
cd $(BINUTILS_BUILDDIR) &&\
../$(BINUTILS_SRCDIR)/configure \
--target=$(TARGET) \
--prefix=$(PREFIX)
$(MAKE) -C $(BINUTILS_BUILDDIR)
$(MAKE) -C $(BINUTILS_BUILDDIR) install
.PHONY: gdb-all
gdb-all: $(GDB_SRCDIR)
mkdir -p $(GDB_BUILDDIR) &&\
cd $(GDB_BUILDDIR) &&\
../$(GDB_SRCDIR)/configure \
--target=$(TARGET) \
--prefix=$(PREFIX)
$(MAKE) -C $(GDB_BUILDDIR)
$(MAKE) -C $(GDB_BUILDDIR) install
$(GCC_SRCDIR): $(GCC_FILENAME)
tar xf $(GCC_FILENAME)
$(GCC_FILENAME):
wget $(GCC_HOST)/$(GCC_FILENAME)
$(BINUTILS_SRCDIR): $(BINUTILS_FILENAME)
tar xf $(BINUTILS_FILENAME)
$(BINUTILS_FILENAME):
wget $(BINUTILS_HOST)/$(BINUTILS_FILENAME)
$(GDB_SRCDIR): $(GDB_FILENAME)
tar xf $(GDB_FILENAME)
$(GDB_FILENAME):
wget $(GDB_HOST)/$(GDB_FILENAME)