Sample Header Ad - 728x90

pkg-config output not working with makefile?

2 votes
1 answer
6784 views
I'm trying to run the _makefile_, shown in this repo , which is a simple Wayland client. But when I run _make_, it seems that the output of $(WAYLAND) is blank, and it fails to compile due to not being able to find the necessary _wayland-client.h_ header file. cc (GCC) version 5.3.1 on Fedora 23 in bash. Below are some details. My question is, what mistake am I making with my environment that is preventing this _makefile_ from working for me as intended? Contents of _makefile_: WAYLAND=pkg-config wayland-client --cflags --libs CFLAGS?=-std=c11 -Wall -Werror -O3 -fvisibility=hidden hello_wayland: hello_wayland.o helpers.o helpers.h images.bin $(CC) -o hello_wayland *.o $(WAYLAND) -lrt images.bin: images/convert.py images/window.png images/fish.png images/convert.py cat window.bin fish.bin > images.bin clean: $(RM) *.o fish.bin window.bin hello_wayland Output of _make_: > cc -std=c11 -Wall -Werror -O3 -fvisibility=hidden -c -o hello_wayland.o hello_wayland.c hello_wayland.c:6:28: fatal error: wayland-client.h: No such file or directory Notice how the options to _cc_ above seem to be missing the output of $(WAYLAND) specified in _makefile_. If I manually execute _cc_ like this: cc -std=c11 -Wall -Werror -O3 -fvisibility=hidden -c -o hello_wayland.o hello_wayland.c \ -I/home/me/install/include -L/home/me/install/lib -lwayland-client The compilation succeeds. Output of _pkg-config wayland-client --cflags --libs_: > -I/home/me/install/include -L/home/me/install/lib -lwayland-client Contents of *~/.bash_profile*: source ~/.profile source ~/.bashrc Relevant contents of _~/.bashrc_: export WLD=$HOME/install export LD_LIBRARY_PATH=$WLD/lib export PKG_CONFIG_PATH=$WLD/lib/pkgconfig/:$WLD/share/pkgconfig/ export PATH=$WLD/bin:$PATH export ACLOCAL_PATH=$WLD/share/aclocal export ACLOCAL="aclocal -I $ACLOCAL_PATH" Thanks for pointing out something that should probably be totally obvious to me.
Asked by ybakos (234 rep)
Mar 20, 2016, 05:36 PM
Last activity: Feb 10, 2020, 07:49 AM