Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
relibc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Peter Limkilde Svendsen
relibc
Commits
3a5a7b33
Verified
Commit
3a5a7b33
authored
5 years ago
by
Jeremy Soller
Browse files
Options
Downloads
Patches
Plain Diff
Support for native relibc compilation of tests
parent
d6d01e56
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/Makefile
+23
-16
23 additions, 16 deletions
tests/Makefile
with
23 additions
and
16 deletions
tests/Makefile
+
23
−
16
View file @
3a5a7b33
SYSROOT
?=
../sysroot
# Binaries that should generate the same output every time
# Binaries that should generate the same output every time
EXPECT_NAMES
=
\
EXPECT_NAMES
=
\
alloca
\
alloca
\
...
@@ -130,14 +128,14 @@ all: $(BINS)
...
@@ -130,14 +128,14 @@ all: $(BINS)
clean
:
clean
:
rm
-rf
bins gen
*
.out
rm
-rf
bins gen
*
.out
run
:
|
$(SYSROOT)
$(BINS)
run
:
| $(BINS)
for
name
in
$(
NAMES
);
\
for
name
in
$(
NAMES
);
\
do
\
do
\
echo
"#
$${
name
}
#"
;
\
echo
"#
$${
name
}
#"
;
\
"bins/
$${
name
}
"
test
args
||
exit
$$
?
;
\
"bins/
$${
name
}
"
test
args
||
exit
$$
?
;
\
done
done
expected
:
|
$(SYSROOT)
$(EXPECT_BINS)
expected
:
| $(EXPECT_BINS)
rm
-rf
expected
rm
-rf
expected
mkdir
-p
expected
mkdir
-p
expected
for
name
in
$(
EXPECT_NAMES
);
\
for
name
in
$(
EXPECT_NAMES
);
\
...
@@ -147,7 +145,7 @@ expected: | $(SYSROOT) $(EXPECT_BINS)
...
@@ -147,7 +145,7 @@ expected: | $(SYSROOT) $(EXPECT_BINS)
"bins/
$${
name
}
"
test
args
>
"expected/
$${
name
}
.stdout"
2>
"expected/
$${
name
}
.stderr"
||
exit
$$
?
;
\
"bins/
$${
name
}
"
test
args
>
"expected/
$${
name
}
.stdout"
2>
"expected/
$${
name
}
.stderr"
||
exit
$$
?
;
\
done
done
verify
:
|
$(SYSROOT)
$(EXPECT_BINS)
verify
:
| $(EXPECT_BINS)
rm
-rf
gen
rm
-rf
gen
mkdir
-p
gen
mkdir
-p
gen
for
name
in
$(
EXPECT_NAMES
);
\
for
name
in
$(
EXPECT_NAMES
);
\
...
@@ -167,22 +165,31 @@ CFLAGS=\
...
@@ -167,22 +165,31 @@ CFLAGS=\
-Wall
\
-Wall
\
-pedantic
\
-pedantic
\
-g
\
-g
\
-nostdinc
\
-nostdlib
\
-isystem
$(
SYSROOT
)
/include
\
-I
.
-I
.
HEADLIBS
=
\
LIBS
=
$(
SYSROOT
)
/lib/crt0.o
\
$(
SYSROOT
)
/lib/crti.o
TAILLIBS
=
\
NATIVE_RELIBC
?=
0
$(
SYSROOT
)
/lib/libc.a
\
ifeq
($(NATIVE_RELIBC),0)
$(
SYSROOT
)
/lib/crtn.o
CFLAGS
+=
\
-nostdinc
\
-nostdlib
\
-isystem
../sysroot/include
\
../sysroot/lib/crt0.o
\
../sysroot/lib/crti.o
LIBS
=
\
../sysroot/lib/libc.a
\
../sysroot/lib/crtn.o
../sysroot
:
../sysroot
:
$(
MAKE
)
-C
.. sysroot
$(
MAKE
)
-C
.. sysroot
bins/%
:
%.c $(SYSROOT)
bins/%
:
%.c ../sysroot
mkdir
-p
"
$$(
dirname "
$@
"
)
"
$(
CC
)
$(
CFLAGS
)
"
$<
"
$(
LIBS
)
-o
"
$@
"
else
bins/%
:
%.c
mkdir
-p
"
$$(
dirname "
$@
"
)
"
mkdir
-p
"
$$(
dirname "
$@
"
)
"
$(
CC
)
$(
CFLAGS
)
$(
HEADLIBS
)
"
$<
"
$(
TAILLIBS
)
-o
"
$@
"
$(
CC
)
$(
CFLAGS
)
"
$<
"
$(
LIBS
)
-o
"
$@
"
endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment