首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
GitHub编程设计辅导、讲解c+,java程序、辅导Python编程 辅导留学生 Statisti
项目预算:
开发周期:
发布时间:
要求地区:
View on GitHub
Quick links for this challenge
Overview
Learning Objectives
How big is this challenge?
TODO: Requirements
Tips / Specific Points
Quick links to reference sections
These tend not to vary much from challenge to challenge.
Getting Started - downloading, unzipping, etc.
Code Structure - src , include , etc.
Compiling The Code
Testing The Code
Autograder
General Information and Project Policies
Academic Honesty
Gradescope
Submission
Overview
The purpose of this challenge is help you become more familiar with writing makefiles. You only
task is to write the Makefile. That’s it.
Learning Objectives
1. Writing your own Makefile
2. Defining make variables
3. Using one or more make functions (Pretty self explanatory, isn't it?)
2021/7/12 Quick links for this challenge | make Makefile
https://umass-cs-230.github.io/198c-project-make-makefile/2021-05/ 2/7
4. Using make for tasks beyond compiling / software construction
How big is this challenge?
You need to fill in a Makefile . Our solution required about 15 non-blank lines of text. The tricky
part is using make variables, functions, and a couple of kinds of rules, in some ways you’ve not
seen before.
Getting Started
To get started, follow these steps:
1. Download the starter code.
2. Unzip the project-make-makefile.zip with the following command unzip -d PROJECT
project-make-makefile.zip . This will create a new directory called PROJECT . You can
replace PROJECT with a directory name of your choice.
3. cd into the PROJECT directory and investigate the project.
If you follow the above steps correctly, you should have the following folder structure after
unzipping (assuming the project name is “PROJECT”):
PROJECT/
include/
input/
lib/
obj/
src/
test/
Makefile
After you have the code extracted you should go ahead and investigate. You can run make from
the command line and your project will build and produce a potential error results. See more
information below.
Code Structure
This exercise contains the following important folders:
include: This is where we keep C header files. Header files are used in C to share
definitions across many C source files. That said, for this project, this directory will not be
used.
2021/7/12 Quick links for this challenge | make Makefile
https://umass-cs-230.github.io/198c-project-make-makefile/2021-05/ 3/7
input: This is where any input files that you need to work with will be stored. All input files
will have a .in extension.
lib: This is where we keep any libraries that we might use. It will often be empty.
obj: This folder is used for object files that are generated from the C compilation process.
This folder is initially empty until you compile your code. You may actually make use of this
folder in this project.
output: This is where any output files generated will be stored. All output files need to
have a .out extension. This folder will need to be created by your Makefile ( mkdir
output ).
src: This is the source folder where all source code resides. For this project, you won’t be
changing anything in this folder.
copysome.c: This is the sole source file for the program that you will need to
compile.
test: This is the test folder where you can find all of the public unit tests - if any are given.
test.cpp: This file contains all the public google tests. Technically, this file is written in
C++, but you can edit it as though it were C, since the content of this class is
fundamental enough to largely be in the intersection of C and C++. This exists for
your use, use it as you wish for more formal/automated testing. That said, it probably
won’t be much use for this project, and you would need to compile it yourself or add
a rule to the Makefile. Since it stands alone, the command gcc test/test.cpp -o
make_makefile_test -lstdc++ -lgtest -lgtest_main -lpthread should do the trick
(probably even contains more flags than necessary).
Makefile - this is a “build” file. This file is used to compile your code. This time, THIS is
where all your work goes. And this is what you submit to the auto-grader.
Testing The Makefile
The natural way to casually test the Makefile is to just run make and see if it compiles
copysome.c and generates the executable copysome . You can also check the output directory
and see if all the files are generated with the correct number of lines copied.
You will similarly want to test make -e NUMLINES=20 or something (that’ll make more sense after
reading the instructions).
TODO
Requirements
So the only thing you need to do is write the Makefile, but this makefile needs to do a series of
things by default ( make ) or of given the target all ( make all ). Here is the series of things:
2021/7/12 Quick links for this challenge | make Makefile
https://umass-cs-230.github.io/198c-project-make-makefile/2021-05/ 4/7
1. Compile src/copysome.c into an executable copysome
Pretty self explanatory, you have a sole source file src/copysome.c , and need to use it to
produce an executable named copysome (at the PROJECT directory level).
If you also create an object file, it should be named obj/copysome.o , but you don’t need to do
this.
Note that the output directory does not exists by default, so your call to make will need to make
the directory.
2. run copysome on all input files
copysome takes arguments in the form ./copysome [-n num_lines] [in_file] [out_file]
The Makefile should have a variable NUMLINES that is set to 10. (One can override the value of
this variable with -e NUMLINES=[num_lines] , e.g, -e NUMLINES=20 .)
And so for each file input/[file_name].in , an associated file named output/[file_name].out
should be produced that contains the first NUMLINES lines of [file_name].in .
Tips/Specific Points
TABS! For the love of all that is good, beware the fact that Makefiles need tabs (not spaces). We
highly recommend you try and make whitespace characters visible in the editor of your choice.
Also, beware that a Makefile must be named exactly Makefile with no extension. Some
systems “helpfully” add a .txt if you don’t watch out for it.
We want to emphasise the simplicity and power of the makefile rule structure. The basic rules
are of the form:
[rule_name/output]: [dependencies]
[commands]
(Notice that tab before [commands] !)
This is generally seen in the form of compiling files, such as:
challenge_test: test/test.cpp
gcc test/test.cpp -o challenge_test -lstdc++ -lgtest -lgtest_main -lpthread
(Where you could have the all rule claim challenge_test as a dependency, or invoke make
challenge_test directly.)
2021/7/12 Quick links for this challenge | make Makefile
https://umass-cs-230.github.io/198c-project-make-makefile/2021-05/ 5/7
But commands in Makefiles are not restricted to compilation commands. An example is a clean
rule:
clean:
rm -f output/*.out
rm -f copysome obj/copysome.o
(So make clean will not recursively consider any dependencies, but will invoke the rm
commands.)
In this challenge you will also find use for pattern rules, which have the form:
output_pattern: input_pattern
commands
where output_pattern and input_pattern have a % in them. For example, to build a .xyz file
from a .abc file:
%.xyx: %.abc
commands
You will also find use for at least one static pattern rule, which restricts a pattern rule to apply
to specific outputs:
outputs: output_pattern: input_pattern
commands
Your Makefile should not assume any specific .in files exist. Rather, it should process every
.in file in the input directory. The wildcard make function will be helpful for discovering the
input files, and the patsubst function can help create the names of the correspinding output
files. Our presention described how to describe a dependency for each file in a set of files
determined by previous variable settings in the Makefile (static pattern rule), which will also be
helpful. Other commands that may be useful include mkdir -p for guaranteeing the existence
of a directory, rm -f for deleting a file that may or may not exist in a clean rule, and likewise
rm -rf for deleting a directory that may or may not exist and everything in it.
Good Makefile style suggests that each rule should take care of only one kind of action, but may
have dependencies than can ultimately cause other things to happen. Consider, for example,
what is needed in order to run copysome - it needs to exist, and its output directory also needs
to exist. That suggests possible dependencies in your rule to run copysome , etc.
In sum, you don’t need a lot of lines of Makefile “code”, but (as in any programming) they need
to be the right lines!
2021/7/12 Quick links for this challenge | make Makefile
https://umass-cs-230.github.io/198c-project-make-makefile/2021-05/ 6/7
Autograder
The autograder is used to test your code more deeply. If you follow the specifications of this
exercise exactly then you should be able to pass all of the tests that you are provided and all of
the tests the autograder is using to check your solution.
To run the autograder on your solution you must upload your Makefile to Gradescope.
General Information and Project Policies
Read this entire document. If, after a careful reading, something seems ambiguous or
unclear to you, then communicate to the course staff immediately. Start this assignment
as soon as possible. Do not wait until the night before the assignment is due to tell us you
don’t understand something, as our ability to help you will be minimal.
For some assignments, it will be useful for you to write additional C files. Any C file you
write that is used by your solution MUST be in the provided src directory.
The course staff are here to help you figure out errors, but not solve them for you. When
you submit your solution, be sure to remove all compilation errors from your project. Any
compilation errors in your project will cause the autograder to fail, and you will receive a
zero for your submission. No Exceptions!
Reminder:
Academic Honesty
All work that is completed in this assignment is your own. You may talk to other students about
the problems you are to solve, however, you may not share code in any way. What you submit
*must be your own work.
You may not use any code that is posted on the internet. If you are not sure it is in your best
interest to contact the course staff. We will be using software that will compare your code to
other students in the course as well as online resources. It is very easy for us to detect similar
submissions and will result in a failure for the exercise or possibly a failure for the course.
Please, do not do this. It is important to be academically honest and submit your work only.
Please review the UMass Academic Honesty Policy and Procedures so you are aware of what
this means.
Copying partial or whole solutions, obtained from other students or elsewhere, is academic
dishonesty. Do not share your code with your classmates, and do not use your classmates’ code.
If you are confused about what constitutes academic dishonesty you should re-read the course
policies. We assume you have read the course policies in detail and by submitting this project
you have provided your virtual signature in agreement with these policies.
2021/7/12 Quick links for this challenge | make Makefile
https://umass-cs-230.github.io/198c-project-make-makefile/2021-05/ 7/7
Gradescope
We use Gradescope to run our autograding software and record your grade for these
assignments. You may submit this assignment as many times as possible up to the due date. If
you encounter a problem with the autograder you should contact the course staff immediately.
Submission
You must submit your Makefile . To do this you will need to download the Makefile from the
EdLab environment to your local machine then upload Makefile to Gradescope. Gradescope
will run your submission in our autograder environment and give you a report of what tests
passed and which did not. You are welcome to submit as many times as you would like.
A word of caution: some means of downloading the Makefile will add a .txt extension (why
they do this, or why they think that would be a civilised thing to do is beyond me). The file you
submit to Gradescope must be named Makefile , not Makefile.txt . I recommend making
extensions visible on your machine to make sure you notice anything off.
198c-project-make-makefile is maintained by umass-cs-230.
This page was generated by GitHub Pages.
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
urba6006代写、java/c++编程语...
2024-12-26
代做program、代写python编程语...
2024-12-26
代写dts207tc、sql编程语言代做
2024-12-25
cs209a代做、java程序设计代写
2024-12-25
cs305程序代做、代写python程序...
2024-12-25
代写csc1001、代做python设计程...
2024-12-24
代写practice test preparatio...
2024-12-24
代写bre2031 – environmental...
2024-12-24
代写ece5550: applied kalman ...
2024-12-24
代做conmgnt 7049 – measurem...
2024-12-24
代写ece3700j introduction to...
2024-12-24
代做adad9311 designing the e...
2024-12-24
代做comp5618 - applied cyber...
2024-12-24
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!