-
Notifications
You must be signed in to change notification settings - Fork 193
/
Makefile
31 lines (25 loc) · 805 Bytes
/
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
TARGET = pacvim
PREFIX ?= /usr/local
BINDIR = $(PREFIX)/bin
MAPDIR = $(PREFIX)/share/pacvim-maps
OBJS := $(patsubst %.cpp,%.o,$(wildcard src/*.cpp))
MAPS := $(wildcard maps/*)
CXX ?= g++
CXXFLAGS += -std=c++11 -DMAPS_LOCATION='"$(MAPDIR)"'
LDLIBS += -lncurses -lpthread
ifneq ($(shell uname -s 2>/dev/null || echo nop),Darwin)
# OS has POSIX threads in libc
CXXFLAGS += -pthread
endif
$(TARGET): $(OBJS)
$(CXX) $(CXXFLAGS) $(LDFLAGS) $^ -o $@ $(LDLIBS)
install: $(TARGET)
install -Dm755 $(TARGET) $(DESTDIR)$(BINDIR)/$(TARGET)
install -d $(DESTDIR)$(MAPDIR)
install -t $(DESTDIR)$(MAPDIR) $(MAPS)
uninstall:
$(RM) $(DESTDIR)$(BINDIR)/$(TARGET)
$(RM) -r $(DESTDIR)$(MAPDIR)
clean:
$(RM) $(wildcard src/*.o) $(TARGET)
.PHONY: install uninstall clean