-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (46 loc) · 1.71 KB
/
Makefile
File metadata and controls
62 lines (46 loc) · 1.71 KB
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
54
55
56
57
58
59
60
61
62
CC=g++ # compiler name
CFLAGS=-std=c++11 -Wall
LDFLAGS = -g # -g flag adds debugging information to the executable file
LFLAGS = -Wall # flag use in files linkage - most compiler warnings
SERVERSRC=Server.h Server.cpp
CLIENTSRC=Client.h Client.cpp
EVENTSRC=Event.h Event.cpp
LOGGERSRC=Logger.h Logger.cpp
COMMPARSER=CommandParser.h CommandParser.cpp
INCLUDS = -I. Server.h Event.h Logger.h CommandParser.h
SRCFILES=emServer.cpp Server.cpp Event.cpp Logger.cpp CommandParser.cpp
LIBOBJ=$(LIBSRC:.cpp=.o)
OFFSET=-D_FILE_OFFSET_BITS=64
TARFLAGS = -cvf
TARNAME = ex5.tar
SERVEREXC= emServer
CLIENTEXC= emClient
TARGET = $(SERVEREXC) $(CLIENTEXC)
TAR_SRC= Makefile $(SERVERSRC) $(EVENTSRC) $(LOGGERSRC) $(COMMPARSER) \
$(CLIENTSRC) emServer.cpp emClient.cpp README
all: $(TARGET)
.DEFAULT_GOAL := all
Event.o: $(EVENTSRC)
$(CC) $(CFLAGS) -c Event.cpp
Logger.o: $(LOGGERSRC)
$(CC) $(CFLAGS) -c Logger.cpp
CommandParser.o: $(COMMPARSER)
$(CC) $(CFLAGS) -c CommandParser.cpp
Server.o: $(SERVERSRC) $(EVENTSRC) $(LOGGERSRC) $(COMMPARSER)
$(CC) $(CFLAGS) -c Server.cpp
emServer.o: emServer.cpp Server.o Event.o Logger.o CommandParser.o
$(CC) $(CFLAGS) -pthread -c emServer.cpp
emServer: emServer.o
$(CC) $(CFLAGS) -pthread Server.o Event.o Logger.o CommandParser.o emServer.o -o emServer
Client.o: $(CLIENTSRC) $(LOGGERSRC) $(COMMPARSER)
$(CC) $(CFLAGS) -c Client.cpp
emClient.o: emClient.cpp Logger.o CommandParser.o Client.o
$(CC) $(CFLAGS) -c emClient.cpp
emClient: emClient.o
$(CC) $(CFLAGS) Logger.o CommandParser.o Client.o emClient.o -o emClient
clean:
rm -rf $(TARGET) $(LIBOBJ) $(OBJ) *.o *~ *core *.gch
depend:
makedepend -- $(CFLAGS) -- $(SRC) $(LIBSRC)
tar:
tar $(TARFLAGS) $(TARNAME) $(TAR_SRC)