Remove makefiles
parent
f0bca570b2
commit
03c62d6ef5
43
Makefile
43
Makefile
|
@ -1,43 +0,0 @@
|
|||
DEPENDENCIES := libuv egl glesv2 wayland-client neatvnc pixman-1
|
||||
|
||||
EXEC := wayvnc
|
||||
|
||||
SOURCES := \
|
||||
src/main.c \
|
||||
src/render.c \
|
||||
src/dmabuf.c \
|
||||
src/strlcpy.c \
|
||||
src/shm.c \
|
||||
src/screencopy.c \
|
||||
|
||||
include common.mk
|
||||
|
||||
PROTOCOLS := \
|
||||
$(BUILD_DIR)/proto-wlr-export-dmabuf-unstable-v1.o \
|
||||
$(BUILD_DIR)/proto-wlr-screencopy-unstable-v1.o \
|
||||
|
||||
VERSION=0.0.0
|
||||
|
||||
ifndef DONT_STRIP
|
||||
INSTALL_STRIP := -s --strip-program=$(STRIP)
|
||||
endif
|
||||
|
||||
all: $(BUILD_DIR)/$(EXEC) | proto
|
||||
|
||||
$(BUILD_DIR)/%.o: src/%.c | $(BUILD_DIR) ; $(CC_OBJ)
|
||||
$(BUILD_DIR)/proto-%.o: protocols/build/%.c | $(BUILD_DIR) ; $(CC_OBJ)
|
||||
$(BUILD_DIR)/$(EXEC): $(OBJECTS) $(PROTOCOLS) | $(BUILD_DIR) ; $(LINK_EXE)
|
||||
|
||||
.PHONY: install
|
||||
install: $(EXEC)
|
||||
install $(INSTALL_STRIP) -Dt $(DESTDIR)$(PREFIX)/bin $(BUILD_DIR)/$(EXEC)
|
||||
|
||||
.PHONY: proto
|
||||
proto:
|
||||
make -C protocols
|
||||
|
||||
.PHONY: proto_clean
|
||||
proto_clean:
|
||||
make -C protocols clean
|
||||
|
||||
clean: proto_clean
|
50
common.mk
50
common.mk
|
@ -1,50 +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 -Iprotocols/build
|
||||
|
||||
CC_OBJ = $(CC) -c $(CFLAGS) $< -o $@ -MMD -MP -MF $(@:.o=.deps)
|
||||
LINK_EXE = $(CC) $^ $(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 :=
|
|
@ -1,26 +0,0 @@
|
|||
WAYLAND_SCANNER ?= wayland-scanner
|
||||
|
||||
PROTOCOLS := \
|
||||
wlr-export-dmabuf-unstable-v1.xml \
|
||||
wlr-screencopy-unstable-v1.xml \
|
||||
|
||||
SOURCES := $(PROTOCOLS:%.xml=build/%.c)
|
||||
HEADERS := $(PROTOCOLS:%.xml=build/%.h)
|
||||
|
||||
all: $(SOURCES) $(HEADERS)
|
||||
|
||||
build:
|
||||
mkdir -p build
|
||||
|
||||
build/%.c: %.xml | build
|
||||
$(WAYLAND_SCANNER) private-code $< $@
|
||||
|
||||
build/%.h: %.xml | build
|
||||
$(WAYLAND_SCANNER) client-header $< $@
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf build
|
||||
|
||||
.SUFFIXES:
|
||||
.SECONDARY:
|
Loading…
Reference in New Issue