2014-01-16 07:39:33 +01:00
|
|
|
ifeq (, $(NEWLIB_BASE))
|
|
|
|
NEWLIB_BASE := $(RIOTBASE)/toolchain/x86/i586-none-elf
|
make: centralize wget/curl & unzip/7z feature test
With many open PRs that could benefit from loading SDKs when needed,
instead adding vast amounts of code to RIOTs master, this PR provides
the "functions" `$(DOWNLOAD_TO_STDOUT)`, `$(DOWNLOAD_TO_FILE)`, and
`$(UNZIP_HERE)`.
The first "function" takes one argument, the URL from where to download
the content. It is then piped to stdout. To be used e.g. with `tar xz`.
The second "function" taken two arguments, the destination file name,
and the source URL. If the previous invocation was interrupted, then the
download gets continued, if possible.
The last "function" takes one argument, the source ZIP file. The file
gets extracted into the cwd, so best use this "function" with
`cd $(SOME_WHERE) &&`.
The clumsy name `$(UNZIP_HERE)` is taken because the program "unzip"
takes the environment variable `UNZIP` as the source file, even if
another file name was given on the command line. The rationale for that
is that the hackers of "unzip" hate their users. Also they sacrifice
hamsters to Satan.
2014-07-16 00:29:18 +02:00
|
|
|
endif
|
2014-01-16 07:39:33 +01:00
|
|
|
|
make: centralize wget/curl & unzip/7z feature test
With many open PRs that could benefit from loading SDKs when needed,
instead adding vast amounts of code to RIOTs master, this PR provides
the "functions" `$(DOWNLOAD_TO_STDOUT)`, `$(DOWNLOAD_TO_FILE)`, and
`$(UNZIP_HERE)`.
The first "function" takes one argument, the URL from where to download
the content. It is then piped to stdout. To be used e.g. with `tar xz`.
The second "function" taken two arguments, the destination file name,
and the source URL. If the previous invocation was interrupted, then the
download gets continued, if possible.
The last "function" takes one argument, the source ZIP file. The file
gets extracted into the cwd, so best use this "function" with
`cd $(SOME_WHERE) &&`.
The clumsy name `$(UNZIP_HERE)` is taken because the program "unzip"
takes the environment variable `UNZIP` as the source file, even if
another file name was given on the command line. The rationale for that
is that the hackers of "unzip" hate their users. Also they sacrifice
hamsters to Satan.
2014-07-16 00:29:18 +02:00
|
|
|
ifneq (0, $(shell test -e "$(NEWLIB_BASE)/lib/libc.a" && echo $$?))
|
2015-07-08 10:27:19 +02:00
|
|
|
NEWLIB_PRECOMPILED_NAME := i586-newlib_2.2.0.20150623_tlsf-3337.tar.bz2
|
make: centralize wget/curl & unzip/7z feature test
With many open PRs that could benefit from loading SDKs when needed,
instead adding vast amounts of code to RIOTs master, this PR provides
the "functions" `$(DOWNLOAD_TO_STDOUT)`, `$(DOWNLOAD_TO_FILE)`, and
`$(UNZIP_HERE)`.
The first "function" takes one argument, the URL from where to download
the content. It is then piped to stdout. To be used e.g. with `tar xz`.
The second "function" taken two arguments, the destination file name,
and the source URL. If the previous invocation was interrupted, then the
download gets continued, if possible.
The last "function" takes one argument, the source ZIP file. The file
gets extracted into the cwd, so best use this "function" with
`cd $(SOME_WHERE) &&`.
The clumsy name `$(UNZIP_HERE)` is taken because the program "unzip"
takes the environment variable `UNZIP` as the source file, even if
another file name was given on the command line. The rationale for that
is that the hackers of "unzip" hate their users. Also they sacrifice
hamsters to Satan.
2014-07-16 00:29:18 +02:00
|
|
|
NEWLIB_PRECOMPILED := http://download.riot-os.org/$(NEWLIB_PRECOMPILED_NAME)
|
2014-01-16 07:39:33 +01:00
|
|
|
|
make: centralize wget/curl & unzip/7z feature test
With many open PRs that could benefit from loading SDKs when needed,
instead adding vast amounts of code to RIOTs master, this PR provides
the "functions" `$(DOWNLOAD_TO_STDOUT)`, `$(DOWNLOAD_TO_FILE)`, and
`$(UNZIP_HERE)`.
The first "function" takes one argument, the URL from where to download
the content. It is then piped to stdout. To be used e.g. with `tar xz`.
The second "function" taken two arguments, the destination file name,
and the source URL. If the previous invocation was interrupted, then the
download gets continued, if possible.
The last "function" takes one argument, the source ZIP file. The file
gets extracted into the cwd, so best use this "function" with
`cd $(SOME_WHERE) &&`.
The clumsy name `$(UNZIP_HERE)` is taken because the program "unzip"
takes the environment variable `UNZIP` as the source file, even if
another file name was given on the command line. The rationale for that
is that the hackers of "unzip" hate their users. Also they sacrifice
hamsters to Satan.
2014-07-16 00:29:18 +02:00
|
|
|
$(warning Precompiled newlib is missing in $(NEWLIB_BASE))
|
|
|
|
$(warning Downloading from $(NEWLIB_PRECOMPILED))
|
2014-05-28 19:24:59 +02:00
|
|
|
|
make: centralize wget/curl & unzip/7z feature test
With many open PRs that could benefit from loading SDKs when needed,
instead adding vast amounts of code to RIOTs master, this PR provides
the "functions" `$(DOWNLOAD_TO_STDOUT)`, `$(DOWNLOAD_TO_FILE)`, and
`$(UNZIP_HERE)`.
The first "function" takes one argument, the URL from where to download
the content. It is then piped to stdout. To be used e.g. with `tar xz`.
The second "function" taken two arguments, the destination file name,
and the source URL. If the previous invocation was interrupted, then the
download gets continued, if possible.
The last "function" takes one argument, the source ZIP file. The file
gets extracted into the cwd, so best use this "function" with
`cd $(SOME_WHERE) &&`.
The clumsy name `$(UNZIP_HERE)` is taken because the program "unzip"
takes the environment variable `UNZIP` as the source file, even if
another file name was given on the command line. The rationale for that
is that the hackers of "unzip" hate their users. Also they sacrifice
hamsters to Satan.
2014-07-16 00:29:18 +02:00
|
|
|
$(shell cd $(RIOTBASE) && $(DOWNLOAD_TO_STDOUT) "$(NEWLIB_PRECOMPILED)" | tar xj)
|
2014-01-16 07:39:33 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq (,$(BUILD_INCLUDE_BASE))
|
|
|
|
GCC_BUILD_TRIPLET ?= $(shell gcc -dumpmachine)
|
|
|
|
GCC_BUILD_VERSION ?= $(shell gcc -dumpversion)
|
|
|
|
BUILD_INCLUDE_BASE = /usr/lib/gcc/$(GCC_BUILD_TRIPLET)/$(GCC_BUILD_VERSION)
|
|
|
|
|
|
|
|
ifeq (,$(shell echo $(GCC_BUILD_TRIPLET) | sed -e 's,-.*,,' | grep -e '\(x\|i[3-7]\)86'))
|
|
|
|
$(warning Your build machine is a(n) $(GCC_BUILD_TRIPLET).)
|
|
|
|
$(warning Since this is not IA32 compatible, you must set BUILD_INCLUDE_BASE explicitly!)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
export INCLUDES += -isystem $(BUILD_INCLUDE_BASE)/include \
|
|
|
|
-isystem $(NEWLIB_BASE)/include \
|
|
|
|
-isystem $(NEWLIB_BASE)/sys-include \
|
|
|
|
-isystem $(BUILD_INCLUDE_BASE)/include-fixed \
|
|
|
|
-I$(RIOTBOARD)/x86-multiboot-common/include
|
|
|
|
export CPU = x86
|
|
|
|
|
|
|
|
# toolchain config
|
|
|
|
export CC ?= $(PREFIX)gcc
|
|
|
|
export AR ?= $(PREFIX)ar
|
|
|
|
export AS ?= $(PREFIX)as
|
|
|
|
export RANLIB ?= $(PREFIX)ranlib
|
|
|
|
export LINK ?= $(RIOTBASE)/boards/x86-multiboot-common/dist/link $(PREFIX)gcc
|
|
|
|
export SIZE ?= $(PREFIX)size
|
|
|
|
export OBJCOPY ?= $(PREFIX)objcopy
|
|
|
|
|
|
|
|
export CFLAGS += -m32 -mfpmath=387 -ffreestanding -nostdlib -nostdinc -fno-builtin
|
|
|
|
export OFLAGS = -O binary
|
|
|
|
|
|
|
|
LINKFLAGS += -m32 -nostdlib -nostdinc -nostartfiles -nodefaultlibs \
|
|
|
|
--prefix=$(NEWLIB_BASE) \
|
|
|
|
-Wl,-rpath,$(NEWLIB_BASE)/lib \
|
2014-06-07 03:13:55 +02:00
|
|
|
-T$(RIOTBASE)/boards/x86-multiboot-common/linker.ld
|
2014-01-16 07:39:33 +01:00
|
|
|
UNDEF += $(BINDIR)x86-multiboot-common_base/startup.o
|
|
|
|
|
|
|
|
BASELIBS += $(NEWLIB_BASE)/lib/libc.a \
|
|
|
|
$(NEWLIB_BASE)/lib/libm.a
|
2014-06-07 03:13:55 +02:00
|
|
|
|
|
|
|
all:
|
|
|
|
|
|
|
|
all-debug: export CFLAGS += -ggdb3 -O0
|
|
|
|
all-debug: all
|