summaryrefslogtreecommitdiff
blob: eafc4d451485e06cb9b253ba53fd95baffa2782e (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
BINS = segget
OBJS = $(addsuffix .o,$(BINS))
PKGCONFIG_MODULES = json libcurl libcrypto
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)
#MIBS = -lncurses
CXXFLAGS = $(CXXFLAGS_PKGCONFIG) -lncurses $(CXXFLAGS_WARNINGS) $(CXXFLAGS_OPT)

all: clean $(BINS)
	
%.o: %.cxx
	$(CXX) -c -o $@ $(CXXFLAGS) $^

segget: segget.o connection.o checksum.o config.o distfile.o log.o mirror.o network.o networkbroker.o phase.o pkg.o response.o segment.o settings.o stats.o str.o tui.o utils.o ui_server.o proxyfetcher.o
	$(CXX) -o $@ -lncurses $(LIBS) $(CIBS) $^
#%: %.o
#	$(CXX) -o $@ $(LIBS) $(CIBS) $^

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

.PRECIOUS: %.o