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
     1 # this file is under GNU GPL 3.0, see LICENSE.txt
     2 
     3 include Makefile.conf
     4 -include local.conf
     5 
     6 TARGET?=libpEpAdapter.a
     7 PEPENGINE_IN?=$(HOME)
     8 
     9 CXXFLAGS += -I$(HOME)/include -std=c++14 -O0 -g
    10 
    11 SOURCE=$(wildcard *.cc)
    12 OBJECTS=$(subst .cc,.o,$(SOURCE))
    13 WITHOUT_TESTS=$(patsubst test%.o,,$(OBJECTS))
    14 
    15 all: $(TARGET)
    16 
    17 %.o: %.cc %.hh
    18 	$(CXX) $(CXXFLAGS) -c $<
    19 
    20 $(TARGET): $(WITHOUT_TESTS)
    21 	ar -rc $@ $^
    22 
    23 .PHONY: clean test
    24 
    25 clean:
    26 	rm -f $(TARGET) $(OBJECTS) *.a test_adapter
    27 
    28 test: test_adapter
    29 	./test_adapter
    30 
    31 test_adapter: test_adapter.o $(TARGET)
    32 	$(CXX) -o $@ -L$(HOME)/lib -lpEpEngine -L. -lpEpAdapter $<
    33