1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#=============================================================================#
# Simple makefile for building the onebits program.
#
# This makefile doesn't use implicit build rules, although you are welcome to
# use them if you know how.
#
# Caltech CS24 - Introduction to Computing Systems
# Spring 2009 - Donnie Pinkston (donnie@cs.caltech.edu)
#=============================================================================#
# The first build rule is used if no arguments are specfiied to make.
# Alternatively, one can type "make clean" to run the clean rule, or
# "make clean all" to invoke multiple build targets.
all: onebits
# This rule specifies how to generate the onebits program, if we also have
# onebits.o. If onebits.o doesn't exist, make will use the rule for onebits.o
# to generate it from onebits.c.
onebits: onebits.o
gcc -Wall -Werror -o onebits onebits.o
onebits.o: onebits.c
gcc -Wall -Werror -c onebits.c
# Clean up all files generated during the build process.
# BE VERY CAREFUL editing this rule; don't delete your souce code!
clean:
rm -f onebits *.o *~
# This build rule specifies all build targets that are not actual files. Other
# rules actually generate a file with the same name as the target, but the "all"
# and "clean" rules do not generate files with these names.
.PHONY: all clean