-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
46 lines (37 loc) · 1.18 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
## Makefile for Anakata
## Author- Abhishek Shrivastava <[email protected])
CC = g++
CC_OPTIONS = -ggdb3 -Wall -std=c++11 -lpthread
CFLAGS = $(CC_OPTIONS)
ODIR = obj
BUILD = build
BIN = bin
SDIR = src
CLIENT = KatClient
SERVER = KatServ
.PHONY: clean cleano client server
all: client server
run:
$(CC) $(CC_OPTIONS) -o $(EXE) $(SRC)
./$(EXE)
config:
$(CC) $(CC_OPTIONS) $(SDIR)/configure.cpp -o $(BUILD)/$@
cd $(BUILD); ./$@
# this target compiles and links the client
client: clean
$(CC) $(CC_OPTIONS) -c $(SDIR)/$(CLIENT)/KatClient.cpp -o $(ODIR)/KatClient.o
$(CC) $(CC_OPTIONS) -c $(SDIR)/$(CLIENT)/katalyn.cpp -o $(ODIR)/katalyn.o
$(CC) $(CC_OPTIONS) -c $(SDIR)/logger.cpp -o $(ODIR)/logger.o
$(CC) $(CC_OPTIONS) $(ODIR)/*.o -o $(BUILD)/$@
cp $(BUILD)/* $(BIN)/
# this target compiles and links the server
server: clean
$(CC) $(CC_OPTIONS) -c $(SDIR)/$(SERVER)/KatServ.cpp -o $(ODIR)/KatServ.o
$(CC) $(CC_OPTIONS) -c $(SDIR)/$(SERVER)/trackr.cpp -o $(ODIR)/trackr.o
$(CC) $(CC_OPTIONS) -c $(SDIR)/logger.cpp -o $(ODIR)/logger.o
$(CC) $(CC_OPTIONS) $(ODIR)/*.o -o $(BUILD)/$@
cp $(BUILD)/* $(BIN)/
cleano:
rm -f $(ODIR)/*.o
clean:
rm -f $(BUILD)/* $(ODIR)/*.o