generating pkg-config file in makefile
by SoftSprocket from LinuxQuestions.org on (#597RA)
I'm trying without success to generate a pkg-config file in a makefile. The closest I've got is this, however it doesn't preserve new lines.
Code:define PKG_CONFIG
prefix=$(PREFIX)
exec_prefix=${prefix}
includedir=${prefix}/include
libdir=${exec_prefix}/lib
Name: $(LIB_NAME)
Description: The SoftSprocket Audio Utilities Library
Version: $(MAJOR_VERSION)$(MINOR_VERSION)
Cflags: -I${includedir} `pkg-config --cflags gtk+-3.0` -pthread
Libs: -L${libdir} $(LDFLAGS)
endef
$(LIB_NAME).pc:
$(shell echo '$(PKG_CONFIG)' > $@)
I have also tried addng -e and tried echoing to cat but both accomplish the same thing:
Code: $(shell echo -e '$(PKG_CONFIG)' | cat >> $@)
$(shell echo -e '$(PKG_CONFIG)' > $@)output:
Code:-e prefix=/usrexec_prefix=includedir=/includelibdir=/libName: libsoftsprocketaudioDescription: The SoftSprocket Audio Utilities LibraryVersion: 1.0Cflags: -I `pkg-config --cflags gtk+-3.0` -pthreadLibs: -L -lm -ljack `pkg-config --libs gtk+-3.0I have tried adding \n and \\n without success.
What am I missing here?


Code:define PKG_CONFIG
prefix=$(PREFIX)
exec_prefix=${prefix}
includedir=${prefix}/include
libdir=${exec_prefix}/lib
Name: $(LIB_NAME)
Description: The SoftSprocket Audio Utilities Library
Version: $(MAJOR_VERSION)$(MINOR_VERSION)
Cflags: -I${includedir} `pkg-config --cflags gtk+-3.0` -pthread
Libs: -L${libdir} $(LDFLAGS)
endef
$(LIB_NAME).pc:
$(shell echo '$(PKG_CONFIG)' > $@)
I have also tried addng -e and tried echoing to cat but both accomplish the same thing:
Code: $(shell echo -e '$(PKG_CONFIG)' | cat >> $@)
$(shell echo -e '$(PKG_CONFIG)' > $@)output:
Code:-e prefix=/usrexec_prefix=includedir=/includelibdir=/libName: libsoftsprocketaudioDescription: The SoftSprocket Audio Utilities LibraryVersion: 1.0Cflags: -I `pkg-config --cflags gtk+-3.0` -pthreadLibs: -L -lm -ljack `pkg-config --libs gtk+-3.0I have tried adding \n and \\n without success.
What am I missing here?