cake
/
libg1m
Archived
1
0
Fork 0

Added pkg config tool

This commit is contained in:
Thomas Touhey 2016-12-20 21:59:26 +01:00
parent b22f828046
commit a608bed911
5 changed files with 61 additions and 7 deletions

View File

@ -152,13 +152,20 @@ uninstall-lib: $(CHECKCFG)
install-cfgtool: $(CHECKCFG)
$(call imsg,Installing the configuration tool.)
$(call qcmd,$(INST) -m 755 -d "$(IBINDIR)")
$(call bcmd,write-cfg-tool,lib$(NAME),\
tools/write-config --name=lib$(NAME) --version=$(VERSION) \
$(call qcmd,tools/write-config --name=lib$(NAME) --version=$(VERSION) \
--author-name="$(AUTHOR)" --author-mail="$(AUTHOR_MAIL)" \
--incdir="$(IINCDIR)" --libdir="$(IBINDIR)" \
>"$(IBINDIR)/lib$(NAME)-config" \
&& chmod 755 "$(IBINDIR)/lib$(NAME)-config")
$(call imsg,Installing the pkg-config configuration.)
$(call qcmd,$(INST) -m 755 -d "$(IPKGDIR)")
$(call qcmd,tools/write-pkg-config --name=$(NAME) --version=$(VERSION) \
--description="$(DESCRIPTION)" \
--incdir="$(OIINCDIR)" --libdir="$(OILIBDIR)" \
>"$(IPKGDIR)/lib$(NAME).pc" \
&& chmod 644 "$(IPKGDIR)/lib$(NAME).pc")
# Uninstall it
uninstall-cfgtool: $(CHECKCFG)
$(call rmsg,Uninstalling configuration tool.)

View File

@ -14,8 +14,9 @@
#******************************************************************************#
# Project main information #
#******************************************************************************#
# Project name
# Project name and description
NAME := g1m
DESCRIPTION := Library for reading and writing CASIO files
# Author information
AUTHOR := Thomas \"Cakeisalie5\" Touhey
@ -114,8 +115,7 @@ $(eval $(call get-module-source,$(mod))))
# Look for headers #
#******************************************************************************#
# All headers
INC := \
$(basename $(shell find $(INCDIR) -name "*.h" -printf "%P\n"))
INC := $(basename $(shell find $(INCDIR) -name "*.h" -printf "%P\n"))
# Public headers only (not internals.h or internals/**/*.h)
INCPUB := \
@ -142,10 +142,15 @@ $(eval $(call check-man,$(patsubst .%,%,$(suffix $(doc))),$(basename $(doc)))))
#******************************************************************************#
# Check for DESTDIR (add as prefix to installation root) #
#******************************************************************************#
# Save original library and include dir.
OIINCDIR := $(IINCDIR)
OILIBDIR := $(ILIBDIR)
# Make it.
define add-dest-dir
$1 = $(DESTDIR)$($1)
endef
$(if $(DESTDIR), $(foreach idir,IBINDIR ILIBDIR IINCDIR IMANDIR, \
$(if $(DESTDIR), $(foreach idir,IBINDIR IPKGDIR ILIBDIR IINCDIR IMANDIR, \
$(eval $(call add-dest-dir,$(idir)))))
# END OF FILE

6
configure vendored
View File

@ -31,6 +31,7 @@ prefix_set=
bindir='${prefix}/bin'
libdir='${prefix}/lib'"$platform"
includedir='${prefix}/include'"$platform"
pkgdir='${libdir}/pkgconfig'
mandir='${prefix}/share/man'
# Installation options
@ -66,6 +67,7 @@ Installation directories:
Fine tuning of the installation directories:
--bindir=DIR executables [$bindir]
--pkgdir=DIR pkg-config configurations directory [$pkgdir]
--libdir=DIR library files of the linker [$libdir]
--includedir=DIR include files for the compiler [$includedir]
--mandir=DIR man root [$mandir]
@ -126,6 +128,7 @@ got '$level'"
--root=*) root="${arg#*=}" ;;
--prefix=*) prefix="${arg#*=}"; prefix_set=y ;;
--bindir=*) bindir="${arg#*=}" ;;
--pkgdir=*) pkgdir="${arg#*=}" ;;
--libdir=*) libdir="${arg#*=}" ;;
--includedir=*) includedir="${arg#*=}" ;;
--mandir=*) mandir="${arg#*=}" ;;
@ -143,7 +146,7 @@ fi
#******************************************************************************#
# Evaluate variables #
#******************************************************************************#
for var in prefix sysconfdir bindir libdir includedir mandir udevrulesdir; do
for var in prefix sysconfdir bindir libdir pkgdir includedir mandir; do
eval $var'='$(eval 'echo $'$var)
done
@ -166,6 +169,7 @@ cat <<EOF
# Installation directories
IBINDIR = $bindir
IPKGDIR = $pkgdir
ILIBDIR = $libdir
IINCDIR = $includedir
IMANDIR = $mandir

View File

@ -31,6 +31,7 @@ esac; done
#******************************************************************************#
cat <<_EOF
#!/bin/sh
cfgtool=\$(basename \$0)
#******************************************************************************#
# Help message #
#******************************************************************************#

37
tools/write-pkg-config Executable file
View File

@ -0,0 +1,37 @@
#!/bin/sh
#******************************************************************************#
# Defaults #
#******************************************************************************#
# Project variables
name="name"
description="my description"
version="<unknown version>"
# Directories
libdir=''
incdir=''
#******************************************************************************#
# Read arguments #
#******************************************************************************#
for arg ; do case "$arg" in
--name=*) name="${arg#*=}" ;;
--description=*) description="${arg#*=}" ;;
--version=*) version="${arg#*=}" ;;
--libdir=*) libdir="${arg#*=}" ;;
--incdir=*) incdir="${arg#*=}" ;;
esac; done
#******************************************************************************#
# Write result #
#******************************************************************************#
cat <<EOF
includedir=$incdir
libdir=$libdir
Name: lib$name
Description: $description
Version: $version
Cflags: -I $incdir
Libs: -L$libdir -l$name
EOF