#----------------------------------------------------------------------------- # Makefile for Final Cut #----------------------------------------------------------------------------- # This is where make install will install the executable BINDIR = /usr/local/bin # compiler parameter CXX = clang++ SRCS = $(wildcard *.cpp) OBJS = $(SRCS:%.cpp=%) CCXFLAGS = $(OPTIMIZE) $(PROFILE) $(DEBUG) -std=c++11 MAKEFILE = -f Makefile.clang LDFLAGS = -L../src -lfinal $(TERMCAP) -lcppunit -ldl INCLUDES = -I. -I../src/include -I/usr/include/final RM = rm -f TERMCAP := $(shell test -n "$$(ldd {/usr,}/lib64/libncursesw.so.5 2>/dev/null | grep libtinfo)" && echo "-ltinfo" || echo "-lncurses") ifdef DEBUG OPTIMIZE = -O0 -fsanitize=undefined else OPTIMIZE = -O2 endif # $@ = name of the targets # $^ = all dependency (without double entries) .cpp: $(CXX) $(CCXFLAGS) $(INCLUDES) $(LDFLAGS) -o $@ $^ all: $(OBJS) unittest: $(MAKE) $(MAKEFILE) DEBUG="-g -D DEBUG -DUNIT_TEST -Wall -Wextra -Wpedantic -Wno-padded -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-implicit-fallthrough" check: test test: unittest $(OBJS) | sed -e "s/ OK/\x1b[32m OK\x1b[0m/g" -e "s/ failed/\x1b[31m failed\x1b[0m/g" profile: $(MAKE) $(MAKEFILE) PROFILE="-pg" .PHONY: clean clean: $(RM) $(SRCS:%.cpp=%) *.gcno *.gcda *.gch *.plist *~