From 6c19a775f909f517681645ddbe8cab52fe37af1e Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Fri, 19 Apr 2013 23:33:40 -0700 Subject: [PATCH] remove circular dependence in Makefile Thanks, Sebastien! --- Makefile.in | 6 ++++-- riscv/riscv.mk.in | 12 ++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Makefile.in b/Makefile.in index 6c822f1..749062b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -294,7 +294,9 @@ deps += $$($(2)_deps) test_outs += $$($(2)_test_outs) -install_hdrs += $$(addprefix $(src_dir)/$(1)/, $$($(2)_hdrs)) +vpath %.h $$(src_dir)/$$(1) + +install_hdrs += $$($(2)_hdrs) install_libs += lib$(1).a install_exes += $$($(2)_install_prog_exes) @@ -329,7 +331,7 @@ check : $(test_outs) install-hdrs : $(install_hdrs) $(MKINSTALLDIRS) $(install_hdrs_dir) - for file in $(install_hdrs); \ + for file in $^; \ do \ $(INSTALL_HDR) $$file $(install_hdrs_dir); \ done diff --git a/riscv/riscv.mk.in b/riscv/riscv.mk.in index b3f8598..5405ba1 100644 --- a/riscv/riscv.mk.in +++ b/riscv/riscv.mk.in @@ -2,7 +2,7 @@ riscv_subproject_deps = \ softfloat_riscv \ softfloat \ -riscv_hdrs = \ +repo_hdrs := \ htif.h \ common.h \ decode.h \ @@ -12,10 +12,14 @@ riscv_hdrs = \ trap.h \ opcodes.h \ insn_header.h \ - dispatch.h \ cachesim.h \ memtracer.h \ +riscv_hdrs := \ + $(repo_hdrs) \ + dispatch.h + + NDISPATCH := 10 DISPATCH_SRCS := \ dispatch0.cc \ @@ -30,10 +34,10 @@ DISPATCH_SRCS := \ dispatch9.cc \ dispatch10.cc \ -$(DISPATCH_SRCS): %.cc: dispatch $(wildcard insns/*.h) $(riscv_hdrs) +$(DISPATCH_SRCS): %.cc: dispatch $(wildcard insns/*.h) $(riscv_hdrs) $< $(subst dispatch,,$(subst .cc,,$@)) $(NDISPATCH) 1024 < $(src_dir)/riscv/opcodes.h > $@ -dispatch.h: %.h: dispatch $(riscv_hdrs) +dispatch.h: %.h: dispatch $(repo_hdrs) $< $(NDISPATCH) 1024 < $(src_dir)/riscv/opcodes.h > $@ riscv_srcs = \ -- 2.30.2