Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Makefile for cheako-vulkan
- .SUFFIXES: .h.in .h # Add .h.in and .h as suffixes
- M4 = m4
- M4FLAGS =
- M4SCRIPT =
- %.h: %.h.in
- ${M4} ${M4FLAGS} ${M4SCRIPT} $< > $*.h
- %.so: %.c
- $(COMPILE.c) -shared $(OUTPUT_OPTION) $<
- LDFLAGS = -Wl,-rpath,\$$ORIGIN -L.
- LDLIBS = -lhand_data
- # Include debug symbols and warn on all
- CFLAGS = -g -Wall
- # Our single executable
- OBJS = libhand_data.so vulkan_test
- all: $(OBJS)
- vulkan_test: spv.h $(shell pkg-config --libs glfw3) -lvulkan
- spv.h: vert.spv frag.spv
- vert.spv: tri.vert
- glslangValidator -V $<
- frag.spv: tri.frag
- glslangValidator -V $<
- clean:
- rm -f $(OBJS) spv.h vert.spv frag.spv
- # valgrind discovers bugs, google it.
- test: clean all
- valgrind ./vulkan_test
- .PHONY: all clean test
- ###########
- # RESULTS #
- ###########
- cheako@debian:~/src/github/cheako-vulkan$ make clean
- rm -f libhand_data.so vulkan_test spv.h vert.spv frag.spv
- cheako@debian:~/src/github/cheako-vulkan$ make
- cc -g -Wall -c -shared -o libhand_data.so libhand_data.c
- glslangValidator -V tri.vert
- tri.vert
- glslangValidator -V tri.frag
- tri.frag
- m4 spv.h.in > spv.h
- cc -g -Wall -Wl,-rpath,\$ORIGIN -L. vulkan_test.c spv.h /usr/lib/i386-linux-gnu/libglfw.so /usr/lib/i386-linux-gnu/libvulkan.so -lhand_data -o vulkan_test
- cheako@debian:~/src/github/cheako-vulkan$ ldd ./vulkan_test | grep hand
- cheako@debian:~/src/github/cheako-vulkan$ nm ./vulkan_test | grep hand_
- 00007140 D hand_data_model
- 000071c0 D hand_data_model_count
- ############
- # Expected #
- ############
- hand_data_model should be undefined, "U".
- libhand_data.so should be listed as an shared object dependency.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement