Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Computer_architecture_project1
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
lang0909
Computer_architecture_project1
Commits
b979da33
Commit
b979da33
authored
5 years ago
by
lang0909
Browse files
Options
Downloads
Patches
Plain Diff
Add Makefile
parent
50e249fb
No related branches found
No related tags found
No related merge requests found
Pipeline
#2147
canceled
5 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Makefile
+50
-0
50 additions, 0 deletions
Makefile
with
50 additions
and
0 deletions
Makefile
0 → 100644
+
50
−
0
View file @
b979da33
CC
=
gcc
TAR
=
assembler
all
:
assembler
%.o
:
%.c
$(
CC
)
-c
$^
$(TAR)
:
assembler.o
$(
CC
)
-o
$@
$^
.PHONY
:
clean test help
clean
:
rm
-rf
*
.o
$(
TAR
)
help
:
@
echo
"The following options are provided with Make
\n\t
$$
make
\t\t
# build assembler
\n\t
$$
make clean
\t
# clean the build
\n\t
$$
make test
\t
# test cases"
test
:
assembler test_1 test_2 test_3 test_4 test_5
test_1
:
./assembler sample_input/example1.s
@
echo
"Testing example1"
;
\
diff
-Naur
sample_input/example1.o sample_output/example1.o
;
\
if
[
$$
?
-eq
0
]
;
then
echo
"
\t
Test seems correct
\n
"
;
else
echo
"
\t
Results not identical, check the diff output
\n
"
;
fi
test_2
:
./assembler sample_input/example2_mod.s
@
echo
"Testing example2_mod"
;
\
diff
-Naur
sample_input/example2_mod.o sample_output/example2_mod.o
;
\
if
[
$$
?
-eq
0
]
;
then
echo
"
\t
Test seems correct
\n
"
;
else
echo
"
\t
Results not identical, check the diff output
\n
"
;
fi
test_3
:
./assembler sample_input/example3.s
@
echo
"Testing example3"
;
\
diff
-Naur
sample_input/example3.o sample_output/example3.o
;
\
if
[
$$
?
-eq
0
]
;
then
echo
"
\t
Test seems correct
\n
"
;
else
echo
"
\t
Results not identical, check the diff output
\n
"
;
fi
test_4
:
./assembler sample_input/example4.s
@
echo
"Testing example4"
;
\
diff
-Naur
sample_input/example4.o sample_output/example4.o
;
\
if
[
$$
?
-eq
0
]
;
then
echo
"
\t
Test seems correct
\n
"
;
else
echo
"
\t
Results not identical, check the diff output
\n
"
;
fi
test_5
:
./assembler sample_input/example5.s
@
echo
"Testing example5"
;
\
diff
-Naur
sample_input/example5.o sample_output/example5.o
;
\
if
[
$$
?
-eq
0
]
;
then
echo
"
\t
Test seems correct
\n
"
;
else
echo
"
\t
Results not identical, check the diff output"
;
fi
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