URL
https://opencores.org/ocsvn/minsoc/minsoc/trunk
Subversion Repositories minsoc
Compare Revisions
- This comparison shows the changes necessary to convert path
/minsoc/trunk/sw/support
- from Rev 80 to Rev 74
- ↔ Reverse comparison
Rev 80 → Rev 74
/reset.S
1,6 → 1,6
/* Support file for c based tests */ |
#include "or1200.h" |
#include <board.h> |
#include "../../backend/board.h" |
|
.section .stack |
.space STACK_SIZE |
/common.mk
0,0 → 1,21
$(LIB_SUPPORT): $(SUPPORT_DIR)/support.o $(SUPPORT_DIR)/tick.o $(SUPPORT_DIR)/int.o |
$(OR32_TOOL_PREFIX)-ar cru $(SUPPORT_DIR)/libsupport.a $(SUPPORT_DIR)/support.o $(SUPPORT_DIR)/tick.o $(SUPPORT_DIR)/int.o |
$(OR32_TOOL_PREFIX)-ranlib $(SUPPORT_DIR)/libsupport.a |
|
$(SUPPORT_DIR)/support.o: $(SUPPORT_DIR)/support.c $(OR1200_HDR) $(SUPPORT_HDR) $(SUPPORT_DIR)/int.h $(UART_HDR) |
$(OR32_TOOL_PREFIX)-gcc $(GCC_OPT) -c -o $@ $< |
|
$(SUPPORT_DIR)/tick.o: $(SUPPORT_DIR)/tick.c $(OR1200_HDR) $(SUPPORT_HDR) $(SUPPORT_DIR)/tick.h |
$(OR32_TOOL_PREFIX)-gcc $(GCC_OPT) -c -o $@ $< |
|
$(SUPPORT_DIR)/int.o: $(SUPPORT_DIR)/int.c $(SUPPORT_HDR) $(OR1200_HDR) $(SUPPORT_DIR)/int.h |
$(OR32_TOOL_PREFIX)-gcc $(GCC_OPT) -c -o $@ $< |
|
$(EXCPT_HNDLR): $(SUPPORT_DIR)/except.S $(OR1200_HDR) |
$(OR32_TOOL_PREFIX)-gcc $(GCC_OPT) -c -o $@ $< |
|
$(RESET_NOCACHE): $(SUPPORT_DIR)/reset.S $(OR1200_HDR) $(BOARD_HDR) |
$(OR32_TOOL_PREFIX)-gcc $(GCC_OPT) -c -DIC=0 -DDC=0 -o $@ $< |
|
$(RESET_ICDC): $(SUPPORT_DIR)/reset.S $(OR1200_HDR) $(BOARD_HDR) |
$(OR32_TOOL_PREFIX)-gcc $(GCC_OPT) -c -DIC=1 -DDC=1 -o $@ $< |
common.mk
Property changes :
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: Makefile.inc
===================================================================
--- Makefile.inc (revision 80)
+++ Makefile.inc (revision 74)
@@ -7,7 +7,19 @@
DRIVERS_DIR := $(ROOTDIR)/drivers
UTILS_DIR := $(ROOTDIR)/utils
-SUPPORT := $(SUPPORT_DIR)/libsupport.a
+OR1200_HDR := $(SUPPORT_DIR)/or1200.h
+BOARD_HDR := $(BACKEND_DIR)/board.h
+SUPPORT_HDR := $(SUPPORT_DIR)/support.h
+UART_HDR := $(DRIVERS_DIR)/uart.h
+ETH_HDR := $(DRIVERS_DIR)/eth.h
+
+RESET_NOCACHE := $(SUPPORT_DIR)/reset-nocache.o
+RESET_ICDC := $(SUPPORT_DIR)/reset-icdc.o
+
+EXCPT_HNDLR := $(SUPPORT_DIR)/except.o
+LIB_SUPPORT := $(SUPPORT_DIR)/libsupport.a
+
+SUPPORT := $(EXCPT_HNDLR) $(LIB_SUPPORT)
DRIVERS := $(DRIVERS_DIR)/libdrivers.a
LINKER_SCRIPT := $(BACKEND_DIR)/orp.ld
@@ -14,8 +26,17 @@
OR32_TOOL_PREFIX=or32-elf
+include ../../backend/gcc-opt.mk
+
BIN2HEX = $(UTILS_DIR)/bin2hex
ifdef UART_PRINTF
GCC_OPT += -DUART_PRINTF
endif
+
+all: all_internal
+
+# Global clean rule
+clean:
+ @echo "Cleaning `pwd`"
+ @rm -f *.o *.or32 *.log *.bin *.srec *.hex *.log stdout.txt *.vmem *.asm *.a stdout.txt
\ No newline at end of file
/Makefile
1,135 → 1,5
include ../support/Makefile.inc |
include $(BACKEND_DIR)/gcc-opt.mk |
include Makefile.inc |
|
#USER INPUT |
SRCS = reset.S except.S tick.c support.c int.c |
OR32_TARGET = |
TARGET = |
TARGETLIB = support |
MODEL = static #dynamic|static |
VERSION = 0.1 |
MODE = debug #release|debug |
all_internal: $(RESET_NOCACHE) $(RESET_ICDC) $(EXCPT_HNDLR) $(LIB_SUPPORT) |
|
INCLUDEDIRS = $(BACKEND_DIR) $(DRIVERS_DIR) |
#libsystemc or systemc (system ignores lib at the beginning) |
LIBNAMES = |
LIBDIRS = |
DEPENDDIR = ./depend |
|
|
#CONFIGURATION |
DEBUGPARAM = |
RELEASEPARAM = |
|
DEBUGFLAGS = -g -O0 |
RELEASEFLAGS = -O2 -fomit-frame-pointer |
|
CFLAGS = -Wall |
CC = or32-elf-gcc |
AR = or32-elf-ar |
RANLIB = or32-elf-ranlib |
|
CFLAGS += $(GCC_OPT) |
|
|
#MECHANICS |
INCLUDESPATH = $(addprefix -I, $(INCLUDEDIRS)) |
LIBSPATH = $(addprefix -L, $(LIBDIRS)) |
LIBSLINKAGE = $(addprefix -l, $(subst lib, , $(LIBNAMES)) ) |
COMMA = , |
RPATH = $(addprefix -Wl$(COMMA)-R, $(LIBDIRS)) |
|
OBJS = $(addsuffix .o, $(basename $(SRCS))) |
DEPS = $(addprefix $(DEPENDDIR)/, $(addsuffix .d, $(basename $(SRCS) ) ) ) |
|
STATICLIB = $(addprefix lib, $(addsuffix .a, $(TARGETLIB) ) ) |
DYNAMICLIB = $(addprefix lib, $(addsuffix .so, $(TARGETLIB) ) ) |
SONAME = $(addsuffix .$(VERSION), $(DYNAMICLIB)) |
|
ifeq (debug,$(findstring debug, $(MODE))) |
CFLAGS += $(DEBUGFLAGS) $(addprefix -D, $(DEBUGPARAM)) |
else |
CFLAGS += $(RELEASEFLAGS) $(addprefix -D, $(RELEASEPARAM)) |
endif |
|
ifdef TARGETLIB |
ifeq (dynamic,$(findstring dynamic, $(MODEL))) |
TARGET = $(DYNAMICLIB) |
CFLAGS += -fPIC |
else |
TARGET = $(STATICLIB) |
endif |
endif |
|
|
#MAKEFILE RULES |
all: $(TARGET) $(OR32_TARGET) |
|
depend: $(DEPS) |
|
docs: Doxyfile |
doxygen |
|
distclean: |
make clean |
rm -rf $(DEPENDDIR) Doxygen |
|
|
-include $(DEPS) |
|
|
ifndef TARGETLIB |
$(TARGET): $(OBJS) |
$(CC) $(LIBSPATH) $(RPATH) -o $@ $^ $(LIBSLINKAGE) |
endif |
|
|
$(STATICLIB): $(OBJS) |
$(AR) cru $@ $^ |
$(RANLIB) $@ |
|
$(DYNAMICLIB): $(OBJS) |
$(CC) -shared -Wl,-soname,$(SONAME) -o $@ $^ |
ln -fs $@ $(SONAME) |
|
|
%.o: %.c |
$(CC) $(CFLAGS) $(INCLUDESPATH) -c $< -o $@ |
|
|
$(DEPENDDIR)/%.d: %.c |
mkdir -p $(DEPENDDIR) |
$(CC) $(INCLUDESPATH) -MM -MF $@ $< |
|
|
# DO NOT DELETE |
|
STEM = $(subst .hex, , $(OR32_TARGET)) |
BINARY = $(addsuffix .bin, $(STEM) ) |
EXECUTABLE = $(addsuffix .or32, $(STEM) ) |
|
$(OR32_TARGET): $(BINARY) |
$(BIN2HEX) $? 1 -size_word > $@ |
|
$(BINARY): $(EXECUTABLE) |
$(OR32_TOOL_PREFIX)-objcopy -O binary $? $@ |
|
#except.o and reset.o should be already inside of $(SUPPORT) (libsupport.a) but for some reason the compiler ignores that fact |
#(e.g. or32-elf-objdump -t libsupport.a shows it) |
$(EXECUTABLE): $(OBJS) ../support/except.o ../support/reset.o $(SUPPORT) $(DRIVERS) |
$(CC) $(CFLAGS) $(GCC_LIB_OPTS) -T $(LINKER_SCRIPT) $^ -o $@ |
|
clean: |
rm -f *.o *~ $(TARGET) $(STATICLIB) $(DYNAMICLIB) $(SONAME) $(OR32_TARGET) $(BINARY) $(EXECUTABLE) |
|
#EOF |
|
#SUPPORT SPECIFIC |
|
%.o: %.S |
$(CC) $(CFLAGS) $(INCLUDESPATH) -c -o $@ $< |
|
reset.o: reset.S |
$(CC) $(CFLAGS) $(INCLUDESPATH) -c -DIC=0 -DDC=0 -o $@ $< |
|
#~SUPPORT SPECIFIC |
include common.mk |
/support.c
9,7 → 9,7
#include "int.h" |
|
#ifdef UART_PRINTF |
#include <uart.h> |
#include "../drivers/uart.h" |
#endif |
|
#if OR32 |