prototype1/Makefile

45 lines
1.3 KiB
Makefile

#HEADERS := $(shell find src -type f -name '*.h')
cflags := -Wall -Wextra -Werror=implicit-function-declaration -Werror=return-type --std=c99 -g -ggdb -O0 \
-fno-trapping-math -D_POSIX_C_SOURCE=200112L -D_GNU_SOURCE
cc := 'gcc'
wl_protocols := $(shell pkg-config --variable=pkgdatadir wayland-protocols)
gen/l_wl_protocols/xdg-shell-client.h: $(wl_protocols)/stable/xdg-shell/xdg-shell.xml
mkdir -p gen/l_wl_protocols
wayland-scanner client-header $< $@
gen/l_wl_protocols/xdg-shell-private.c: $(wl_protocols)/stable/xdg-shell/xdg-shell.xml
mkdir -p gen/l_wl_protocols
wayland-scanner private-code $< $@
out/l1/t0: src/l1/tests/t0.c $(HEADERS)
mkdir -p out/l1
$(cc) $(cflags) -o $@ $<
out/l1/t1: src/l1/tests/t1.c $(HEADERS)
mkdir -p out/l1
$(cc) $(cflags) -o $@ $<
out/l2/codegen_l: src/l2/codegen.c $(HEADERS)
mkdir -p out/l2
$(cc) $(cflags) -o $@ $<
out/l2/r0: src/l2/tests/r0/r0.c $(HEADERS)
mkdir -p out/l2
$(cc) $(cflags) -o $@ $< -lvulkan -lX11 -lm
out/l2/r0: src/l2/tests/r0/r0_tex_init_prep.c $(HEADERS)
mkdir -p out/l2
$(cc) $(cflags) -o $@ $< -lm
out/l2/r1: src/l2/tests/r1/r1.c $(HEADERS)
mkdir -p out/l2
$(cc) $(cflags) -o $@ $< gen/l_wl_protocols/xdg-shell-private.c -lwayland-client -lrt -lxkbcommon
clean:
rm -rf gen out
.PHONY: clean