Line 27... |
Line 27... |
#### Public License along with this source; if not, download it ####
|
#### Public License along with this source; if not, download it ####
|
#### from http://www.opencores.org/lgpl.shtml ####
|
#### from http://www.opencores.org/lgpl.shtml ####
|
#### ####
|
#### ####
|
######################################################################
|
######################################################################
|
|
|
DESIGN_NAME ?=orpsoc
|
|
|
|
OR32_TOOL_PREFIX=or32-elf-
|
OR32_TOOL_PREFIX=or32-elf-
|
|
|
OR32_LD=$(OR32_TOOL_PREFIX)ld
|
OR32_LD=$(OR32_TOOL_PREFIX)ld
|
OR32_AS=$(OR32_TOOL_PREFIX)as
|
OR32_AS=$(OR32_TOOL_PREFIX)as
|
OR32_CC=$(OR32_TOOL_PREFIX)gcc
|
OR32_CC=$(OR32_TOOL_PREFIX)gcc
|
Line 44... |
Line 42... |
# SW_ROOT should be set by whatever is running this
|
# SW_ROOT should be set by whatever is running this
|
|
|
# Special case for CPU drivers
|
# Special case for CPU drivers
|
CPU_DRIVER ?=$(SW_ROOT)/drivers/or1200
|
CPU_DRIVER ?=$(SW_ROOT)/drivers/or1200
|
|
|
# If BOARD_PATH is set, we'll first scan that path for which drivers they have
|
DESIGN_NAME ?=orpsoc
|
|
|
|
# If BOARD is set, we'll first scan that path for which drivers they have
|
# and will override any locally named driver directories here.
|
# and will override any locally named driver directories here.
|
ifdef BOARD
|
ifdef BOARD
|
BOARD_PATH=$(SW_ROOT)/../boards/$(BOARD)
|
BOARD_PATH=$(SW_ROOT)/../boards/$(BOARD)
|
#$(info BOARD is being used: $(BOARD_PATH))
|
|
|
ifeq ($(V), 1)
|
|
$(info BOARD is set to : $(BOARD_PATH))
|
|
endif
|
|
|
BOARD_SPECIFIC_DRIVERS=$(shell if [ -e \
|
BOARD_SPECIFIC_DRIVERS=$(shell if [ -e \
|
$(BOARD_PATH)/sw/drivers ]; then \
|
$(BOARD_PATH)/sw/drivers ]; then \
|
ls $(BOARD_PATH)/sw/drivers; \
|
ls $(BOARD_PATH)/sw/drivers; \
|
fi)
|
fi)
|
BOARD_SW_TESTS=$(shell if [ -e $(BOARD_PATH)/sw/tests ]; then\
|
BOARD_SW_TESTS=$(shell if [ -e $(BOARD_PATH)/sw/tests ]; then\
|
ls $(BOARD_PATH)/sw/tests; \
|
ls $(BOARD_PATH)/sw/tests; \
|
fi)
|
fi)
|
|
|
|
# Set RTL_VERILOG_INCLUDE_DIR
|
|
RTL_VERILOG_INCLUDE_DIR=$(BOARD_PATH)/rtl/verilog/include
|
|
#We don't actually want this
|
|
#DESIGN_NAME ?=$(strip $(shell echo $(BOARD)| cut -d '/' -f 2))
|
|
|
endif
|
endif
|
|
|
COMMON_SW_DRIVERS=$(shell ls $(SW_ROOT)/drivers )
|
COMMON_SW_DRIVERS=$(shell ls $(SW_ROOT)/drivers )
|
COMMON_SW_DRIVERS_WITHOUT_BOARD_DRIVERS=$(filter-out $(BOARD_SPECIFIC_DRIVERS),$(COMMON_SW_DRIVERS))
|
COMMON_SW_DRIVERS_WITHOUT_BOARD_DRIVERS=$(filter-out $(BOARD_SPECIFIC_DRIVERS),$(COMMON_SW_DRIVERS))
|
|
|
Line 197... |
Line 207... |
$(OR32_LDFLAGS) -o $@
|
$(OR32_LDFLAGS) -o $@
|
|
|
%.elf: %.S $(ELF_DEPENDS) $(SUPPORT_LIBS)
|
%.elf: %.S $(ELF_DEPENDS) $(SUPPORT_LIBS)
|
$(Q)$(OR32_CC) $< $(ELF_DEPENDS) $(OR32_CFLAGS) $(OR32_LDFLAGS) -o $@
|
$(Q)$(OR32_CC) $< $(ELF_DEPENDS) $(OR32_CFLAGS) $(OR32_LDFLAGS) -o $@
|
|
|
%.o: %.S
|
%.o: %.S processed-verilog-headers
|
$(Q)$(OR32_CC) $(OR32_CFLAGS) -c $< -o $@
|
$(Q)$(OR32_CC) $(OR32_CFLAGS) -c $< -o $@
|
|
|
%.o: %.c
|
%.o: %.c processed-verilog-headers
|
$(Q)$(OR32_CC) $(OR32_CFLAGS) -c $< -o $@
|
$(Q)$(OR32_CC) $(OR32_CFLAGS) -c $< -o $@
|
|
|
COMPILE_SRCS_BASENAMES=$(basename $(COMPILE_SRCS))
|
COMPILE_SRCS_BASENAMES=$(basename $(COMPILE_SRCS))
|
COMPILE_OBJS=$(COMPILE_SRCS_BASENAMES:%=%.o)
|
COMPILE_OBJS=$(COMPILE_SRCS_BASENAMES:%=%.o)
|
|
|
$(DRIVER_OBJ): $(COMPILE_OBJS)
|
$(DRIVER_OBJ): $(COMPILE_OBJS)
|
$(Q)$(OR32_LD) $(OR32_ARFLAGS) $^ -o $@
|
$(Q)$(OR32_LD) $(OR32_ARFLAGS) $^ -o $@
|
|
|
# Rule to make all necessary driver objects
|
# Rule to make all necessary driver objects
|
|
|
$(ORPSOC_LIB): $(PROCESSED_DEFINES)
|
$(ORPSOC_LIB):
|
$(Q)echo; echo "\t### Building software support library ###"; echo
|
$(Q)echo; echo "\t### Building software support library ###"; echo
|
$(Q)$(MAKE) -C $(SW_ROOT)/lib liborpsoc.a
|
$(Q)$(MAKE) -C $(SW_ROOT)/lib liborpsoc.a
|
|
|
$(VECTORS_OBJ):
|
$(VECTORS_OBJ):
|
$(Q)$(MAKE) -C $(CPU_DRIVER) crt0.o
|
$(Q)$(MAKE) -C $(CPU_DRIVER) crt0.o
|