-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
25 lines (18 loc) · 735 Bytes
/
Makefile
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
# comments begin with #
# for convenience, define variable $(OBJS) to list of object files
OBJS= draw_shapes.o draw_chars.o 5x7-font.o uimain.o
# make has a "default rule" specifying how to build a an "object" file (.o) from a C source file (.c)
# this rule includes $(CFLAGS) as one of cc's parameters
CFLAGS=-g -O3 # -g for debug, -O3 for optimization
# first target is built by default. Usually named "all"
all: asciidraw
# asciidraw (target) depends on all object files (prerequisites)
asciidraw: $(OBJS)
cc -o asciidraw $(CFLAGS) $(OBJS)
# all object files built from c files that include draw.h
$(OBJS): draw.h
# deletes files generated by compilation
clean:
rm -f *.o asciidraw
run:asciidraw
./asciidraw