mirror of
https://github.com/openharmony/third_party_liburing.git
synced 2026-07-22 07:35:21 -04:00
130e82b9f2
The usual convention is that the various *FLAGS are user controllable, and can be overridden, so anything that is essential for the build should be passed respecting that. The other usual convention is that CPPFLAGS only contain pre-processor options, CFLAGS and CXXFLAGS only contain compilation options and LDFLAGS only contain linker flags, where all of these are honored in all build rules. Switch to set optional flags conditionally into the *FLAGS variables if they are not set, and then unconditionally append any required flags. And pass the various *FLAGS to the rules as expected. Signed-off-by: Guillem Jover <guillem@hadrons.org>
30 lines
574 B
Makefile
30 lines
574 B
Makefile
CPPFLAGS ?=
|
|
override CPPFLAGS += -D_GNU_SOURCE -I../src/include/
|
|
CFLAGS ?= -g -O2 -Wall
|
|
LDFLAGS ?=
|
|
override LDFLAGS += -L../src/ -luring
|
|
|
|
include ../Makefile.quiet
|
|
|
|
ifneq ($(MAKECMDGOALS),clean)
|
|
include ../config-host.mak
|
|
endif
|
|
|
|
all_targets += io_uring-test io_uring-cp link-cp
|
|
|
|
ifdef CONFIG_HAVE_UCONTEXT
|
|
all_targets += ucontext-cp
|
|
endif
|
|
|
|
all: $(all_targets)
|
|
|
|
test_srcs := io_uring-test.c io_uring-cp.c link-cp.c
|
|
|
|
test_objs := $(patsubst %.c,%.ol,$(test_srcs))
|
|
|
|
%: %.c
|
|
$(QUIET_CC)$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $< $(LDFLAGS)
|
|
|
|
clean:
|
|
@rm -f $(all_targets) $(test_objs)
|