Makefile
author Volker Birk <vb@pep.foundation>
Thu, 04 Oct 2018 18:12:53 +0200
changeset 21 a6b5ea94ad6e
parent 20 a37d30b60a38
child 22 1c1c9989268f
permissions -rw-r--r--
license comment
     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 test install uninstall
    23 
    24 clean:
    25 	rm -f $(TARGET) $(OBJECTS) *.a test_adapter
    26 
    27 test: test_adapter
    28 	./test_adapter
    29 
    30 test_adapter: test_adapter.o $(TARGET)
    31 	$(CXX) -o $@ -L$(PEP)/lib -lpEpEngine -L. -lpEpAdapter $<
    32 
    33 install: $(TARGET)
    34 	-mkdir -p $(PEP)/include
    35 	cp $(HEADERS) $(PEP)/include
    36 	cp $(TARGET) $(PEP)/lib
    37 
    38 uninstall:
    39 	cd $(PEP)/include && rm -f $(HEADERS)
    40 	cd $(PEP)/lib && rm -f $(TARGET)