2019-09-07 14:18:34 +00:00
|
|
|
DEPENDENCIES := pixman-1 libuv
|
2019-08-27 19:57:52 +00:00
|
|
|
|
2019-09-07 13:51:17 +00:00
|
|
|
SOURCES := \
|
|
|
|
src/server.c \
|
|
|
|
src/util.c \
|
|
|
|
src/vec.c \
|
|
|
|
src/zrle.c \
|
2019-09-19 18:14:24 +00:00
|
|
|
src/raw-encoding.c \
|
2019-09-09 19:15:02 +00:00
|
|
|
src/pixels.c \
|
2019-09-15 20:44:49 +00:00
|
|
|
src/damage.c \
|
2019-10-07 17:39:54 +00:00
|
|
|
src/fb.c \
|
2019-08-29 22:07:04 +00:00
|
|
|
|
2019-09-07 15:01:53 +00:00
|
|
|
include common.mk
|
2019-08-29 22:07:04 +00:00
|
|
|
|
2019-09-07 17:25:27 +00:00
|
|
|
VERSION=0.0.0
|
|
|
|
|
2019-09-07 15:01:53 +00:00
|
|
|
DSO_NAME=libneatvnc
|
|
|
|
DSO_MAJOR=0
|
|
|
|
DSO_MINOR=0
|
2019-08-27 22:29:46 +00:00
|
|
|
|
2019-09-07 15:01:53 +00:00
|
|
|
CFLAGS += -fvisibility=hidden -Icontrib/miniz
|
|
|
|
OBJECTS += $(BUILD_DIR)/miniz.o
|
2019-08-29 22:07:04 +00:00
|
|
|
|
2019-09-07 13:51:17 +00:00
|
|
|
DSO_PATH := $(BUILD_DIR)/$(DSO_NAME)
|
2019-09-07 16:01:39 +00:00
|
|
|
DSO := $(DSO_PATH).so.$(DSO_MAJOR).$(DSO_MINOR)
|
2019-08-31 23:16:55 +00:00
|
|
|
|
2019-09-07 17:10:37 +00:00
|
|
|
ifndef DONT_STRIP
|
|
|
|
INSTALL_STRIP := -s --strip-program=$(STRIP)
|
|
|
|
endif
|
|
|
|
|
2019-09-07 16:01:39 +00:00
|
|
|
$(DSO): $(OBJECTS)
|
2019-09-07 15:01:53 +00:00
|
|
|
$(LINK_DSO)
|
2019-09-07 13:51:17 +00:00
|
|
|
ln -sf $(DSO_NAME).so.$(DSO_MAJOR).$(DSO_MINOR) $(DSO_PATH).so.$(DSO_MINOR)
|
|
|
|
ln -sf $(DSO_NAME).so.$(DSO_MAJOR).$(DSO_MINOR) $(DSO_PATH).so
|
2019-08-27 22:29:46 +00:00
|
|
|
|
2019-09-07 15:59:48 +00:00
|
|
|
$(BUILD_DIR)/%.o: src/%.c | $(BUILD_DIR) ; $(CC_OBJ)
|
2019-09-07 13:51:17 +00:00
|
|
|
$(BUILD_DIR)/miniz.o: contrib/miniz/miniz.c | $(BUILD_DIR) ; $(CC_OBJ)
|
2019-09-07 15:59:48 +00:00
|
|
|
|
2019-09-07 17:25:27 +00:00
|
|
|
$(BUILD_DIR)/neatvnc.pc:
|
|
|
|
PREFIX=$(PREFIX) VERSION=$(VERSION) ./gen-pkgconfig.sh >$@
|
|
|
|
|
2019-09-07 16:40:14 +00:00
|
|
|
BENCH_DIR = $(BUILD_DIR)/bench
|
|
|
|
|
|
|
|
$(BENCH_DIR)/%.o: bench/%.c | $(BENCH_DIR)
|
2019-09-07 17:30:21 +00:00
|
|
|
$(CC_OBJ) $(shell $(PKGCONFIG) --cflags libpng)
|
2019-09-07 16:40:14 +00:00
|
|
|
|
|
|
|
$(BENCH_DIR): ; mkdir -p $@
|
|
|
|
$(BENCH_DIR)/zrle-bench:
|
|
|
|
$(BENCH_DIR)/zrle-bench: $(OBJECTS) $(BUILD_DIR)/pngfb.o \
|
|
|
|
$(BENCH_DIR)/zrle-bench.o
|
2019-09-07 17:30:21 +00:00
|
|
|
$(LINK_EXE) $(shell $(PKGCONFIG) --libs libpng)
|
2019-09-07 16:40:14 +00:00
|
|
|
|
2019-09-07 17:10:37 +00:00
|
|
|
.PHONY: install
|
2019-09-07 17:25:27 +00:00
|
|
|
install: $(DSO) $(BUILD_DIR)/neatvnc.pc
|
2019-09-07 17:10:37 +00:00
|
|
|
install $(INSTALL_STRIP) -Dt $(DESTDIR)$(PREFIX)/lib $(BUILD_DIR)/*.so*
|
2019-09-07 17:25:27 +00:00
|
|
|
install -Dt $(DESTDIR)$(PREFIX)/lib/pkgconfig $(BUILD_DIR)/neatvnc.pc
|
2019-09-14 17:47:30 +00:00
|
|
|
install -Dt $(DESTDIR)$(PREFIX)/include include/neatvnc.h
|
2019-09-07 17:10:37 +00:00
|
|
|
|
2019-09-07 16:40:14 +00:00
|
|
|
.PHONY: bench
|
|
|
|
bench: $(BENCH_DIR)/zrle-bench
|
|
|
|
./$(BENCH_DIR)/zrle-bench
|
|
|
|
|
2019-09-07 15:59:48 +00:00
|
|
|
.PHONY: examples
|
2019-09-07 16:01:39 +00:00
|
|
|
examples: $(DSO)
|
2019-09-07 15:59:48 +00:00
|
|
|
make -C examples \
|
|
|
|
BUILD_DIR=../$(BUILD_DIR)/examples \
|
|
|
|
LIB_PATH=../$(BUILD_DIR)
|