Skip to content

Commit a00d0f6

Browse files
committed
Remove additional comments from Makefile
1 parent d4a01c8 commit a00d0f6

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

Makefile

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,23 @@
1-
# If you use threads, add -pthread here.
21
COMPILERFLAGS = -g -Wall -Wextra -Wno-sign-compare
32

4-
# Any libraries you might need linked in.
53
LINKLIBS = -lpthread
64

7-
# The components of each program. When you create a src/foo.c source file, add obj/foo.o here, separated
8-
#by a space (e.g. SOMEOBJECTS = obj/foo.o obj/bar.o obj/baz.o).
95
SERVEROBJECTS = obj/receiver.o
106
CLIENTOBJECTS = obj/sender.o
117

12-
#Every rule listed here as .PHONY is "phony": when you say you want that rule satisfied,
13-
#Make knows not to bother checking whether the file exists, it just runs the recipes regardless.
14-
#(Usually used for rules whose targets are conceptual, rather than real files, such as 'clean'.
15-
#If you DIDNT mark clean phony, then if there is a file named 'clean' in your directory, running
16-
#`make clean` would do nothing!!!)
178
.PHONY: all clean
189

19-
#The first rule in the Makefile is the default (the one chosen by plain `make`).
20-
#Since 'all' is first in this file, both `make all` and `make` do the same thing.
21-
#(`make obj server client talker listener` would also have the same effect).
22-
#all : obj server client talker listener
2310
all : obj sender receiver
2411

25-
#$@: name of rule's target: server, client, talker, or listener, for the respective rules.
26-
#$^: the entire dependency string (after expansions); here, $(SERVEROBJECTS)
27-
#CC is a built in variable for the default C compiler; it usually defaults to "gcc". (CXX is g++).
2812
receiver: $(SERVEROBJECTS)
2913
$(CC) $(COMPILERFLAGS) $^ -o $@ $(LINKLIBS)
3014

31-
32-
33-
#So, how does all of this work? This rule is saying
34-
#
35-
#"I am how you make the thing called client. If the thing called client is required, but doesn't
36-
#exist / is out of date, then the way to make it is to run
37-
#`$(CC) $(COMPILERFLAGS) $^ -o $@ $(LINKLIBS)`.
38-
#But, you can't start doing that until you are sure all of my dependencies ($(CLIENTOBJECTS)) are up to date."
39-
#
40-
#In this case, CLIENTOBJECTS is just obj/client.o. So, if obj/client.o doesn't exist or is out of date,
41-
#make will first look for a rule to build it. That rule is the 'obj/%.o' one, below; the % is a wildcard.
4215
sender: $(CLIENTOBJECTS)
4316
$(CC) $(COMPILERFLAGS) $^ -o $@ $(LINKLIBS)
4417

45-
#RM is a built-in variable that defaults to "rm -f".
4618
clean :
47-
# $(RM) obj/*.o server client talker listener
4819
$(RM) obj/*.o sender receiver
4920

50-
#$<: the first dependency in the list; here, src/%.c. (Of course, we could also have used $^).
51-
#The % sign means "match one or more characters". You specify it in the target, and when a file
52-
#dependency is checked, if its name matches this pattern, this rule is used. You can also use the %
53-
#in your list of dependencies, and it will insert whatever characters were matched for the target name.
5421
obj/%.o: src/%.c
5522
$(CC) $(COMPILERFLAGS) -c -o $@ $<
5623
obj:

0 commit comments

Comments
 (0)