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