Browse Source

Add make install target

master
Geert Custers 5 years ago
parent
commit
8e16326687
No known key found for this signature in database
GPG Key ID: C3BB9C2DBDC1198A
  1. 20
      Makefile

20
Makefile

@ -14,9 +14,9 @@ ifeq ($(UNAME), Darwin) @@ -14,9 +14,9 @@ ifeq ($(UNAME), Darwin)
CXXFLAGS = -O3 -std=c++1y -DVERSION=\"$(GIT_VERSION)\"
WARNINGS =
ifneq ("$(wildcard /usr/local/lib/libglfw3.a)","")
LIBS = -lglfw3 -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo -lGLEW -lfreetype -lharfbuzz -lmbedtls -lmbedcrypto -lmbedx509 \
else
LIBS = -lglfw3 -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo -lGLEW -lfreetype -lharfbuzz -lmbedtls -lmbedcrypto -lmbedx509
else
LIBS = -lglfw.3 -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo -lGLEW -lfreetype -lharfbuzz -lmbedtls -lmbedcrypto -lmbedx509
endif
LDFLAGS = -O3 -L/usr/local/lib
INCPATH = -I /usr/local/include -I /usr/local/include/freetype2 -I /usr/local/include/harfbuzz
@ -30,8 +30,12 @@ SRCDIR = src @@ -30,8 +30,12 @@ SRCDIR = src
OBJDIR = gen
DEPDIR = d
PREFIX = /usr/local
RESPREFIX = /usr/local/share
SOURCES = $(subst ./,,$(shell find src -name \*.cpp))
OBJECTS = $(subst $(SRCDIR),$(OBJDIR),$(SOURCES:.cpp=.o))
RES = res/
all: $(SOURCES) netrunner
@ -56,4 +60,16 @@ ntr-run-tests: test-url.o $(OBJDIR)/URL.o $(OBJDIR)/StringUtils.o @@ -56,4 +60,16 @@ ntr-run-tests: test-url.o $(OBJDIR)/URL.o $(OBJDIR)/StringUtils.o
clean:
-@rm -rf $(OBJDIR) $(EXECUTABLE) 2>/dev/null || true
.PHONY: install
install: netrunner
mkdir -p $(DESTDIR)$(PREFIX)/bin
cp $< $(DESTDIR)$(PREFIX)/bin/netrunner
mkdir -p $(DESTDIR)$(RESPREFIX)/netrunner
cp -R $(RES) $(DESTDIR)$(RESPREFIX)/netrunner/
.PHONY: uninstall
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/netrunner
rm -rf $(DESTDIR)$(RESPREFIX)/netrunner
include $(addsuffix .d,$(subst $(SRCDIR),$(DEPDIR),$(basename $(SOURCES))))

Loading…
Cancel
Save