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
caba116b
Commit
caba116b
authored
Apr 09, 2018
by
Adam Wujek
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw:rt: autogenerate dependencies
Signed-off-by:
Adam Wujek
<
adam.wujek@cern.ch
>
parent
ccbced2d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
3 deletions
+20
-3
Makefile
software/rt/Makefile
+20
-3
No files found.
software/rt/Makefile
View file @
caba116b
...
...
@@ -20,6 +20,13 @@ LDFLAGS += -lgcc -lc -Wl,--gc-sections
vpath
%.c
$(TRTL)/software/rt
vpath
%.S
$(TRTL)/software/rt
# auto dependency generation from
# http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/
DEPDIR
:=
.d
$(shell
mkdir
-p
$(DEPDIR)
>/dev/null)
DEPFLAGS
=
-MT
$@
-MMD
-MP
-MF
$(DEPDIR)
/
$*
.Td
POSTCOMPILE
=
mv
-f
$(DEPDIR)
/
$*
.Td
$(DEPDIR)
/
$*
.d
&&
touch
$@
CC
=
$(CROSS_COMPILE_TARGET)
gcc
LD
=
$(CROSS_COMPILE_TARGET)
ld
...
...
@@ -116,6 +123,7 @@ endif
# create dirs for object files
$(OBJDIR)
:
mkdir
-p
$@
mkdir
-p
$(DEPDIR)
/
$@
$(OBJS)
:
| $(OBJDIR)
...
...
@@ -127,18 +135,27 @@ $(OUTPUT).bin: $(OUTPUT).elf | check-def
$(SIZE)
$(OUTPUT)
.elf
urv/emulate.o
:
urv/emulate.c
${
CC
}
$(CFLAGS)
-march
=
rv32i
-c
$^
-o
$@
${
CC
}
$(DEPFLAGS)
$(CFLAGS)
-march
=
rv32i
-c
$^
-o
$@
$(POSTCOMPILE)
%.o
:
%.c
${
CC
}
$(CFLAGS)
$(LDFLAGS)
-c
$^
-o
$@
${
CC
}
$(DEPFLAGS)
$(CFLAGS)
$(LDFLAGS)
-c
$<
-o
$@
$(POSTCOMPILE)
%.o
:
%.S
${
CC
}
$(CFLAGS)
$(LDFLAGS)
-c
$^
-o
$@
${
CC
}
$(DEPFLAGS)
$(CFLAGS)
$(LDFLAGS)
-c
$^
-o
$@
$(POSTCOMPILE)
clean
:
@
rm
-rf
$(OBJDIR)
@
rm
-f
$(OBJS)
$(OUTPUT)
.bin
$(OUTPUT)
.elf
@
rm
-rf
$(DEPDIR)
install
:
@
cp
$(OUTPUT)
.bin
$(INSTALL_PREFIX)
$(DEPDIR)/%.d
:
;
.PRECIOUS
:
$(DEPDIR)/%.d
include
$(wildcard
$(patsubst
%,$(DEPDIR)/%.d,$(basename
$(OBJS))))
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