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.
CFLAGS
, this part:CFLAGS?=-std=c11
should be:CFLAGS := -std=c11