From: Andrew Waterman Date: Thu, 3 Mar 2016 19:02:24 +0000 (-0800) Subject: Fix ./configure in root X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=08486cb632ef704709a89fc6bab5842bec4c2547;p=riscv-tests.git Fix ./configure in root This Makefile is still super ghetto! --- diff --git a/.gitignore b/.gitignore index d5e1bc3..448e1fe 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,7 @@ *.out *.hex .*.swp -autom4te.cache +/autom4te.cache +/Makefile +/config.log +/config.status diff --git a/Makefile.in b/Makefile.in index 541263b..3a47a18 100644 --- a/Makefile.in +++ b/Makefile.in @@ -9,20 +9,20 @@ all: benchmarks isa install: all install -d $(instbasedir)/share/riscv-tests/isa install -d $(instbasedir)/share/riscv-tests/benchmarks - install -p -m 644 isa/* $(instbasedir)/share/riscv-tests/isa - install -p -m 644 benchmarks/* $(instbasedir)/share/riscv-tests/benchmarks + install -p -m 644 `find $(isa_src_dir) -maxdepth 1 -type f` $(instbasedir)/share/riscv-tests/isa + install -p -m 644 `find $(bmarkdir) -maxdepth 1 -type f` $(instbasedir)/share/riscv-tests/benchmarks benchmarks: mkdir -p benchmarks - $(MAKE) -C benchmarks -f $(bmarkdir)/Makefile bmarkdir=$(bmarkdir) + $(MAKE) -C benchmarks -f $(bmarkdir)/Makefile src_dir=$(bmarkdir) isa: mkdir -p isa - $(MAKE) -C isa -f $(isa_src_dir)/Makefile isa_src_dir=$(isa_src_dir) + $(MAKE) -C isa -f $(isa_src_dir)/Makefile src_dir=$(isa_src_dir) clean: - $(MAKE) -f $(isa_src_dir)/Makefile isa_src_dir=$(isa_src_dir) clean - $(MAKE) -f $(bmarkdir)/Makefile bmarkdir=$(bmarkdir) clean + $(MAKE) -C isa -f $(isa_src_dir)/Makefile src_dir=$(isa_src_dir) clean + $(MAKE) -C benchmarks -f $(bmarkdir)/Makefile src_dir=$(bmarkdir) clean .PHONY: benchmarks isa clean diff --git a/benchmarks/Makefile b/benchmarks/Makefile index 26df2a9..1145fed 100644 --- a/benchmarks/Makefile +++ b/benchmarks/Makefile @@ -6,7 +6,7 @@ default: all -bmarkdir = . +src_dir = . instname = riscv-bmarks instbasedir = $(UCB_VLSI_HOME)/install @@ -49,19 +49,19 @@ HOST_COMP = gcc $(HOST_OPTS) RISCV_PREFIX ?= riscv64-unknown-elf- RISCV_GCC ?= $(RISCV_PREFIX)gcc RISCV_GCC_OPTS ?= -static -std=gnu99 -O2 -ffast-math -fno-common -fno-builtin-printf -RISCV_LINK ?= $(RISCV_GCC) -T $(bmarkdir)/common/test.ld $(incs) -RISCV_LINK_MT ?= $(RISCV_GCC) -T $(bmarkdir)/common/test-mt.ld +RISCV_LINK ?= $(RISCV_GCC) -T $(src_dir)/common/test.ld $(incs) +RISCV_LINK_MT ?= $(RISCV_GCC) -T $(src_dir)/common/test-mt.ld RISCV_LINK_OPTS ?= -nostdlib -nostartfiles -ffast-math -lc -lgcc RISCV_OBJDUMP ?= $(RISCV_PREFIX)objdump --disassemble-all --disassemble-zeroes --section=.text --section=.text.startup --section=.data RISCV_SIM ?= spike -VPATH += $(addprefix $(bmarkdir)/, $(bmarks)) -VPATH += $(bmarkdir)/common +VPATH += $(addprefix $(src_dir)/, $(bmarks)) +VPATH += $(src_dir)/common -incs += -I$(bmarkdir)/../env -I$(bmarkdir)/common $(addprefix -I$(bmarkdir)/, $(bmarks)) +incs += -I$(src_dir)/../env -I$(src_dir)/common $(addprefix -I$(src_dir)/, $(bmarks)) objs := -include $(patsubst %, $(bmarkdir)/%/bmark.mk, $(bmarks)) +include $(patsubst %, $(src_dir)/%/bmark.mk, $(bmarks)) #------------------------------------------------------------ # Build and run benchmarks on riscv simulator diff --git a/isa/Makefile b/isa/Makefile index 415778e..d5b0b76 100644 --- a/isa/Makefile +++ b/isa/Makefile @@ -2,15 +2,15 @@ # Makefile for riscv-tests/isa #----------------------------------------------------------------------- -isa_src_dir := . +src_dir := . -include $(isa_src_dir)/rv64ui/Makefrag -include $(isa_src_dir)/rv64uf/Makefrag -include $(isa_src_dir)/rv64si/Makefrag -include $(isa_src_dir)/rv64mi/Makefrag -include $(isa_src_dir)/rv32ui/Makefrag -include $(isa_src_dir)/rv32si/Makefrag -include $(isa_src_dir)/rv32mi/Makefrag +include $(src_dir)/rv64ui/Makefrag +include $(src_dir)/rv64uf/Makefrag +include $(src_dir)/rv64si/Makefrag +include $(src_dir)/rv64mi/Makefrag +include $(src_dir)/rv32ui/Makefrag +include $(src_dir)/rv32si/Makefrag +include $(src_dir)/rv32mi/Makefrag default: all @@ -26,7 +26,7 @@ RISCV_OBJDUMP ?= $(RISCV_PREFIX)objdump --disassemble-all --disassemble-zeroes - RISCV_SIM ?= spike XLEN ?= 64 -vpath %.S $(isa_src_dir) +vpath %.S $(src_dir) #------------------------------------------------------------ # Build assembly tests @@ -46,19 +46,19 @@ vpath %.S $(isa_src_dir) define compile_template $$($(1)_p_tests): $(1)-p-%: $(1)/%.S - $$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) -I$(isa_src_dir)/../env/p -I$(isa_src_dir)/macros/scalar -T$(isa_src_dir)/../env/p/link.ld $$< -o $$@ + $$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) -I$(src_dir)/../env/p -I$(src_dir)/macros/scalar -T$(src_dir)/../env/p/link.ld $$< -o $$@ $(1)_tests += $$($(1)_p_tests) $$($(1)_pt_tests): $(1)-pt-%: $(1)/%.S - $$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) -I$(isa_src_dir)/../env/pt -I$(isa_src_dir)/macros/scalar -T$(isa_src_dir)/../env/pt/link.ld $$< -o $$@ + $$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) -I$(src_dir)/../env/pt -I$(src_dir)/macros/scalar -T$(src_dir)/../env/pt/link.ld $$< -o $$@ $(1)_tests += $$($(1)_pt_tests) $$($(1)_pm_tests): $(1)-pm-%: $(1)/%.S - $$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) -I$(isa_src_dir)/../env/pm -I$(isa_src_dir)/macros/scalar -T$(isa_src_dir)/../env/pm/link.ld $$< -o $$@ + $$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) -I$(src_dir)/../env/pm -I$(src_dir)/macros/scalar -T$(src_dir)/../env/pm/link.ld $$< -o $$@ $(1)_tests += $$($(1)_pm_tests) $$($(1)_v_tests): $(1)-v-%: $(1)/%.S - $$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) -std=gnu99 -O2 -I$(isa_src_dir)/../env/v -I$(isa_src_dir)/macros/scalar -T$(isa_src_dir)/../env/v/link.ld $(isa_src_dir)/../env/v/entry.S $(isa_src_dir)/../env/v/vm.c $$< -lc -o $$@ + $$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) -std=gnu99 -O2 -I$(src_dir)/../env/v -I$(src_dir)/macros/scalar -T$(src_dir)/../env/v/link.ld $(src_dir)/../env/v/entry.S $(src_dir)/../env/v/vm.c $$< -lc -o $$@ $(1)_tests += $$($(1)_v_tests) $(1)_tests_dump = $$(addsuffix .dump, $$($(1)_tests))