Fork for poking around in the original "client implementation for p≡p update server".
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
downloadclient/Makefile

87 lines
2.1 KiB

# this file is under GNU GPL 3.0, see LICENSE.txt
# see LICENSE.txt
PREFIX=$(HOME)
BOOST_INCLUDE?=$(PREFIX)/include
BOOST_LIB?=$(PREFIX)/lib
CRYPTOPP_INCLUDE?=$(PREFIX)/include
CRYPTOPP_LIB?=$(PREFIX)/lib
OPENSSL_INCLUDE?=$(PREFIX)/include
OPENSSL_LIB?=$(PREFIX)/lib
LIBZ_INCLUDE?=$(PREFIX)/include
LIBZ_LIB?=$(PREFIX)/lib
ifeq ($(wildcard local.conf),local.conf)
-include local.conf
endif
CXXFLAGS += -std=c++14 -O0 -g
CXXFLAGS += -I$(BOOST_INCLUDE) -I$(CRYPTOPP_INCLUDE) -I$(OPENSSL_INCLUDE) -I$(LIBZ_INCLUDE)
LDFLAGS+=$(BOOST_LIB)/libboost_regex.a $(BOOST_LIB)/libboost_iostreams.a $(BOOST_LIB)/libboost_system.a
LDFLAGS+=$(CRYPTOPP_LIB)/libcryptopp.a
LDFLAGS+=$(OPENSSL_LIB)/libssl.a $(OPENSSL_LIB)/libcrypto.a
LDFLAGS+=$(LIBZ_LIB)/libz.a
TARGET=libdownloadclient.a
SOURCE=$(wildcard *.cc)
HEADERS=$(wildcard *.hh *.hxx)
OBJECTS=$(subst .cc,.o,$(SOURCE))
WITHOUT_TESTS=$(patsubst test_%.o,,$(OBJECTS))
TESTSOURCE=$(wildcard test_*.cc)
TESTOBJECTS=$(subst .cc,.o,$(TESTSOURCE))
TESTS=$(subst .cc,,$(TESTSOURCE))
all: $(TARGET)
%.o: %.cc %.hh
$(CXX) $(CXXFLAGS) -c $<
$(TARGET): $(WITHOUT_TESTS)
ar -rc $@ $^
.PHONY: clean install uninstall test
clean:
rm -f $(TARGET) *.o *.a
rm -f $(TESTS)
install: $(TARGET)
-mkdir -p $(PREFIX)/include/pEp
cp $(HEADERS) $(PREFIX)/include/pEp/
cp $(TARGET) $(PREFIX)/lib/
uninstall:
cd $(PREFIX)/include && rm -f $(HEADERS)
cd $(PREFIX)/lib && rm -f $(TARGET)
test_%: test_%.o $(TARGET)
$(CXX) $(LDFLAGS) $< $(TARGET) -o $@
test: $(TESTS)
. run_tests.sh $(TESTS)
tags: $(SOURCE) $(HEADERS)
ctags $(SOURCE) $(HEADERS)
local.conf:
@echo PREFIX=$(PREFIX) > local.conf
@echo >> local.conf
@echo BOOST_INCLUDE=$(BOOST_INCLUDE) >> local.conf
@echo BOOST_LIB=$(BOOST_LIB) >> local.conf
@echo >> local.conf
@echo CRYPTOPP_INCLUDE=$(CRYPTOPP_INCLUDE) >> local.conf
@echo CRYPTOPP_LIB=$(CRYPTOPP_LIB) >> local.conf
@echo >> local.conf
@echo OPENSSL_INCLUDE=$(OPENSSL_INCLUDE) >> local.conf
@echo OPENSSL_LIB=$(OPENSSL_LIB) >> local.conf
@echo >> local.conf
@echo LIBZ_INCLUDE=$(LIBZ_INCLUDE) >> local.conf
@echo LIBZ_LIB=$(LIBZ_LIB) >> local.conf