crosvm/rutabaga_gfx/ffi/Makefile
Gurchetan Singh 35e268ae2a rutabaga_gfx/ffi: modify makefile to create includedir
It's more traditional to install headers this way.

BUG=b:273555494
TEST=compile

Change-Id: I9cbcee18adf488fe54a0630ab9229ae231b16692
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4409071
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2023-04-08 00:02:22 +00:00

45 lines
1.2 KiB
Makefile

# 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
includedir = ${prefix}/include/rutabaga_gfx
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
LIB_NAME := librutabaga_gfx_ffi.so
RUTABAGA_VERSION := $(RUTABAGA_VERSION_MAJOR).1.1-alpha.1
all: build
build:
cargo build --features=gfxstream $(release)
install: build
install -D -m 755 $(OUT)/$(LIB_NAME) $(DESTDIR)$(libdir)
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)
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
clean:
cargo clean $(release)
distclean:
cargo clean $(release)
help:
@echo "usage: make $(prog) [debug=1]"