Modularise makefiles
This commit is contained in:
parent
b7a19200a8
commit
e3f3f27fbc
1 changed files with 525 additions and 526 deletions
51
mk/config.mk
Normal file
51
mk/config.mk
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
# Configuration
|
||||
ARCH?=x86_64
|
||||
|
||||
# Automatic variables
|
||||
ROOT=$(PWD)
|
||||
export RUST_TARGET_PATH=$(ROOT)/targets
|
||||
export CC=$(ROOT)/libc-artifacts/gcc.sh
|
||||
export CFLAGS=-fno-stack-protector -U_FORTIFY_SOURCE
|
||||
|
||||
# Kernel variables
|
||||
KTARGET=$(ARCH)-unknown-none
|
||||
KBUILD=build/kernel
|
||||
KRUSTC=./krustc.sh
|
||||
KRUSTDOC=./krustdoc.sh
|
||||
KCARGO=RUSTC="$(KRUSTC)" RUSTDOC="$(KRUSTDOC)" cargo
|
||||
KCARGOFLAGS=--target $(KTARGET) --release -- -C soft-float
|
||||
|
||||
# Userspace variables
|
||||
export TARGET=$(ARCH)-unknown-redox
|
||||
BUILD=build/userspace
|
||||
RUSTC=./rustc.sh
|
||||
RUSTDOC=./rustdoc.sh
|
||||
CARGO=RUSTC="$(RUSTC)" RUSTDOC="$(RUSTDOC)" cargo
|
||||
CARGOFLAGS=--target $(TARGET) --release -- -C codegen-units=`nproc`
|
||||
|
||||
# Per host variables
|
||||
UNAME := $(shell uname)
|
||||
ifeq ($(UNAME),Darwin)
|
||||
ECHO=/bin/echo
|
||||
FUMOUNT=sudo umount
|
||||
export LD=$(ARCH)-elf-ld
|
||||
export LDFLAGS=--gc-sections
|
||||
export STRIP=$(ARCH)-elf-strip
|
||||
VB_AUDIO=coreaudio
|
||||
VBM="/Applications/VirtualBox.app/Contents/MacOS/VBoxManage"
|
||||
else
|
||||
ECHO=echo
|
||||
FUMOUNT=fusermount -u
|
||||
export LD=ld
|
||||
export LDFLAGS=--gc-sections
|
||||
export STRIP=strip
|
||||
VB_AUDIO="pulse"
|
||||
VBM=VBoxManage
|
||||
endif
|
||||
|
||||
# An empty target
|
||||
FORCE:
|
||||
|
||||
# A method of creating a listing for any binary
|
||||
%.list: %
|
||||
objdump -C -M intel -D $< > $@
|
||||
Loading…
Reference in a new issue