Compiling files by hand is a pain, so here is simple Makefile that does this for you. It can also run the submit and check scripts for you, so you don't have to type in the commands in by hand. If you are not sure if your submission has gone through, it can also list your submission dates.
In a nutshell, Make is a utility that automates the build process for projects. Tasks are defined in a special file called a Makefile, which is what we have here.
First, download the Makefile to your lab directory, the same place as your source files.
% cd ~/comp411lab/lab1
% wget https://gist.githubusercontent.com/kylefeng28/dd5f3a8c13562428a3989071da5af630/raw -O Makefile
If this doesn't work for some reason, you could always download the Makefile to your computer and upload it to the server using scp or a client like WinSCP. Be sure that the file is called Makefile
, otherwise it will not work.
After downloading the Makefile, you can now run make
commands:
make all
- Compiles all source files (
ex1.c
,ex2.c
,ex3.c
intoex1
,ex2
,ex3
)
- Compiles all source files (
make ex1
,make ex2
,make ex3
- Compiles the file specified
make clean
- Deletes the compiled programs (does not delete the source files)
make submit
- Runs the submit script (
/home/montek/comp411/bin/submitlab1
)
- Runs the submit script (
make check
- Runs the self-check script (
/home/montek/comp411/bin/selfchecklab1
)
- Runs the self-check script (
make verify
- Verifies that you have submitted, and lists submission dates if you have
If you don't specify a command (i.e., if you just run make
), it defaults to make all
.