Makefile
author Volker Birk <vb@pep.foundation>
Thu, 04 Oct 2018 18:05:51 +0200
changeset 19 913dbffb1746
parent 18 3fd21a5f82b2
child 20 a37d30b60a38
permissions -rw-r--r--
adding a small test
vb@6
     1
# this file is under GNU GPL 3.0, see LICENSE.txt
vb@6
     2
vb@0
     3
include Makefile.conf
vb@0
     4
-include local.conf
vb@0
     5
vb@16
     6
CXXFLAGS += -I$(HOME)/include -std=c++14 -O0 -g
vb@0
     7
vb@0
     8
SOURCE=$(wildcard *.cc)
vb@19
     9
HEADERS=$(wildcard *.hh)
vb@0
    10
OBJECTS=$(subst .cc,.o,$(SOURCE))
vb@15
    11
WITHOUT_TESTS=$(patsubst test%.o,,$(OBJECTS))
vb@0
    12
vb@0
    13
all: $(TARGET)
vb@0
    14
vb@0
    15
%.o: %.cc %.hh
vb@0
    16
	$(CXX) $(CXXFLAGS) -c $<
vb@0
    17
vb@15
    18
$(TARGET): $(WITHOUT_TESTS)
vb@0
    19
	ar -rc $@ $^
vb@0
    20
vb@19
    21
.PHONY: clean test install
vb@0
    22
vb@0
    23
clean:
vb@15
    24
	rm -f $(TARGET) $(OBJECTS) *.a test_adapter
vb@15
    25
vb@15
    26
test: test_adapter
vb@15
    27
	./test_adapter
vb@15
    28
vb@18
    29
test_adapter: test_adapter.o $(TARGET)
vb@19
    30
	$(CXX) -o $@ -L$(PEP)/lib -lpEpEngine -L. -lpEpAdapter $<
vb@15
    31
vb@19
    32
install:
vb@19
    33
	-mkdir -p $(PEP)/include
vb@19
    34
	cp $(HEADERS) $(PEP)/include
vb@19
    35