Skip to content

Commit

Permalink
Merge pull request IObundle#127 from JDLopes/master
Browse files Browse the repository at this point in the history
update hardware.mk to work with the new build-dir system
  • Loading branch information
jjts authored Jul 29, 2022
2 parents 6dd5120 + 6c0657b commit 5be2c5f
Showing 1 changed file with 28 additions and 23 deletions.
51 changes: 28 additions & 23 deletions hardware/hardware.mk
Original file line number Diff line number Diff line change
@@ -1,33 +1,38 @@
ifeq ($(filter UART, $(HW_MODULES)),)

include $(UART_DIR)/config.mk

#add itself to HW_MODULES list
HW_MODULES+=UART

UART_INC_DIR:=$(UART_HW_DIR)/include
UART_SRC_DIR:=$(UART_HW_DIR)/src

USE_NETLIST ?=0
#import lib hardware
include hardware/iob_reg/hardware.mk

#
# Headers
#

#import module
include $(LIB_DIR)/hardware/iob_reg/hardware.mk
#clk/rst interface
VHDR+=$(BUILD_VSRC_DIR)/iob_gen_if.vh
$(BUILD_VSRC_DIR)/iob_gen_if.vh: hardware/include/iob_gen_if.vh
cp $< $@

#include files
VHDR+=$(wildcard $(UART_INC_DIR)/*.vh)
VHDR+=iob_uart_swreg_gen.vh iob_uart_swreg_def.vh
VHDR+=$(LIB_DIR)/hardware/include/iob_lib.vh $(LIB_DIR)/hardware/include/iob_s_if.vh $(LIB_DIR)/hardware/include/iob_gen_if.vh
#IObundle native slave interface
VHDR+=$(BUILD_VSRC_DIR)/iob_gen_if.vh
$(BUILD_VSRC_DIR)/iob_s_if.vh: hardware/include/iob_s_if.vh
cp $< $@

#hardware include dirs
INCLUDE+=$(incdir). $(incdir)$(UART_INC_DIR) $(incdir)$(LIB_DIR)/hardware/include
VHDR+=$(BUILD_VSRC_DIR)/iob_uart_swreg_gen.vh
$(BUILD_VSRC_DIR)/iob_uart_swreg_gen.vh: iob_uart_swreg_gen.vh
cp $< $@

#sources
VSRC+=$(UART_SRC_DIR)/uart_core.v $(UART_SRC_DIR)/iob_uart.v
VHDR+=$(BUILD_VSRC_DIR)/iob_uart_swreg_def.vh
$(BUILD_VSRC_DIR)/iob_uart_swreg_def.vh: iob_uart_swreg_def.vh
cp $< $@

uart-hw-clean: uart-gen-clean
@rm -f *.v *.vh
#
# Sources
#

.PHONY: uart-hw-clean
VSRC+=$(BUILD_VSRC_DIR)/uart_core.v
$(BUILD_VSRC_DIR)/uart_core.v: $(UART_DIR)/hardware/src/uart_core.v
cp $< $@

endif
VSRC+=$(BUILD_VSRC_DIR)/iob_uart.v
$(BUILD_VSRC_DIR)/iob_uart.v: $(UART_DIR)/hardware/src/iob_uart.v
cp $< $@

0 comments on commit 5be2c5f

Please sign in to comment.