Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,23 @@ MAPDIR = $(PREFIX)/share/pacvim-maps
OBJS := $(patsubst %.cpp,%.o,$(wildcard src/*.cpp))
MAPS := $(wildcard maps/*)
CXX ?= g++
CXXFLAGS += -std=c++11 -DMAPS_LOCATION='"$(MAPDIR)"'
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

-include $(OBJS:.o=.d)

$(TARGET): $(OBJS)
$(CXX) $(CXXFLAGS) $(LDFLAGS) $^ -o $@ $(LDLIBS)

# Generate dependency files with correct target names
%.o: %.cpp
$(CXX) $(CXXFLAGS) -MMD -MP -MT $@ -c $< -o $@

install: $(TARGET)
install -Dm755 $(TARGET) $(DESTDIR)$(BINDIR)/$(TARGET)
install -d $(DESTDIR)$(MAPDIR)
Expand All @@ -26,6 +32,6 @@ uninstall:
$(RM) -r $(DESTDIR)$(MAPDIR)

clean:
$(RM) $(wildcard src/*.o) $(TARGET)
$(RM) $(wildcard src/*.o) $(wildcard src/*.d) $(TARGET)

.PHONY: install uninstall clean