Makefile
author Volker Birk <vb@pep.foundation>
Thu, 04 Oct 2018 17:52:01 +0200
changeset 18 3fd21a5f82b2
parent 16 19b7ea5e3362
child 19 913dbffb1746
permissions -rw-r--r--
Makefile magic
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@0
     6
TARGET?=libpEpAdapter.a
vb@0
     7
PEPENGINE_IN?=$(HOME)
vb@0
     8
vb@16
     9
CXXFLAGS += -I$(HOME)/include -std=c++14 -O0 -g
vb@0
    10
vb@0
    11
SOURCE=$(wildcard *.cc)
vb@0
    12
OBJECTS=$(subst .cc,.o,$(SOURCE))
vb@15
    13
WITHOUT_TESTS=$(patsubst test%.o,,$(OBJECTS))
vb@0
    14
vb@0
    15
all: $(TARGET)
vb@0
    16
vb@0
    17
%.o: %.cc %.hh
vb@0
    18
	$(CXX) $(CXXFLAGS) -c $<
vb@0
    19
vb@15
    20
$(TARGET): $(WITHOUT_TESTS)
vb@0
    21
	ar -rc $@ $^
vb@0
    22
vb@15
    23
.PHONY: clean test
vb@0
    24
vb@0
    25
clean:
vb@15
    26
	rm -f $(TARGET) $(OBJECTS) *.a test_adapter
vb@15
    27
vb@15
    28
test: test_adapter
vb@15
    29
	./test_adapter
vb@15
    30
vb@18
    31
test_adapter: test_adapter.o $(TARGET)
vb@18
    32
	$(CXX) -o $@ -L$(HOME)/lib -lpEpEngine -L. -lpEpAdapter $<
vb@15
    33