Makefile: Add install target
parent
6046949726
commit
5aea8a61ed
9
Makefile
9
Makefile
|
@ -18,6 +18,10 @@ OBJECTS += $(BUILD_DIR)/miniz.o
|
|||
DSO_PATH := $(BUILD_DIR)/$(DSO_NAME)
|
||||
DSO := $(DSO_PATH).so.$(DSO_MAJOR).$(DSO_MINOR)
|
||||
|
||||
ifndef DONT_STRIP
|
||||
INSTALL_STRIP := -s --strip-program=$(STRIP)
|
||||
endif
|
||||
|
||||
$(DSO): $(OBJECTS)
|
||||
$(LINK_DSO)
|
||||
ln -sf $(DSO_NAME).so.$(DSO_MAJOR).$(DSO_MINOR) $(DSO_PATH).so.$(DSO_MINOR)
|
||||
|
@ -37,6 +41,11 @@ $(BENCH_DIR)/zrle-bench: $(OBJECTS) $(BUILD_DIR)/pngfb.o \
|
|||
$(BENCH_DIR)/zrle-bench.o
|
||||
$(LINK_EXE) $(shell pkg-config --libs libpng)
|
||||
|
||||
.PHONY: install
|
||||
install: $(DSO)
|
||||
install $(INSTALL_STRIP) -Dt $(DESTDIR)$(PREFIX)/lib $(BUILD_DIR)/*.so*
|
||||
install -Dt $(DESTDIR)$(PREFIX)/include inc/neatvnc.h
|
||||
|
||||
.PHONY: bench
|
||||
bench: $(BENCH_DIR)/zrle-bench
|
||||
./$(BENCH_DIR)/zrle-bench
|
||||
|
|
|
@ -2,6 +2,8 @@ MACHINE := $(shell $(CC) -dumpmachine)
|
|||
ARCH := $(firstword $(subst -, ,$(MACHINE)))
|
||||
BUILD_DIR ?= build-$(MACHINE)
|
||||
|
||||
PREFIX ?= /usr/local
|
||||
|
||||
ifeq ($(ARCH),x86_64)
|
||||
ARCH_CFLAGS := -mavx
|
||||
else
|
||||
|
@ -10,6 +12,12 @@ ifeq ($(ARCH),arm)
|
|||
endif # end arm block
|
||||
endif # end x86_64 block
|
||||
|
||||
ifeq (, $(shell which $(MACHINE)-strip 2>/dev/null))
|
||||
STRIP := strip
|
||||
else
|
||||
STRIP := $(MACHINE)-strip
|
||||
endif
|
||||
|
||||
CFLAGS ?= -g -O3 $(ARCH_CFLAGS) -flto -DNDEBUG
|
||||
LDFLAGS ?= -flto
|
||||
|
||||
|
|
Loading…
Reference in New Issue