Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
Mock Turtle
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Mock Turtle
Commits
ccbced2d
Commit
ccbced2d
authored
Apr 09, 2018
by
Adam Wujek
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw:rt: regenerate .h files if .wb changed
Signed-off-by:
Adam Wujek
<
adam.wujek@cern.ch
>
parent
c5d24f15
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
14 deletions
+23
-14
Makefile
software/rt/Makefile
+23
-14
No files found.
software/rt/Makefile
View file @
ccbced2d
...
...
@@ -5,6 +5,8 @@ INSTALL_PREFIX ?= .
PATH_COMMON_RT
?=
.
PATH_COMMON_H
?=
../include
TRTL
?=
../../
TRTL_SW
?=
$(TRTL)
/software
TRTL_HDL
?=
$(TRTL)
/hdl/rtl
RT_GIT_VERSION
=
0x
$(
shell
git rev-parse
--short
=
8 HEAD
)
...
...
@@ -86,35 +88,43 @@ endif
MOCKTURTLE_LDSCRIPT
?=
$(TRTL)
/software/rt/urv/mockturtle.ld
all
:
post-build
.PHONY
:
all clean check-def
headers
:
check-def
@
make
-C
$(TRTL_SW)
$@
all
:
$(OUTPUT).bin
WBGEN_FILES
=
mt_cpu_csr.wb mt_cpu_lr.wb
WBGEN_HEADERS
=
mockturtle_cpu_csr.h mockturtle_cpu_lr.h
# .wb files should simply be there. This is used to check against the changes
$(addprefix $(TRTL_HDL)/cpu/,$(WBGEN_FILES))
:
# dependencies between .h and .wb files
$(TRTL_SW)/include/hw/mockturtle_cpu_csr.h
:
$(TRTL_HDL)/cpu/mt_cpu_csr.wb
$(TRTL_SW)/include/hw/mockturtle_cpu_lr.h
:
$(TRTL_HDL)/cpu/mt_cpu_lr.wb
# target to let wbgen2 to generate headers
$(addprefix $(TRTL_SW)/include/hw/,$(WBGEN_HEADERS))
:
| check-def
make
-C
$(TRTL_SW)
headers
# check needed env variables
check-def
:
ifndef
OUTPUT
@echo
"OUTPUT variable is mandatory"
@exit
1
endif
ifndef
TRTL_SW
@echo
"TRTL_SW variable is mandatory"
@exit
1
endif
# create dirs for object files
$(OBJDIR)
:
mkdir
-p
$@
$(OBJS)
:
| $(OBJDIR)
pre-build
:
check-def headers
post-build
:
$(OUTPUT) pre-build
$(SIZE)
$(OUTPUT)
.elf
$(OUTPUT)
:
pre-build $(MOCKTURTLE_LDSCRIPT) $(OBJS)
$(OUTPUT).elf
:
$(addprefix $(TRTL_SW)/include/hw/
,
$(WBGEN_HEADERS)) $(MOCKTURTLE_LDSCRIPT) $(OBJS) | check-def
${
CC
}
$(CFLAGS)
$(LDFLAGS)
-o
$(OUTPUT)
.elf
-nostartfiles
$(OBJS)
-T
$(MOCKTURTLE_LDSCRIPT)
$(OUTPUT).bin
:
$(OUTPUT).elf | check-def
${
OBJCOPY
}
--remove-section
.smem
-O
binary
$(OUTPUT)
.elf
$(OUTPUT)
.bin
$(SIZE)
$(OUTPUT)
.elf
urv/emulate.o
:
urv/emulate.c
${
CC
}
$(CFLAGS)
-march
=
rv32i
-c
$^
-o
$@
...
...
@@ -132,4 +142,3 @@ clean:
install
:
@
cp
$(OUTPUT)
.bin
$(INSTALL_PREFIX)
.PHONY
:
all clean pre-build post-build headers
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment