Merge /u/gmbr3/gnu-efi/ branch pkgconf2 into master

https://sourceforge.net/p/gnu-efi/code/merge-requests/45/
This commit is contained in:
b'Nigel Croxon 2023-04-17 11:36:22 +00:00
commit e0e1f53ce2
5 changed files with 36 additions and 12 deletions

View File

@ -59,8 +59,10 @@ is_absolute = $(subst $(call stripped,$(1)),$(empty),$(call unstripped,$(1)))
override INSTALLROOT:=$(if $(call is_absolute,$(INSTALLROOT)),,$(TOPDIR)/)$(INSTALLROOT)
PREFIX := /usr/local
LIBDIR := $(PREFIX)/lib
INSTALL := install
EXEC_PREFIX := $(PREFIX)
LIBDIR := $(EXEC_PREFIX)/lib
INCLUDEDIR := $(PREFIX)/include
INSTALL := install
# Compilation tools
HOSTCC := $(prefix)gcc

View File

@ -34,7 +34,7 @@
# SUCH DAMAGE.
#
VERSION = 3.0.15
export VERSION = 3.0.15
MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
SRCDIR = $(dir $(MKFILE_PATH))

View File

@ -43,6 +43,7 @@ include $(SRCDIR)/../Make.defaults
TOPDIR = $(SRCDIR)/..
CDIR=$(TOPDIR)/..
PKGCONFIGDIR ?= $(LIBDIR)/pkgconfig
FILES = reloc_$(ARCH)
OBJS = $(FILES:%=%.o)
@ -52,11 +53,20 @@ reloc_aarch64.o: CFLAGS += -fno-jump-tables
TARGETS = crt0-efi-$(ARCH).o libgnuefi.a
all: $(TARGETS)
all: $(TARGETS) gnu-efi.pc
libgnuefi.a: $(OBJS)
$(AR) $(ARFLAGS) $@ $^
gnu-efi.pc:
sed \
-e 's:@PREFIX@:$(PREFIX):g' \
-e 's:@EXEC_PREFIX@:$(EXEC_PREFIX):g' \
-e 's:@INCLUDEDIR@:$(INCLUDEDIR):g' \
-e 's:@LIBDIR@:$(LIBDIR):g' \
-e 's:@VERSION@:$(VERSION):g' \
$(SRCDIR)/gnu-efi.pc.in > gnu-efi.pc
clean:
rm -f $(TARGETS) *~ *.o $(OBJS)
@ -73,5 +83,7 @@ ifneq (,$(findstring FreeBSD,$(OS)))
else
$(INSTALL) -m 644 $(SRCDIR)/elf_$(ARCH)_efi.lds $(INSTALLROOT)$(LIBDIR)
endif
$(INSTALL) -d $(INSTALLROOT)$(PKGCONFIGDIR)
$(INSTALL) -m 644 gnu-efi.pc $(INSTALLROOT)$(PKGCONFIGDIR)
include $(SRCDIR)/../Make.rules

10
gnuefi/gnu-efi.pc.in Normal file
View File

@ -0,0 +1,10 @@
prefix=@PREFIX@
exec_prefix=@EXEC_PREFIX@
includedir=@INCLUDEDIR@
libdir=@LIBDIR@
Name: gnu-efi
Description: EFI development toolkit
Version: @VERSION@
Cflags: -I${includedir}/efi
Libs: -lefi

View File

@ -13,15 +13,15 @@ all:
clean:
install:
mkdir -p $(INSTALLROOT)$(PREFIX)/include/efi
mkdir -p $(INSTALLROOT)$(PREFIX)/include/efi/protocol
mkdir -p $(INSTALLROOT)$(PREFIX)/include/efi/$(ARCH)
$(INSTALL) -m 644 $(SRCDIR)/*.h $(INSTALLROOT)$(PREFIX)/include/efi
$(INSTALL) -m 644 $(SRCDIR)/protocol/*.h $(INSTALLROOT)$(PREFIX)/include/efi/protocol
$(INSTALL) -m 644 $(SRCDIR)/$(ARCH)/*.h $(INSTALLROOT)$(PREFIX)/include/efi/$(ARCH)
mkdir -p $(INSTALLROOT)$(INCLUDEDIR)/efi
mkdir -p $(INSTALLROOT)$(INCLUDEDIR)/efi/protocol
mkdir -p $(INSTALLROOT)$(INCLUDEDIR)/efi/$(ARCH)
$(INSTALL) -m 644 $(SRCDIR)/*.h $(INSTALLROOT)$(INCLUDEDIR)/efi
$(INSTALL) -m 644 $(SRCDIR)/protocol/*.h $(INSTALLROOT)$(INCLUDEDIR)/efi/protocol
$(INSTALL) -m 644 $(SRCDIR)/$(ARCH)/*.h $(INSTALLROOT)$(INCLUDEDIR)/efi/$(ARCH)
ifeq ($(ARCH),ia64)
mkdir -p $(INSTALLROOT)$(PREFIX)/include/efi/protocol/ia64
$(INSTALL) -m 644 $(SRCDIR)/protocol/ia64/*.h $(INSTALLROOT)$(PREFIX)/include/efi/protocol/ia64
mkdir -p $(INSTALLROOT)$(INCLUDEDIR)/efi/protocol/ia64
$(INSTALL) -m 644 $(SRCDIR)/protocol/ia64/*.h $(INSTALLROOT)$(INCLUDEDIR)/efi/protocol/ia64
endif
include $(SRCDIR)/../Make.rules