summaryrefslogtreecommitdiff
blob: f3176ee236cf7488b2ee7e97e4ca90cdd34e05c7 (plain)
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
BINS = tuiclient
OBJS = $(addsuffix .o,$(BINS))
PKGCONFIG_MODULES =
MISSING_PLUGINS_LIBS = 
LIBS_PKGCONFIG := $(foreach mod,$(PKGCONFIG_MODULES),$(shell pkg-config --libs $(mod)))
CXXFLAGS_PKGCONFIG := $(foreach mod,$(PKGCONFIG_MODULES),$(shell pkg-config --libs $(mod)))

CXXFLAGS_WARNINGS = -pedantic -Wall -Wextra -Wformat -Weffc++
#CXXFLAGS_WARNINGS = -pedantic -Wextra -Wformat -Weffc++
CXXFLAGS_OPT = -O2 -g

LIBS = $(LIBS_PKGCONFIG)
#CIBS = -lncurses
CXXFLAGS = $(CXXFLAGS_PKGCONFIG) -lncurses -lpthread $(CXXFLAGS_WARNINGS) $(CXXFLAGS_OPT)

all: clean $(BINS)
	
#log.o: log.cpp settings.h log.h
#segget.o: segget.cpp pkg.cpp distfile.cpp segment.cpp log.o stats.cpp connection.cpp tui.cpp settings.o mirror.cpp str.cpp checksum.cpp

#mirror.o: mirror.cpp tui.h
#	$(CXX) -c -o $@ mirror.cpp
#	
#$(CXXFLAGS) $^
#segget: segget.cpp log.o mirror.o distfile.o tui.o
#pkg.o distfile.o segment.o mirror.o connection.o settings.o stats.o tui.o log.o
#pkg.o: pkg.cpp pkg.h distfile.h  segment.h log.h stats.h connection.h tui.h settings.h config.h str.h mirror.h checksum.h \
#                     distfile.o  segment.o log.o stats.o connection.o tui.o settings.o config.o str.o mirror.o checksum.o

#distfile.o: distfile.cpp tui.o
#distfile.o: distfile.cpp checksum.o
#distfile.h segment.h log.h stats.h connection.h tui.h settings.h config.h str.h mirror.h checksum.h
#	$(CXX) -c -o $@ $(CXXFLAGS) $^
 
#segment.o: segment.cpp segment.h log.h stats.h connection.h tui.h settings.h config.h str.h

#segget.o: segget.cpp settings.o pkg.h distfile.h segment.h log.h stats.h connection.h tui.h settings.h config.h str.h mirror.h checksum.h
#                                                                                 
%.o: %.cxx
	$(CXX) -c -o $@ $(CXXFLAGS) $^
%: %.o
	$(CXX) -o $@ $(LIBS) $(CIBS) $^

make clean_log:
	-rm -f ./logs/*.log

clean:
	-rm -f $(BINS) $(OBJS)
	-rm -f ./logs/*.log *.o

.PRECIOUS: %.o