-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
54 lines (44 loc) · 1.32 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
RED=\033[0;31m
NC=\033[0m
ROOT=$(PWD)/gcc/
GCC=$(ROOT)/gcc-7.2.0/
# NPROC=$(nproc --all)
NPROC=4
all: rebuild test
g++:
@ln -s $(ROOT)/install/bin/g++ g++
test: g++
@./g++ -std=c++17 test.cpp && echo "$(RED)compilation successfull!$(NC)";
update_patches:
@rm -f patch/* && cd $(GCC) && \
git format-patch ec5ab5b3c6ec0c219be9f1160f5b601fcd10a703 && \
cd - && mv $(GCC)/*.patch patch/;
gcc:
@echo "$(RED)creating gcc/...$(NC)";
@mkdir gcc;
gcc/gcc-7.2.0: gcc/
@echo "$(RED)downloading gcc-7.2.0...$(NC)";
@cd gcc && \
wget -O gcc-7.2.0.tar.gz ftp://ftp.uvsq.fr/pub/gcc/releases/gcc-7.2.0/gcc-7.2.0.tar.gz && \
gunzip gcc-7.2.0.tar.gz && \
tar -xf gcc-7.2.0.tar && \
rm -f gcc-7.2.0.tar;
gcc/build: gcc/gcc-7.2.0/
@echo "$(RED)configuring gcc...$(NC)";
@mkdir -p gcc/build;
@cd gcc/build && \
$(GCC)/configure --prefix=$(ROOT)/install/ \
--disable-bootstrap --disable-multilib --disable-shared --enable-languages=c++;
rebuild: gcc/build
@echo "$(RED)building gcc...$(NC)";
@cd gcc/build && $(MAKE) -j$(NPROC) && $(MAKE) install -j$(NPROC);
apply_patches: gcc/build/
@echo "$(RED)applying patches...$(NC)";
@for patch in $(ls $(PWD)/patch/*.patch); \
do patch -d $(GCC) -p1 < $(PWD)/patch/$(patch); \
done;
amazon_update:
@cd gcc/ && \
rm -f gcc.tar && \
tar -cf gcc.tar install/ && \
~/.bin/amazon_connect gcc.tar