summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2015-08-16 21:15:07 +0200
committerClifford Wolf <clifford@clifford.at>2015-08-16 21:15:07 +0200
commitaedcfd6fd3ea99d9d418b81d376590bdb00c2c5c (patch)
treeaa1fc8ef23397a367a08fcb204b91b12b1a89799
parentd5b1a90b33458616c9c002062330c5420335ed31 (diff)
Fixed Makefile rules for generated share files
-rw-r--r--Makefile7
-rw-r--r--techlibs/ice40/Makefile.inc7
-rw-r--r--techlibs/xilinx/Makefile.inc8
3 files changed, 20 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 30087380..0aff340b 100644
--- a/Makefile
+++ b/Makefile
@@ -195,6 +195,13 @@ $(subst //,/,$(1)/$(notdir $(2))): $(2)
$$(Q) cp "$(YOSYS_SRC)"/$(2) $(subst //,/,$(1)/$(notdir $(2)))
endef
+define add_gen_share_file
+EXTRA_TARGETS += $(subst //,/,$(1)/$(notdir $(2)))
+$(subst //,/,$(1)/$(notdir $(2))): $(2)
+ $$(P) mkdir -p $(1)
+ $$(Q) cp $(2) $(subst //,/,$(1)/$(notdir $(2)))
+endef
+
define add_include_file
$(eval $(call add_share_file,$(dir share/include/$(1)),$(1)))
endef
diff --git a/techlibs/ice40/Makefile.inc b/techlibs/ice40/Makefile.inc
index 6907f0a0..d7fec568 100644
--- a/techlibs/ice40/Makefile.inc
+++ b/techlibs/ice40/Makefile.inc
@@ -11,7 +11,8 @@ EXTRA_OBJS += techlibs/ice40/brams_init.mk
.SECONDARY: techlibs/ice40/brams_init.mk
techlibs/ice40/brams_init.mk: techlibs/ice40/brams_init.py
- $(P) cd share/ice40 && python $<
+ $(Q) mkdir -p techlibs/ice40
+ $(P) cd techlibs/ice40 && python $<
$(Q) touch techlibs/ice40/brams_init.mk
techlibs/ice40/brams_init1.vh: techlibs/ice40/brams_init.mk
@@ -24,3 +25,7 @@ $(eval $(call add_share_file,share/ice40,techlibs/ice40/cells_sim.v))
$(eval $(call add_share_file,share/ice40,techlibs/ice40/brams.txt))
$(eval $(call add_share_file,share/ice40,techlibs/ice40/brams_map.v))
+$(eval $(call add_gen_share_file,share/ice40,techlibs/ice40/brams_init1.vh))
+$(eval $(call add_gen_share_file,share/ice40,techlibs/ice40/brams_init2.vh))
+$(eval $(call add_gen_share_file,share/ice40,techlibs/ice40/brams_init3.vh))
+
diff --git a/techlibs/xilinx/Makefile.inc b/techlibs/xilinx/Makefile.inc
index c6cf1a7d..29d3fe9d 100644
--- a/techlibs/xilinx/Makefile.inc
+++ b/techlibs/xilinx/Makefile.inc
@@ -10,7 +10,8 @@ EXTRA_OBJS += techlibs/xilinx/brams_init.mk
.SECONDARY: techlibs/xilinx/brams_init.mk
techlibs/xilinx/brams_init.mk: techlibs/xilinx/brams_init.py
- $(P) cd share/xilinx && python $<
+ $(Q) mkdir -p techlibs/xilinx
+ $(P) cd techlibs/xilinx && python $<
$(Q) touch $@
techlibs/xilinx/brams_init_36.vh: techlibs/xilinx/brams_init.mk
@@ -28,3 +29,8 @@ $(eval $(call add_share_file,share/xilinx,techlibs/xilinx/drams_map.v))
$(eval $(call add_share_file,share/xilinx,techlibs/xilinx/drams_bb.v))
$(eval $(call add_share_file,share/xilinx,techlibs/xilinx/arith_map.v))
+$(eval $(call add_gen_share_file,share/xilinx,techlibs/xilinx/brams_init_36.vh))
+$(eval $(call add_gen_share_file,share/xilinx,techlibs/xilinx/brams_init_32.vh))
+$(eval $(call add_gen_share_file,share/xilinx,techlibs/xilinx/brams_init_18.vh))
+$(eval $(call add_gen_share_file,share/xilinx,techlibs/xilinx/brams_init_16.vh))
+