From d2dc5ff91cf834fc23fd0c0ac8a34dc6942873ce Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Sun, 9 Feb 2020 11:53:10 +0000 Subject: [PATCH] Remove makefiles in favour of meson I'd rather maintain a single set of build scripts --- Makefile | 68 ----------------------------------------------- common.mk | 51 ----------------------------------- examples/Makefile | 24 ----------------- gen-pkgconfig.sh | 13 --------- 4 files changed, 156 deletions(-) delete mode 100644 Makefile delete mode 100644 common.mk delete mode 100644 examples/Makefile delete mode 100755 gen-pkgconfig.sh diff --git a/Makefile b/Makefile deleted file mode 100644 index 2d4bf77..0000000 --- a/Makefile +++ /dev/null @@ -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) diff --git a/common.mk b/common.mk deleted file mode 100644 index d11e515..0000000 --- a/common.mk +++ /dev/null @@ -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 := diff --git a/examples/Makefile b/examples/Makefile deleted file mode 100644 index 4c008d1..0000000 --- a/examples/Makefile +++ /dev/null @@ -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 - diff --git a/gen-pkgconfig.sh b/gen-pkgconfig.sh deleted file mode 100755 index b30f22d..0000000 --- a/gen-pkgconfig.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/bash - -cat <