Hello all o/,
I'm starting to move some of my older projects from naf shellscripts which compile my code to a naf Makefile which compiles the code. For some of the projects which don't use external libraries, it's easy. However for a few I'm stumped. I've got a workaround, but it's a pretty naf one.
So, essentially. How can I add pkg-config variables to my makefile ?
Code:
# Makefile.
#
CC=gcc
CFLAGS=-Wall -pedantic
PKGCFG=`pkg-config --cflags --libs gtk+-2.0`
# CC+=${PKGCFG} # The evil workaround I mentioned.
all: ExcuseGen
ExcuseGen: main.o
${CC} -o ExcuseGen main.o ${PKGCFG}
main.o: main.c
clean:
rm -f ExcuseGen *.core *.o
Any suggestions would be a great help!