-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
53 lines (40 loc) · 1.1 KB
/
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#
# Shadow_Talkie
#
# @ Illinois, 2018
#
EXE_ROUTER = router
EXE_TALKIE = talkie
EXE_ALL = $(EXE_ROUTER) $(EXE_TALKIE)
DEPENDS = format.o lib.o window.o
OBJS_ROUTER = $(EXE_ROUTER).o $(DEPENDS)
OBJS_TALKIE = $(EXE_TALKIE).o $(DEPENDS)
# c compiler flags
CC = clang
CFLAGS = -pthread -Wall -lncurses
# linker flags
LD = clang
LDFLAGS = -pthread -Wall# -lncurses
# phony: all
.PHONY: all
all: $(EXE_ALL)
# Compiling
$(EXE_ROUTER): $(OBJS_ROUTER)
$(CC) $(CFLAGS) -o $(EXE_ROUTER) $(OBJS_ROUTER)
$(EXE_TALKIE): $(OBJS_TALKIE)
$(CC) $(CFLAGS) -o $(EXE_TALKIE) $(OBJS_TALKIE)
# Linking
router.o: router.c includes/router.h includes/format.h includes/lib.h
$(LD) $(LDFLAGS) -c router.c
talkie.o: talkie.c includes/talkie.h includes/format.h includes/lib.h includes/window.h
$(LD) $(LDFLAGS) -c talkie.c
format.o: format.c includes/format.h includes/lib.h includes/window.h
$(LD) $(LDFLAGS) -c format.c
lib.o: lib.c includes/lib.h includes/window.h
$(LD) $(LDFLAGS) -c lib.c
window.o: window.c includes/window.h includes/lib.h
$(LD) $(LDFLAGS) -c window.c
# phony: clean
.PHONY: clean
clean:
-rm -rf *.o $(EXE_ALL)