Makefile
author Volker Birk <vb@pep.foundation>
Wed, 24 Oct 2018 22:44:54 +0200
changeset 74 97a6eaa45278
parent 63 32fa30501e3d
child 85 c318ce6c21ed
permissions -rw-r--r--
merging
vb@6
     1
# this file is under GNU GPL 3.0, see LICENSE.txt
vb@21
     2
# see LICENSE.txt
vb@6
     3
vb@0
     4
include Makefile.conf
vb@0
     5
-include local.conf
vb@0
     6
vb@16
     7
CXXFLAGS += -I$(HOME)/include -std=c++14 -O0 -g
vb@0
     8
vb@0
     9
SOURCE=$(wildcard *.cc)
vb@74
    10
HEADERS=$(wildcard *.hh *.hxx)
vb@0
    11
OBJECTS=$(subst .cc,.o,$(SOURCE))
vb@15
    12
WITHOUT_TESTS=$(patsubst test%.o,,$(OBJECTS))
vb@0
    13
vb@0
    14
all: $(TARGET)
vb@0
    15
vb@0
    16
%.o: %.cc %.hh
vb@0
    17
	$(CXX) $(CXXFLAGS) -c $<
vb@0
    18
vb@15
    19
$(TARGET): $(WITHOUT_TESTS)
vb@0
    20
	ar -rc $@ $^
vb@0
    21
vb@22
    22
.PHONY: clean distclean test install uninstall
vb@0
    23
vb@0
    24
clean:
vb@22
    25
	rm -f $(TARGET) $(OBJECTS) *.a test_adapter lib
vb@22
    26
vb@22
    27
distclean: clean
vb@22
    28
	rm -Rf .gnupg .pEp_management*
vb@15
    29
roker@63
    30
test: test_adapter test_library
vb@22
    31
ifeq ($(HOME),$(PREFIX))
vb@22
    32
	-ln -fs $$HOME/lib
vb@22
    33
endif
vb@22
    34
	HOME=$$(pwd) ./test_adapter
vb@15
    35
vb@18
    36
test_adapter: test_adapter.o $(TARGET)
vb@19
    37
	$(CXX) -o $@ -L$(PEP)/lib -lpEpEngine -L. -lpEpAdapter $<
vb@15
    38
roker@63
    39
test_library: test_library.o $(TARGET)
roker@63
    40
	$(CXX) -o $@ -L$(PEP)/lib -lpEpEngine -L. -lpEpAdapter $<
roker@63
    41
vb@20
    42
install: $(TARGET)
vb@74
    43
	-mkdir -p $(PEP)/include/pEp
vb@74
    44
	cp $(HEADERS) $(PEP)/include/pEp/
vb@74
    45
	cp $(TARGET) $(PEP)/lib/
vb@19
    46
vb@20
    47
uninstall:
vb@20
    48
	cd $(PEP)/include && rm -f $(HEADERS)
vb@20
    49
	cd $(PEP)/lib && rm -f $(TARGET)