git.y1.nz

SameBoy

Accurate GB/GBC emulator
download: https://git.y1.nz/archives/sameboy.tar.gz
README | Files | Log | Refs | LICENSE

commit 6549684e1f04ec5435f02f30cb0e88869ae3df8f
parent 150855f2e9695121b9cf78b5c980e69726136ae9
Author: Lior Halphon <LIJI32@gmail.com>
Date:   Wed, 11 Dec 2024 20:29:04 +0200

Make libsameboy installable, including pkg-config support. Closes #662

Diffstat:
MMakefile18++++++++++++++++--
Asameboy.pc.in12++++++++++++
2 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile @@ -41,10 +41,10 @@ ifeq ($(PLATFORM),windows32) NULL := NUL endif +PREFIX ?= /usr/local ifneq ($(shell which xdg-open 2> $(NULL))$(FREEDESKTOP),) # Running on an FreeDesktop environment, configure for (optional) installation DESTDIR ?= -PREFIX ?= /usr/local DATA_DIR ?= $(PREFIX)/share/sameboy/ FREEDESKTOP ?= true endif @@ -114,6 +114,8 @@ BIN := build/bin OBJ := build/obj INC := build/include/sameboy LIBDIR := build/lib +PKGCONF_DIR := $(LIBDIR)/pkgconfig +PKGCONF_FILE := $(PKGCONF_DIR)/sameboy.pc BOOTROMS_DIR ?= $(BIN)/BootROMs @@ -837,7 +839,19 @@ ifeq ($(CONF), release) $(CODESIGN)$@ endif - +$(PKGCONF_FILE): sameboy.pc.in + -@$(MKDIR) -p $(dir $@) + -@rm -f $@ + sed -e 's,@prefix@,$(PREFIX),' \ + -e 's/@version@/$(VERSION)/' $< > $@ + +lib-install: lib $(PKGCONF_FILE) + install -d $(DESTDIR)$(PREFIX)/lib/pkgconfig + install -d $(DESTDIR)$(PREFIX)/include/sameboy + install -m 644 $(LIBDIR)/libsameboy.a $(LIBDIR)/libsameboy.$(DL_EXT) $(DESTDIR)$(PREFIX)/lib/ + install -m 644 $(INC)/* $(DESTDIR)$(PREFIX)/include/sameboy/ + install -m 644 $(PKGCONF_FILE) $(DESTDIR)$(PREFIX)/lib/pkgconfig + # Windows dll # To avoid Windows' sort.exe diff --git a/sameboy.pc.in b/sameboy.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=${prefix} +includedir=${prefix}/include +libdir=${prefix}/lib + +Name: sameboy +Description: SameBoy's emulation core as a library +Version: @version@ +Cflags: -I${includedir} +Libs: -L${libdir} -lsameboy +Libs.private: -lm -lc +

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.