$$(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
.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
$(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))
+
.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
$(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))
+