Organize targets, export variables

This commit is contained in:
Jeremy Soller 2016-12-29 21:35:48 -07:00
commit 3ec00fe3ba
6 changed files with 22 additions and 19 deletions

View file

@ -1,25 +1,28 @@
ARCH?=x86_64
ROOT=$(PWD)
export RUST_TARGET_PATH=$(ROOT)/targets
#TODO: Use libssp
export CFLAGS=-fno-stack-protector -U_FORTIFY_SOURCE
# Kernel variables
KTARGET=$(ARCH)-unknown-none
KBUILD=build/kernel
KRUSTC=./krustc.sh
KRUSTCFLAGS=--target $(KTARGET).json -C opt-level=2 -C debuginfo=0 -C soft-float
KRUSTCFLAGS=--target $(KTARGET) -C opt-level=2 -C debuginfo=0 -C soft-float
KRUSTDOC=./krustdoc.sh
KCARGO=RUSTC="$(KRUSTC)" RUSTDOC="$(KRUSTDOC)" cargo
KCARGOFLAGS=--target $(KTARGET).json --release -- -C soft-float
KCARGOFLAGS=--target $(KTARGET) --release -- -C soft-float
# Userspace variables
TARGET=$(ARCH)-unknown-redox
BUILD=build/userspace
RUSTC=./rustc.sh
RUSTCFLAGS=--target $(TARGET).json -C opt-level=2 -C debuginfo=0
RUSTCFLAGS=--target $(TARGET) -C opt-level=2 -C debuginfo=0
RUSTDOC=./rustdoc.sh
CARGO=RUSTC="$(RUSTC)" RUSTDOC="$(RUSTDOC)" cargo
CARGOFLAGS=--target $(TARGET).json --release --
#TODO: Use libssp
export CFLAGS=-fno-stack-protector -U_FORTIFY_SOURCE
CARGOFLAGS=--target $(TARGET) --release --
# Default targets
.PHONY: all live iso clean doc ref test update pull qemu bochs drivers schemes binutils coreutils extrautils netutils userutils wireshark FORCE
@ -169,9 +172,9 @@ ifeq ($(ARCH),arm)
QEMUFLAGS+=-cpu arm1176 -machine integratorcp
QEMUFLAGS+=-nographic
CC=$(ARCH)-none-eabi-gcc
CXX=$(ARCH)-none-eabi-g++
LD=$(ARCH)-none-eabi-ld
export CC=$(ARCH)-none-eabi-gcc
export CXX=$(ARCH)-none-eabi-g++
export LD=$(ARCH)-none-eabi-ld
KRUSTCFLAGS+=-C linker=$(CC)
KCARGOFLAGS+=-C linker=$(CC)
@ -209,21 +212,21 @@ else
UNAME := $(shell uname)
ifeq ($(UNAME),Darwin)
CC=$(ARCH)-elf-gcc
CXX=$(ARCH)-elf-g++
export CC=$(ARCH)-elf-gcc
export CXX=$(ARCH)-elf-g++
ECHO=/bin/echo
FUMOUNT=sudo umount
LD=$(ARCH)-elf-ld
LDFLAGS=--gc-sections
export LD=$(ARCH)-elf-ld
export LDFLAGS=--gc-sections
VB_AUDIO=coreaudio
VBM="/Applications/VirtualBox.app/Contents/MacOS/VBoxManage"
else
CC=gcc
CXX=g++
export CC=gcc
export CXX=g++
ECHO=echo
FUMOUNT=fusermount -u
LD=ld
LDFLAGS=--gc-sections
export LD=ld
export LDFLAGS=--gc-sections
ifneq ($(kvm),no)
QEMUFLAGS+=-enable-kvm -cpu host
endif

@ -1 +1 @@
Subproject commit e79e54d2f5ad6492b4452f74e60c54325997823f
Subproject commit 1193791d642795840d7f22967249bad8bdef1a32

View file

@ -0,0 +1,25 @@
{
"llvm-target": "arm-unknown-none",
"target-endian": "little",
"target-pointer-width": "32",
"data-layout": "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64",
"arch": "arm",
"os": "none",
"env": "",
"vendor": "unknown",
"target-family": "redox",
"pre-link-args": ["-nostdlib", "-static"],
"features": "+soft-float",
"dynamic-linking": false,
"executables": false,
"relocation-model": "static",
"code-model": "kernel",
"disable-redzone": true,
"eliminate-frame-pointer": false,
"exe-suffix": "",
"has-rpath": false,
"no-compiler-rt": true,
"no-default-libraries": true,
"position-independent-executables": false,
"has-elf-tls": true
}

View file

@ -0,0 +1,26 @@
{
"llvm-target": "arm-unknown-redox",
"target-endian": "little",
"target-pointer-width": "32",
"data-layout": "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64",
"arch": "arm",
"os": "redox",
"env": "",
"vendor": "unknown",
"target-family": "redox",
"pre-link-args": ["-nostdlib", "-static"],
"features": "+soft-float",
"dynamic-linking": false,
"executables": true,
"relocation-model": "static",
"code-model": "default",
"disable-redzone": true,
"eliminate-frame-pointer": false,
"exe-suffix": "",
"has-rpath": false,
"no-compiler-rt": true,
"no-default-libraries": true,
"position-independent-executables": false,
"has-elf-tls": true,
"panic-strategy": "abort"
}

View file

@ -0,0 +1,25 @@
{
"llvm-target": "x86_64-unknown-none",
"target-endian": "little",
"target-pointer-width": "64",
"data-layout": "e-m:e-i64:64-f80:128-n8:16:32:64-S128",
"arch": "x86_64",
"os": "none",
"env": "",
"vendor": "unknown",
"target-family": "redox",
"pre-link-args": ["-m64", "-nostdlib", "-static"],
"features": "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-3dnow,-3dnowa,-avx,-avx2,+soft-float",
"dynamic-linking": false,
"executables": false,
"relocation-model": "pic",
"code-model": "kernel",
"disable-redzone": true,
"eliminate-frame-pointer": false,
"exe-suffix": "",
"has-rpath": false,
"no-compiler-rt": true,
"no-default-libraries": true,
"position-independent-executables": false,
"has-elf-tls": true
}

View file

@ -0,0 +1,29 @@
{
"llvm-target": "x86_64-unknown-redox",
"target-endian": "little",
"target-pointer-width": "64",
"data-layout": "e-m:e-i64:64-f80:128-n8:16:32:64-S128",
"arch": "x86_64",
"os": "redox",
"env": "",
"vendor": "unknown",
"target-family": "redox",
"pre-link-args": ["-m64", "-Wl,--as-needed", "-Wl,-z,noexecstack", "-nostartfiles", "-nostdlib", "-static"],
"late-link-args": ["libc-artifacts/lib/crt0.o", "libc-artifacts/lib/libm.a", "libc-artifacts/lib/libc.a", "libc-artifacts/lib/libgcc.a"],
"features": "",
"dynamic-linking": false,
"executables": true,
"relocation-model": "static",
"code-model": "default",
"disable-redzone": true,
"eliminate-frame-pointer": false,
"exe-suffix": "",
"has-rpath": false,
"no-compiler-rt": true,
"no-default-libraries": true,
"position-independent-executables": false,
"lib-allocation-crate": "alloc_system",
"exe-allocation-crate": "alloc_system",
"has-elf-tls": true,
"panic-strategy": "abort"
}