2018-02-25 21:42:18 +01:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Makefile for Final Cut
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
# This is where make install will install the executable
|
|
|
|
BINDIR = /usr/local/bin
|
|
|
|
|
|
|
|
# compiler parameter
|
|
|
|
CXX = g++
|
|
|
|
SRCS = $(wildcard *.cpp)
|
|
|
|
OBJS = $(SRCS:%.cpp=%)
|
2018-12-02 14:13:52 +01:00
|
|
|
CCXFLAGS = $(OPTIMIZE) $(PROFILE) $(DEBUG) -std=c++11
|
2018-02-25 21:42:18 +01:00
|
|
|
MAKEFILE = -f Makefile.gcc
|
2019-09-28 03:13:06 +02:00
|
|
|
LDFLAGS = -L../src -lfinal $(TERMCAP) -lcppunit -ldl
|
2018-09-21 07:06:18 +02:00
|
|
|
INCLUDES = -I. -I../src/include -I/usr/include/final
|
2018-02-25 21:42:18 +01:00
|
|
|
RM = rm -f
|
|
|
|
|
2019-09-28 03:13:06 +02:00
|
|
|
TERMCAP := $(shell test -n "$$(ldd {/usr,}/lib64/libncursesw.so.5 2>/dev/null | grep libtinfo)" && echo "-ltinfo" || echo "-lncurses")
|
|
|
|
|
2018-02-25 21:42:18 +01:00
|
|
|
ifdef DEBUG
|
|
|
|
OPTIMIZE = -O0
|
|
|
|
else
|
|
|
|
OPTIMIZE = -O2
|
|
|
|
endif
|
|
|
|
|
|
|
|
# $@ = name of the targets
|
|
|
|
# $^ = all dependency (without double entries)
|
|
|
|
.cpp:
|
|
|
|
$(CXX) $(CCXFLAGS) $(INCLUDES) $(LDFLAGS) -o $@ $^
|
|
|
|
|
|
|
|
all: $(OBJS)
|
|
|
|
|
2019-09-28 03:13:06 +02:00
|
|
|
unittest:
|
2019-08-06 23:45:28 +02:00
|
|
|
$(MAKE) $(MAKEFILE) DEBUG="-g -D DEBUG -DUNIT_TEST -Wall -Wextra -Wpedantic"
|
2018-02-25 21:42:18 +01:00
|
|
|
|
|
|
|
check: test
|
2019-09-28 03:13:06 +02:00
|
|
|
test: unittest
|
2018-10-26 07:43:23 +02:00
|
|
|
$(OBJS) | sed -e "s/ OK/\x1b[32m OK\x1b[0m/g" -e "s/ failed/\x1b[31m failed\x1b[0m/g"
|
2018-02-25 21:42:18 +01:00
|
|
|
|
|
|
|
profile:
|
|
|
|
$(MAKE) $(MAKEFILE) PROFILE="-pg"
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
$(RM) $(SRCS:%.cpp=%) *.gcno *.gcda *~
|
|
|
|
|