-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (38 loc) · 1.07 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
NAME = mrmkcs
# DEBUG = -DDEBUG -DDEBUG_STDERR
CPP = clang++
CPPFLAGS += -std=c++17 -MD -MP -g $(DEBUG)
LIBS = -lc++ -lncurses -lportmidi
LDFLAGS += $(LIBS)
prefix = /usr/local
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
SRC = $(wildcard src/*.cpp) $(wildcard src/curses/*.cpp)
OBJS = $(SRC:%.cpp=%.o)
TEST_SRC = $(wildcard test/*.cpp)
TEST_OBJS = $(TEST_SRC:%.cpp=%.o)
TEST_OBJ_FILTERS = src/main.o
CATCH_CATEGORY ?= ""
.PHONY: all test install uninstall tags clean distclean
all: $(NAME)
$(NAME): $(OBJS)
$(LD) $(LDFLAGS) -o $@ $(OBJS)
-include $(SRC:%.cpp=%.d)
-include $(TEST_SRC:%.cpp=%.d)
test: $(NAME)_test
./$(NAME)_test --use-colour no $(CATCH_CATEGORY)
$(NAME)_test: $(OBJS) $(TEST_OBJS)
$(LD) $(LDFLAGS) -o $@ $(filter-out $(TEST_OBJ_FILTERS),$^)
install: $(bindir)/$(NAME)
$(bindir)/$(NAME): $(NAME)
cp ./$(NAME) $(bindir)
chmod 755 $(bindir)/$(NAME)
uninstall:
rm -f $(bindir)/$(name)
tags: TAGS
TAGS: $(SRC)
etags $(SRC)
clean:
rm -f $(NAME) $(NAME)_test src/*.o src/curses/*.o test/*.o
distclean: clean
rm -f src/*.d src/curses/*.d test/*.d