Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Worksheet
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
Package registry
Model registry
Operate
Environments
Terraform modules
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
Le10.Anh@live.uwe.ac.uk
Worksheet
Commits
da707927
Commit
da707927
authored
5 months ago
by
Le10.Anh@live.uwe.ac.uk
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
71e460b3
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Makefile.txt
+53
-0
53 additions, 0 deletions
src/Makefile.txt
with
53 additions
and
0 deletions
src/Makefile.txt
0 → 100644
+
53
−
0
View file @
da707927
# Tools
CC
=
gcc
ASM
=
nasm
CFLAGS
=
-m32
ASMFLAGS
=
-f
elf
# Source files
DRIVER
=
driver.c
ASM_SRC
=
task1.asm task2_1.asm task2_2.asm task2_3.asm
ASM_OBJ
=
$(
ASM_SRC:.asm
=
.o
)
ASM_IO
=
asm_io.asm
ASM_IO_OBJ
=
asm_io.o
# Executables
EXE1
=
task1
EXE2
=
task2_1
EXE3
=
task2_2
EXE4
=
task2_3
# Default target
all
:
$(EXE1) $(EXE2) $(EXE3) $(EXE4)
# Rule for task1
$(EXE1)
:
$(ASM_IO_OBJ) task1.o driver.o
$(
CC
)
$(
CFLAGS
)
$^
-o
$@
# Rule for task2_1
$(EXE2)
:
$(ASM_IO_OBJ) task2_1.o driver.o
$(
CC
)
$(
CFLAGS
)
$^
-o
$@
# Rule for task2_2
$(EXE3)
:
$(ASM_IO_OBJ) task2_2.o driver.o
$(
CC
)
$(
CFLAGS
)
$^
-o
$@
# Rule for task2_3
$(EXE4)
:
$(ASM_IO_OBJ) task2_3.o driver.o
$(
CC
)
$(
CFLAGS
)
$^
-o
$@
# Assemble asm_io.asm
$(ASM_IO_OBJ)
:
$(ASM_IO)
$(
ASM
)
$(
ASMFLAGS
)
$<
-o
$@
# Assemble .asm files
%.o
:
%.asm
$(
ASM
)
$(
ASMFLAGS
)
$<
-o
$@
# Compile driver.c
driver.o
:
$(DRIVER)
$(
CC
)
$(
CFLAGS
)
-c
$<
-o
$@
# Clean up build artifacts
clean
:
rm
-f
*
.o
$(
EXE1
)
$(
EXE2
)
$(
EXE3
)
$(
EXE4
)
\ No newline at end of file
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