From e69a394ed792d54a4e8d2b51a8affc9c9211662f Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Mon, 1 Jun 2020 19:46:52 +0200 Subject: [PATCH] Adding gitignore, first steps : download the sources --- .gitignore | 4 +++ Makefile | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..12eb267 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +gcc*/* +binutils*/* +gcc* +binutils* diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..fe16f79 --- /dev/null +++ b/Makefile @@ -0,0 +1,87 @@ +#=----------------------------------------------------------------------------=# +# OS/K CROSS COMPILER BUILDER # +# # +# Desc: Project Makefile # +# # +# # +# Copyright © 2018-2020 The OS/K Team # +# # +# This file is part of OS/K. # +# # +# OS/K is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# any later version. # +# # +# OS/K is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY# without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with OS/K. If not, see . # +#=----------------------------------------------------------------------------=# + +.PHONY: retrieve compile showenv +.DEFAULT_GOAL := compile + + +## VERSIONS ------------------------------------------------------------------ # + +# GCC 10.1.0 +GCC_SOURCES = https://ftp.gnu.org/gnu/gcc/gcc-10.1.0/gcc-10.1.0.tar.xz +# BINUTILS 2.34 +BINUTILS_SOURCES = https://ftp.gnu.org/gnu/binutils/binutils-2.34.tar.xz + + +## VARIABLES ----------------------------------------------------------------- # + +#ENV +export NTHREADS := ${nproc} +export PREFIX := $(HOME)/opt/cross +export TARGET := x86_64-elf +export PATH := $(PREFIX)/bin:$(PATH) +export XZ_DEFAULTS := -T $(NTHREADS) + + +GCCTARNAME = gcc.tar.xz +BINUTILSTARNAME = binutils.tar.xz +GCCDIRNAME = gcc-src +BINUTILSDIRNAME = binutils-src + +# Color codes +CL='\033[0;32m' +CL2='\033[1;36m' +CL3='\033[0m' +NC='\033[1;37m' + + +## RECIPES ------------------------------------------------------------------- # + +showenv: + @echo Installation path prefix : $(PREFIX) + @echo Installation path : $(PATH) + @echo Target : $(TARGET) + @echo Thread number : $(NTHREADS) + +retrieve: showenv + @echo ${CL2}[$@] ${NC}Downloading GCC sources...${CL3} + @wget $(GCC_SOURCES) -O $(GCCTARNAME) -q -c --show-progress + @echo ${CL2}[$@] ${NC}Downloading BINUTILS sources...${CL3} + @wget $(BINUTILS_SOURCES) -O $(BINUTILSTARNAME) -q -c --show-progress + @echo ${CL2}[$@] ${CL}Success.${CL3} + +deflate: + @echo ${CL2}[$@] ${NC}Deflate GCC sources...${CL3} + @tar -xaf $(GCCTARNAME) --threads NTHREADS + @echo ${CL2}[$@] ${NC}Deflate BINUTILS sources...${CL3} + @tar -xaf $(BINUTILSTARNAME) --threads NTHREADS + @echo ${CL2}[$@] ${CL}Success.${CL3} + +compile: retrieve deflate + @echo ${CL2}[$@] ${CL}Success.${CL3} + +remove_all: + @rm -rf gcc* + @rm -rf binutils* + @echo ${CL2}[$@] ${CL}Success.${CL3}