2023-03-14 18:18:34 +00:00
|
|
|
# Copyright 2023 The ChromiumOS Authors
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
|
|
|
prefix ?= /usr/local
|
|
|
|
libdir = ${prefix}/lib
|
2023-04-04 16:35:07 +00:00
|
|
|
includedir = ${prefix}/include/rutabaga_gfx
|
2023-03-14 18:18:34 +00:00
|
|
|
|
2023-05-08 17:04:45 +00:00
|
|
|
UNAME := $(shell uname -s)
|
|
|
|
|
2023-03-14 18:18:34 +00:00
|
|
|
ifdef debug
|
|
|
|
release :=
|
|
|
|
target :=debug
|
|
|
|
extension :=debug
|
|
|
|
OUT = target/debug
|
|
|
|
else
|
|
|
|
release :=--release
|
|
|
|
target :=release
|
|
|
|
extension :=
|
|
|
|
OUT = target/release
|
|
|
|
endif
|
|
|
|
|
|
|
|
RUTABAGA_VERSION_MAJOR := 0
|
|
|
|
SRC ?= src
|
2023-05-08 17:04:45 +00:00
|
|
|
|
|
|
|
ifeq ($(UNAME), Linux)
|
2023-03-14 18:18:34 +00:00
|
|
|
LIB_NAME := librutabaga_gfx_ffi.so
|
2023-05-08 17:04:45 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(UNAME), Darwin)
|
|
|
|
LIB_NAME := librutabaga_gfx_ffi.dylib
|
|
|
|
endif
|
|
|
|
|
2023-03-14 18:18:34 +00:00
|
|
|
RUTABAGA_VERSION := $(RUTABAGA_VERSION_MAJOR).1.1-alpha.1
|
|
|
|
|
|
|
|
all: build
|
|
|
|
|
|
|
|
build:
|
2023-03-23 18:18:15 +00:00
|
|
|
cargo build --features=gfxstream $(release)
|
2023-03-14 18:18:34 +00:00
|
|
|
|
|
|
|
install: build
|
2023-05-08 17:04:45 +00:00
|
|
|
ifeq ($(UNAME), Linux)
|
2023-03-14 18:18:34 +00:00
|
|
|
install -D -m 755 $(OUT)/$(LIB_NAME) $(DESTDIR)$(libdir)
|
2023-05-08 17:04:45 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(UNAME), Darwin)
|
|
|
|
install_name_tool -id $(DESTDIR)$(libdir)/$(LIB_NAME) $(DESTDIR)$(libdir)/$(LIB_NAME)
|
|
|
|
endif
|
2023-03-14 18:18:34 +00:00
|
|
|
ln -sf $(DESTDIR)$(prefix)/$(LIB_NAME) $(DESTDIR)$(libdir)/$(LIB_NAME).$(RUTABAGA_VERSION)
|
|
|
|
ln -sf $(DESTDIR)$(prefix)/$(LIB_NAME) $(DESTDIR)$(libdir)/$(LIB_NAME).$(RUTABAGA_VERSION_MAJOR)
|
2023-05-08 17:04:45 +00:00
|
|
|
ifeq ($(UNAME), Linux)
|
2023-03-14 18:18:34 +00:00
|
|
|
install -D -m 0644 $(SRC)/share/rutabaga_gfx_ffi.pc $(DESTDIR)$(libdir)/pkgconfig/rutabaga_gfx_ffi.pc
|
|
|
|
install -D -m 0644 $(SRC)/include/rutabaga_gfx_ffi.h $(DESTDIR)$(includedir)/rutabaga_gfx_ffi.h
|
2023-05-08 17:04:45 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(UNAME), Darwin)
|
|
|
|
install -m 0644 $(SRC)/share/rutabaga_gfx_ffi.pc $(DESTDIR)$(libdir)/pkgconfig/rutabaga_gfx_ffi.pc
|
|
|
|
install -m 0644 $(SRC)/include/rutabaga_gfx_ffi.h $(DESTDIR)$(includedir)/rutabaga_gfx_ffi.h
|
|
|
|
endif
|
2023-03-14 18:18:34 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
cargo clean $(release)
|
|
|
|
|
|
|
|
distclean:
|
|
|
|
cargo clean $(release)
|
|
|
|
|
|
|
|
help:
|
|
|
|
@echo "usage: make $(prog) [debug=1]"
|