how to use pkg-config or something equivalent in makefile
- by make
Hi ,
Could someone please tell us how to use pkg-config in Makefile. here is an exp:
`pkg-config --cflags --libs protobuf`
Makefile file
CXX = g++
CXXFLAGS = -Wall -ansi -pedantic -g
#
# I tried this line, but not working
PKGS = `pkg-config --cflags --libs protobuf`
#
ifeq ($(shell uname),SunOS)
LIBS = -lsocket -lnsl
endif
all: file1.cpp
file1: file1.cpp xx.pb.cc xx.pb.h
$(CXX) $(CXXFLAGS) -o file1 file1.cpp xx.pb.cc $(LIBS) $(PKGS)
clean:
$(RM) file1
Thanks for your help and replies -