Hello (hello) Project
Overview
In this project you will create a “hello, world!” program. That might
sound easy, but the catch is you will need to create it using the
command-line development workflow shown in class that we’ll be using for
all projects in the class, including the emacs or
vim editor, make build automation, and
git version control for submission.
git setup
Be sure to complete the vc exercise before attempting this project.
Create a new local repository, following the directions in the vc exercise
(including running
git push --set-upstream submission master in the last
step). Instead of using vc, set the local and remote
repository URLs to be the following locations:
| Local repository | ~/cop3402fal2026/hello |
| Remote repository | gitolite3@eustis3.eecs.ucf.edu:cop3402/$USER/hello |
Commands to setup your repo in brief
These steps only setup the repo. They do not submit your code. And they assume you have already completed the vc exercise. Consult that exercise for specifics on validating each step and submitting your code.
mkdir -p ~/cop3402fal2026/hello
cd ~/cop3402fal2026/hello
git init
echo "hello project" > README.md
git add README.md
git commit README.md
# Enter a commit message in the editor that pops up
git remote add submission gitolite3@eustis3.eecs.ucf.edu:cop3402/$USER/hello
git push --set-upstream submission masterCreate the “hello, world!” program with vim or emacs
Using either vim or emacs in eustis, record yourself using
script (see instructions below) writing, compiling, and
running a hello world program in C, i.e., a program that uses printf to
write “hello, world!” to the console.
Enter your local repository
cd ~/cop3402fal2026/helloIf your ~/cop3402fal2026 directory does not exist yet,
be sure to do git setup first.
Start recording
script -T hello.timing hello.scriptUse
vim or emacs to create a hello world program called
hello.c, then compile it and run it
For vim, use
vim hello.cIf you would like to use emacs instead of vim:
emacs hello.cCreate a C program that prints "hello, world!\n"
(remember this is case sensitive and don’t forget the
\n).
Then save and exit (for vim,
<ESCAPE>:wq<ENTER>; for emacs,
Ctrl-x Ctrl-s then Ctrl-x Ctrl-c).
Make sure your compiles and runs correctly:
gcc -o hello hello.c
./helloStop recording
exit(or Ctrl-D on the empty command prompt.)
Verify that your recording works by replaying it yourself
scriptreplay hello.timing hello.script 2The 2 is optional and will replay it at 2x
speed. You can use a higher number as well to replay faster. Use Ctrl-C
to stop playback.
Creating a Makefile
Enter your local repository
cd ~/cop3402fal2026/helloIf your directory does not exist yet, be sure to do git setup first.
Edit your Makefile
vim Makefile # Or emacs Makefile if you prefer emacsHand-type the following Makefile. Use tab for indentation (not spaces), or your Makefile will not work.
.PHONY: all clean
all: hello
hello: hello.c
gcc -o hello hello.c
clean:
rm -f helloThen save and exit (for vim,
<ESCAPE>:wq<ENTER>;for emacs,
Ctrl-x Ctrl-s then Ctrl-x Ctrl-c).
Do not use make to run the program (i.e., there
should be no ./hello in your build step). The Makefile can
include additional targets for testing the program, e.g.,
make check (though this is not required for this class).
See the make
documentation for more information about standard targets.
Test your Makefile
First clean up the compiled binary.
make cleanYou should see the following output. (Do not type this into bash; this is what the Makefile will run for you):
rm -f helloThen use make to automatically compile your program.
makeYou should see the following output. (Do not type this into bash; this is what the Makefile will run for you):
gcc -o hello hello.cIf you receive compiler errors, be sure your hello.c is
correct. If you receive make errors, double-check the Makefile contents
against the previous step and make
sure you are using tab not spaces for indentation.
If you have already built your program and not modified
hello.c since, then you will see something like
make: Nothing to be done for 'all'.or something like this
make: 'hello' is up to date.Submitting your program via git
This assumes you have already created your local repository and set your remote repository.
Add and commit each file
Enter
git add hello.c
git commit hello.cEnter an appropriate commit message.
If you encounter errors or do not know how to use the vim or emacs editor, please be sure to complete the vc exercise before proceeding. Then setup this project’s git repository.
Then enter
git add hello.timing hello.script
git commit hello.timing hello.scriptEnter an appropriate commit message and then do
git add Makefile
git commit MakefileEnter an appropriate commit message and finally do (if you haven’t already done this here).
git add .gitignore
git commit .gitignoreEnter an appropriate commit message.
Double-check that you have no uncommitted or unignored changes in your working tree.
git statusYou should see something like this:
On branch master
Your branch is ahead of 'submission/master' by 4 commits.
(use "git push" to publish your local commits)
nothing to commit, working tree cleanThis means you have commits that haven’t been pushed to the git server (“Your branch is ahead…”) and that your working tree has no differences from your committed code (“nothing to commit…”).
You may also see a variation where there are untracked files, e.g., the above message will contain instead
On branch master
Your branch is ahead of 'submission/master' by 3 commits.
(use "git push" to publish your local commits)
Untracked files:
(use "git add <file>..." to include in what will be committed)
Makefile`
hello
nothing added to commit but untracked files present (use "git add" to track)We will see how to ignore files that are not meant to be in the git
repository in the next section on .gitignore.
Push the repository
git pushYou should see something similar to this:
Enumerating objects: 14, done.
Counting objects: 100% (5/5), done.
Writing objects: 100% (3/3), 264 bytes | 264.00 KiB/s, done.
Total 13 (delta 0), reused 0 (delta 0), pack-reused 0
To eustis3.eecs.ucf.edu:cop3402/NID/hello
0721d93..886c6f7 master -> masterIf you encounter errors, please be sure to complete the vc exercise before proceeding. Then setup this project’s git repository.
Creating a .gitignore
file
It’s good practice to omit
generated, binary files from source version control, such as your
hello program binary. Source version control tools are
geared towards source code, and program binaries dramatically increase
the size of the repository. Moreover, the program binary should be
easily buildable from source, especially if you have good build automation. Other tools, such as
package managers, may be more appropriate for distributing program
binaries.
Go to the root of your repo
Be sure you are in the root of your repo, in this case
~/cop3402fal2026/hello:
cd ~/cop3402fal2026/helloMake sure the
hello file exists
To illustrate what the .gitignore file does, let’s make
sure the file hello exists (it may already if you have
built your program):
touch hello(touch creates an empty file or updates the timestamp of
an existing file).
Validate the untracked file
git statusThis should output something like this:
On branch master
Untracked files:
(use "git add <file>..." to include in what will be committed)
hello
Makefile`
nothing added to commit but untracked files present (use "git add" to track)There may be other content, but be sure that hello is
under Untracked files:. This tells you that
hello is untracked, i.e., it is in the working tree but not
staged or committed. If you don’t see this, be sure you are in the root of your repo
and that the
hello file exists. If it still is not shown as
untracked, then you may have accidentally added hello to
your repo already. Remove it with these
instructions
vim .gitignore # or emacs .gitignore if you prefer emacsPut the names (or patterns) of files to exclude from the output, one per line:
*~
*.swp
hello*~ignores vim and emacs backup files.*.swpignores vim swap files.helloignores the compiledhellobinary file.
Save and exit (for vim,
<ESCAPE>:wq<ENTER>;for emacs,
Ctrl-x Ctrl-s then Ctrl-x Ctrl-c).
Validate
that git no longer considers hello untracked
git statusThis should output something like this:
On branch master
Your branch is ahead of 'submission/master' by 3 commits.
(use "git push" to publish your local commits)
Untracked files:
(use "git add <file>..." to include in what will be committed)
.gitignore
nothing added to commit but untracked files present (use "git add" to track)Notice that hello is no longer under
Untracked files, but now the new file
.gitignore is. Add and commit this file so that all users
of your repo will see it.
git add .gitignore
git commit .gitignoreEnter a commit message, e.g.,
Add a .gitignore file
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch master
# Changes to be committed:
# new .gitignore
#
Save and exit (for vim,
<ESCAPE>:wq<ENTER>;for emacs,
Ctrl-x Ctrl-s then Ctrl-x Ctrl-c).
Check git status for a clean working tree
git statusThis should output something like:
On branch master
nothing to commit, working tree cleanNotice .gitignore is no longer untracked, because it was
committed. But hello is also untracked, not because it was
committed, but because you have asked git to ignore it.
Push the repository
git pushYou should see something similar to this:
Enumerating objects: 14, done.
Counting objects: 100% (5/5), done.
Writing objects: 100% (3/3), 264 bytes | 264.00 KiB/s, done.
Total 13 (delta 0), reused 0 (delta 0), pack-reused 0
To eustis3.eecs.ucf.edu:cop3402/NID/hello
0721d93..886c6f7 master -> masterIf you encounter errors or do not know how to use the vim or emacs editor, please be sure to complete the vc exercise before proceeding. Then setup this project’s git repository.
Self-check
Remove the previous self-check
If you have already run the self-check, you can remove it like this
rm -rf ~/tmp/hello_selfcheckDouble-check the path carefully to avoid deleting the wrong directory.
Make a fresh clone of your project
git clone gitolite3@eustis3.eecs.ucf.edu:cop3402/$USER/hello ~/tmp/hello_selfcheckYou should see something like
Cloning into '/home/net/NID/tmp/hello_selfcheck'...
done.If you see
fatal: destination path '/home/net/NID/tmp/hello_selfcheck already exists and is not an empty directory.then remove the previous self-check.
Enter the fresh clone’s directory
cd ~/tmp/hello_selfcheckDouble-check that the five required files are submitted
ls -aYou should see the five required files (hello.c, hello.script,
hello.timing, Makefile, .gitignore), .git, .,
.., and (optionally) a README.md file, e.g.,
.
..
.git
README.md
hello.c
hello.script
hello.timing
Makefile
.gitignoreThe order does not matter. If you have a README.md, that is okay. If
you have hello or any other program binary, remove it with these
instructions and rerun the self-check.
You can also validate what files are actually in the repo like this:
git ls-tree --full-tree -r --name-only HEADBe sure that
make works correctly
makeThis should only create the hello program and do nothing
else (not run the program either).
Running ls should show the hello program
now in the directory.
Make sure hello
runs correctly
./helloThis should output hello, world! (and exactly this; caps
and the newline matter) on its own line, i.e.,
hello, world!If you see a missing “”, which will have the command-prompt immediately after the text, e.g.,
hello, world!NID:~/cop3402fal2026/hello$or if you see a missing comma, missing exclamation point, or any capitalized letters, go back and follow the directions closely.
Make sure make clean
works
make cleanThis should remove the hello binary. Confirm that it is
gone with ls.
Make sure
make and ./hello still work after clean
make
./helloYou should get the same behavior as before with make and ./hello.
Make sure your terminal recording works
scriptreplay hello.timing hello.script 2You should see a recording of yourself opening vim or emacs, entering the hello world program, saving, and exiting.
Grading schema
| Criterion | Points |
|---|---|
| The git repo exists | 1 |
| The repo contains the five required files | 1 |
| The repo does /not/ contain hello or any program binaries | 2 |
| The replay shows using vim or emacs to code | 2 |
| The Makefile works correctly | 1 |
| The program runs correctly | 1 |
| TOTAL | 8 |