Skip to content

Commit

Permalink
Install a libflame.pc file
Browse files Browse the repository at this point in the history
  • Loading branch information
haampie committed Jun 4, 2021
1 parent b112dd8 commit 34cf6bb
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
24 changes: 23 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ MK_LIBS_SYML := $(strip $(MK_LIBS_SYML))
# Set the path to the subdirectory of the include installation directory.
MK_INCL_DIR_INST := $(INSTALL_INCDIR)

PC_DIR_INST := $(INSTALL_LIBDIR)/pkgconfig
PC_IN_FILE := libflame.pc.in
PC_OUT_FILE := libflame.pc



#
Expand Down Expand Up @@ -411,7 +415,7 @@ all: libs

libs: libflame

install: libs install-libs install-lib-symlinks install-headers
install: libs install-libs install-lib-symlinks install-headers $(PC_DIR_INST)

uninstall: uninstall-libs uninstall-lib-symlinks uninstall-headers

Expand Down Expand Up @@ -705,6 +709,21 @@ else
@$(MV) $(@F) $(INSTALL_LIBDIR)/
endif

$(PC_DIR_INST): $(PC_IN_FILE)
$(MKDIR) $(@)
ifeq ($(ENABLE_VERBOSE),no)
@echo "Installing $(PC_OUT_FILE) into $(@)/"
endif
$(shell cat "$(PC_IN_FILE)" \
| sed -e "s#@PACKAGE_VERSION@#$(VERSION)#g" \
| sed -e "s#@prefix@#$(prefix)#g" \
| sed -e "s#@exec_prefix@#$(exec_prefix)#g" \
| sed -e "s#@libdir@#$(libdir)#g" \
| sed -e "s#@includedir@#$(includedir)#g" \
| sed -e "s#@LDFLAGS@#$(LDFLAGS)#g" \
> "$(PC_OUT_FILE)" )
$(INSTALL) -m 0644 $(PC_OUT_FILE) $(@)


# --- Clean rules ---

Expand Down Expand Up @@ -751,6 +770,7 @@ ifeq ($(ENABLE_VERBOSE),yes)
- $(RM_RF) $(OBJ_DIR)
- $(RM_RF) $(LIB_DIR)
- $(RM_RF) $(INC_DIR)
- $(RM_RF) $(PC_OUT_FILE)
- $(RM_RF) config.log
- $(RM_RF) aclocal.m4
- $(RM_RF) autom4te.cache
Expand All @@ -762,6 +782,8 @@ else
@$(RM_F) $(AR_OBJ_LIST_FILE)
@echo "Removing $(CONFIG_DIR)"
@$(RM_RF) $(CONFIG_DIR)
@echo "Removing $(PC_OUT_FILE)"
@$(RM_F) $(PC_OUT_FILE)
@echo "Removing $(OBJ_DIR)"
@$(RM_RF) $(OBJ_DIR)
@echo "Removing $(LIB_DIR)"
Expand Down
11 changes: 11 additions & 0 deletions libflame.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@

Name: libflame
Description: A portable library for dense matrix computations, providing much of the functionality present in LAPACK
Version: @PACKAGE_VERSION@
Libs: -L${libdir} -lflame
Libs.private: @LDFLAGS@
Cflags: -I${includedir}/libflame

0 comments on commit 34cf6bb

Please sign in to comment.