Skip to content

Commit 34cf6bb

Browse files
committed
Install a libflame.pc file
1 parent b112dd8 commit 34cf6bb

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

Makefile

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,10 @@ MK_LIBS_SYML := $(strip $(MK_LIBS_SYML))
214214
# Set the path to the subdirectory of the include installation directory.
215215
MK_INCL_DIR_INST := $(INSTALL_INCDIR)
216216

217+
PC_DIR_INST := $(INSTALL_LIBDIR)/pkgconfig
218+
PC_IN_FILE := libflame.pc.in
219+
PC_OUT_FILE := libflame.pc
220+
217221

218222

219223
#
@@ -411,7 +415,7 @@ all: libs
411415

412416
libs: libflame
413417

414-
install: libs install-libs install-lib-symlinks install-headers
418+
install: libs install-libs install-lib-symlinks install-headers $(PC_DIR_INST)
415419

416420
uninstall: uninstall-libs uninstall-lib-symlinks uninstall-headers
417421

@@ -705,6 +709,21 @@ else
705709
@$(MV) $(@F) $(INSTALL_LIBDIR)/
706710
endif
707711

712+
$(PC_DIR_INST): $(PC_IN_FILE)
713+
$(MKDIR) $(@)
714+
ifeq ($(ENABLE_VERBOSE),no)
715+
@echo "Installing $(PC_OUT_FILE) into $(@)/"
716+
endif
717+
$(shell cat "$(PC_IN_FILE)" \
718+
| sed -e "s#@PACKAGE_VERSION@#$(VERSION)#g" \
719+
| sed -e "s#@prefix@#$(prefix)#g" \
720+
| sed -e "s#@exec_prefix@#$(exec_prefix)#g" \
721+
| sed -e "s#@libdir@#$(libdir)#g" \
722+
| sed -e "s#@includedir@#$(includedir)#g" \
723+
| sed -e "s#@LDFLAGS@#$(LDFLAGS)#g" \
724+
> "$(PC_OUT_FILE)" )
725+
$(INSTALL) -m 0644 $(PC_OUT_FILE) $(@)
726+
708727

709728
# --- Clean rules ---
710729

@@ -751,6 +770,7 @@ ifeq ($(ENABLE_VERBOSE),yes)
751770
- $(RM_RF) $(OBJ_DIR)
752771
- $(RM_RF) $(LIB_DIR)
753772
- $(RM_RF) $(INC_DIR)
773+
- $(RM_RF) $(PC_OUT_FILE)
754774
- $(RM_RF) config.log
755775
- $(RM_RF) aclocal.m4
756776
- $(RM_RF) autom4te.cache
@@ -762,6 +782,8 @@ else
762782
@$(RM_F) $(AR_OBJ_LIST_FILE)
763783
@echo "Removing $(CONFIG_DIR)"
764784
@$(RM_RF) $(CONFIG_DIR)
785+
@echo "Removing $(PC_OUT_FILE)"
786+
@$(RM_F) $(PC_OUT_FILE)
765787
@echo "Removing $(OBJ_DIR)"
766788
@$(RM_RF) $(OBJ_DIR)
767789
@echo "Removing $(LIB_DIR)"

libflame.pc.in

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
prefix=@prefix@
2+
exec_prefix=@exec_prefix@
3+
libdir=@libdir@
4+
includedir=@includedir@
5+
6+
Name: libflame
7+
Description: A portable library for dense matrix computations, providing much of the functionality present in LAPACK
8+
Version: @PACKAGE_VERSION@
9+
Libs: -L${libdir} -lflame
10+
Libs.private: @LDFLAGS@
11+
Cflags: -I${includedir}/libflame

0 commit comments

Comments
 (0)