Article 597RA generating pkg-config file in makefile

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?latest?d=yIl2AUoC8zA latest?i=2mb_W-1L1RM:4oy9X9NRRZ4:F7zBnMy latest?i=2mb_W-1L1RM:4oy9X9NRRZ4:V_sGLiP latest?d=qj6IDK7rITs latest?i=2mb_W-1L1RM:4oy9X9NRRZ4:gIN9vFw2mb_W-1L1RM
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments