xref: /aosp_15_r20/external/liburing/examples/Makefile (revision 25da2bea747f3a93b4c30fd9708b0618ef55a0e6)
1CPPFLAGS ?=
2override CPPFLAGS += -D_GNU_SOURCE -I../src/include/
3CFLAGS ?= -g -O2 -Wall
4LDFLAGS ?=
5override LDFLAGS += -L../src/ -luring
6
7include ../Makefile.quiet
8
9ifneq ($(MAKECMDGOALS),clean)
10include ../config-host.mak
11endif
12
13example_srcs := \
14	io_uring-cp.c \
15	io_uring-test.c \
16	link-cp.c
17
18all_targets :=
19
20
21ifdef CONFIG_HAVE_UCONTEXT
22	example_srcs += ucontext-cp.c
23endif
24all_targets += ucontext-cp
25
26example_targets := $(patsubst %.c,%,$(patsubst %.cc,%,$(example_srcs)))
27all_targets += $(example_targets)
28
29
30all: $(example_targets)
31
32%: %.c ../src/liburing.a
33	$(QUIET_CC)$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $< $(LDFLAGS)
34
35clean:
36	@rm -f $(all_targets)
37
38.PHONY: all clean
39