-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
33 lines (23 loc) · 858 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
26
27
28
29
30
31
32
33
LDIR=lib
ODIR=build
CC=gcc
CXX=g++
CFLAGS=-Wall -Wextra -g -fsanitize=address -DBE_DEBUG=0
CXXFLAGS= -std=c++11 -Wall -g -Wextra -fsanitize=address -I$(LDIR)
LIBS=-lssl -lcrypto -lcurl -lpthread -lboost_filesystem -lboost_system -lboost_thread -lboost_chrono -lglog
_DEPS=bencode.h tracker.h peer.h torrentparser.hpp filehandler.hpp pwp.hpp tracker_udp.hpp
DEPS=$(patsubst %,$(LDIR)/%,$(_DEPS))
_OBJ=bencode.o tracker.o torrentparser.o atorrent-cli.o filehandler.o peer.o pwp.o tracker_udp.o
OBJ=$(patsubst %,$(ODIR)/%,$(_OBJ))
$(ODIR)/%.o: $(LDIR)/%.c
$(CC) -c -o $@ $< $(CFLAGS)
$(ODIR)/%.o: $(LDIR)/%.cpp
$(CXX) -c -o $@ $< $(CXXFLAGS)
# Used for atorrent-cli.cpp in the main directory
$(ODIR)/%.o: %.cpp $(DEPS)
$(CXX) -c -o $@ $< $(CXXFLAGS)
atorrent-cli: $(OBJ)
$(CXX) -o $@ $^ $(CXXFLAGS) $(LIBS)
clean:
rm -f $(ODIR)/*.o
.PHONY: clean