Remove makefiles in favour of meson

I'd rather maintain a single set of build scripts
pull/22/head
Andri Yngvason 2020-02-09 11:53:10 +00:00
parent 3ecede86c3
commit d2dc5ff91c
4 changed files with 0 additions and 156 deletions

View File

@ -1,68 +0,0 @@
DEPENDENCIES := pixman-1 libuv libturbojpeg
SOURCES := \
src/server.c \
src/util.c \
src/vec.c \
src/zrle.c \
src/tight.c \
src/raw-encoding.c \
src/pixels.c \
src/damage.c \
src/fb.c \
include common.mk
VERSION=0.0.0
DSO_NAME=libneatvnc
DSO_MAJOR=0
DSO_MINOR=0
CFLAGS += -fvisibility=hidden -Icontrib/miniz
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)
ln -sf $(DSO_NAME).so.$(DSO_MAJOR).$(DSO_MINOR) $(DSO_PATH).so
$(BUILD_DIR)/%.o: src/%.c | $(BUILD_DIR) ; $(CC_OBJ)
$(BUILD_DIR)/miniz.o: contrib/miniz/miniz.c | $(BUILD_DIR) ; $(CC_OBJ)
$(BUILD_DIR)/neatvnc.pc:
PREFIX=$(PREFIX) VERSION=$(VERSION) ./gen-pkgconfig.sh >$@
BENCH_DIR = $(BUILD_DIR)/bench
$(BENCH_DIR)/%.o: bench/%.c | $(BENCH_DIR)
$(CC_OBJ) $(shell $(PKGCONFIG) --cflags libpng)
$(BENCH_DIR): ; mkdir -p $@
$(BENCH_DIR)/zrle-bench:
$(BENCH_DIR)/zrle-bench: $(OBJECTS) $(BUILD_DIR)/pngfb.o \
$(BENCH_DIR)/zrle-bench.o
$(LINK_EXE) $(shell $(PKGCONFIG) --libs libpng)
.PHONY: install
install: $(DSO) $(BUILD_DIR)/neatvnc.pc
install $(INSTALL_STRIP) -Dt $(DESTDIR)$(PREFIX)/lib $(BUILD_DIR)/*.so*
install -Dt $(DESTDIR)$(PREFIX)/lib/pkgconfig $(BUILD_DIR)/neatvnc.pc
install -Dt $(DESTDIR)$(PREFIX)/include include/neatvnc.h
.PHONY: bench
bench: $(BENCH_DIR)/zrle-bench
./$(BENCH_DIR)/zrle-bench
.PHONY: examples
examples: $(DSO)
make -C examples \
BUILD_DIR=../$(BUILD_DIR)/examples \
LIB_PATH=../$(BUILD_DIR)

View File

@ -1,51 +0,0 @@
MACHINE := $(shell $(CC) -dumpmachine)
ARCH := $(firstword $(subst -, ,$(MACHINE)))
BUILD_DIR ?= build-$(MACHINE)
PREFIX ?= /usr/local
ifeq ($(ARCH),x86_64)
ARCH_CFLAGS := -mavx
else
ifeq ($(ARCH),arm)
ARCH_CFLAGS := -mfpu=neon
endif # end arm block
endif # end x86_64 block
ifeq (, $(shell which $(MACHINE)-strip 2>/dev/null))
STRIP ?= strip
else
STRIP ?= $(MACHINE)-strip
endif
ifeq (, $(shell which $(MACHINE)-pkg-config 2>/dev/null))
PKGCONFIG ?= pkg-config
else
PKGCONFIG ?= $(MACHINE)-pkg-config
endif
CFLAGS ?= -g -O3 $(ARCH_CFLAGS) -flto -DNDEBUG
LDFLAGS ?= -flto
CFLAGS += -std=gnu11 -D_GNU_SOURCE -Iinclude
CC_OBJ = $(CC) -c $(CFLAGS) $< -o $@ -MMD -MP -MF $(@:.o=.deps)
LINK_EXE = $(CC) $^ $(LDFLAGS) -o $@
LINK_DSO = $(CC) -fPIC -shared $^ $(LDFLAGS) -o $@
CFLAGS += $(foreach dep,$(DEPENDENCIES),$(shell $(PKGCONFIG) --cflags $(dep)))
LDFLAGS += $(foreach dep,$(DEPENDENCIES),$(shell $(PKGCONFIG) --libs $(dep)))
OBJECTS := $(SOURCES:src/%.c=$(BUILD_DIR)/%.o)
$(BUILD_DIR): ; mkdir -p $(BUILD_DIR)
.PHONY: clean
clean: ; rm -rf $(BUILD_DIR)
-include $(BUILD_DIR)/*.deps
.SUFFIXES:
.SECONDARY:
# This clears the default target set by this file
.DEFAULT_GOAL :=

View File

@ -1,24 +0,0 @@
DEPENDENCIES := libpng pixman-1 libuv
include ../common.mk
ifdef LIB_PATH
LDFLAGS += -L$(LIB_PATH) -Wl,-rpath=$(shell pwd)/$(LIB_PATH)
endif
LDFLAGS += -lneatvnc
all: \
$(BUILD_DIR)/png-server \
$(BUILD_DIR)/draw \
$(BUILD_DIR)/png-server: $(BUILD_DIR)/png-server.o $(BUILD_DIR)/pngfb.o
$(LINK_EXE)
$(BUILD_DIR)/draw: $(BUILD_DIR)/draw.o ; $(LINK_EXE)
$(BUILD_DIR)/%.o: %.c | $(BUILD_DIR) ; $(CC_OBJ)
$(BUILD_DIR)/pngfb.o: ../src/pngfb.c | $(BUILD_DIR)
$(CC_OBJ) -I../include

View File

@ -1,13 +0,0 @@
#!/usr/bin/bash
cat <<EOF
prefix=$PREFIX
libdir=\${prefix}/lib
includedir=\${prefix}/include
Name: neatvnc
Description: A neat VNC server library
Version: $VERSION
Libs: -L\${libdir} -lneatvnc
Cflags: -I\${includedir}
EOF