diff options
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 27 |
1 files changed, 8 insertions, 19 deletions
@@ -32,21 +32,7 @@ OBJS = \ # riscv64-unknown-elf- or riscv64-linux-gnu- # perhaps in /opt/riscv/bin -#TOOLPREFIX = - -# Try to infer the correct TOOLPREFIX if not set -ifndef TOOLPREFIX -TOOLPREFIX := $(shell if riscv64-unknown-elf-objdump -i 2>&1 | grep 'elf64-big' >/dev/null 2>&1; \ - then echo 'riscv64-unknown-elf-'; \ - elif riscv64-linux-gnu-objdump -i 2>&1 | grep 'elf64-big' >/dev/null 2>&1; \ - then echo 'riscv64-linux-gnu-'; \ - elif riscv64-unknown-linux-gnu-objdump -i 2>&1 | grep 'elf64-big' >/dev/null 2>&1; \ - then echo 'riscv64-unknown-linux-gnu-'; \ - else echo "***" 1>&2; \ - echo "*** Error: Couldn't find a riscv64 version of GCC/binutils." 1>&2; \ - echo "*** To turn off this error, run 'gmake TOOLPREFIX= ...'." 1>&2; \ - echo "***" 1>&2; exit 1; fi) -endif +TOOLPREFIX = /home/aditya/dev/os/riscv-gnu-toolchain/bin/bin/riscv64-unknown-linux-gnu- QEMU = qemu-system-riscv64 @@ -57,7 +43,7 @@ OBJCOPY = $(TOOLPREFIX)objcopy OBJDUMP = $(TOOLPREFIX)objdump CFLAGS = -Wall -Werror -O -fno-omit-frame-pointer -ggdb -CFLAGS += -MD +CFLAGS += -MD -march=rv64i -mabi=lp64 CFLAGS += -mcmodel=medany CFLAGS += -ffreestanding -fno-common -nostdlib -mno-relax CFLAGS += -I. @@ -128,11 +114,13 @@ UPROGS=\ $U/_rm\ $U/_sh\ $U/_stressfs\ - $U/_usertests\ - $U/_grind\ $U/_wc\ $U/_zombie\ +# These two need the M extension + # $U/_grind\ + # $U/_usertests\ + fs.img: mkfs/mkfs README $(UPROGS) mkfs/mkfs fs.img README $(UPROGS) @@ -152,8 +140,9 @@ GDBPORT = $(shell expr `id -u` % 5000 + 25000) QEMUGDB = $(shell if $(QEMU) -help | grep -q '^-gdb'; \ then echo "-gdb tcp::$(GDBPORT)"; \ else echo "-s -p $(GDBPORT)"; fi) + ifndef CPUS -CPUS := 3 +CPUS := 1 endif QEMUOPTS = -machine virt -bios none -kernel $K/kernel -m 128M -smp $(CPUS) -nographic |
