Makefile 568 Bytes
Newer Older
1
CXX?=g++
2 3 4 5
ifeq ($(CXXFLAGS), )
  CXXFLAGS := -W -Wall -std=c++11 -O2 -DNDEBUG
endif
export CXXFLAGS
6
INC=-I ../
7 8 9 10
SRCCORE=$(wildcard *.cpp)
OBJCORE=$(SRCCORE:.cpp=.o)
LIBCORE=vidjil.a

11 12
.PHONY: all clean forcedep

13 14 15 16 17
all: $(LIBCORE)

$(LIBCORE): $(OBJCORE)
	ar rc $@ $^

18 19 20
%.o: %.cpp
	$(CXX) $(CXXFLAGS) $(INC) -c $<

21
clean:
22 23 24 25
	rm -f $(OBJCORE) $(LIBCORE)

cleancoverage:
	rm -f *.gcda *.gcno *.gcov
26

27
forcedep:
28
	$(CXX) $(CXXFLAGS) $(INC) -M $(SRCCORE) > dep.mk
29

30 31 32
DEP=$(wildcard dep.mk)

ifeq (${DEP},)
33
$(shell	$(CXX) $(CXXFLAGS) $(INC) -M $(SRCCORE) > dep.mk)
34 35
endif
include dep.mk