diff options
author | Gil Cukierman <cukie@google.com> | 2022-10-31 14:08:03 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-10-31 14:08:03 +0000 |
commit | dae12c7b40c255ad7c6612591e2908a266f2cfd5 (patch) | |
tree | ebe9c872e416346e4b333e5062da32401c8e0a73 /src/Makefile | |
parent | d53db6851ea17b2d219d084e1afc683b8b62b105 (diff) | |
parent | d0a2042580f3ed180db5e2b53029296a8b555115 (diff) | |
download | liburing-dae12c7b40c255ad7c6612591e2908a266f2cfd5.tar.gz |
Update liburing to version 2.2 am: d0a2042580main-16k-with-phones
Original change: https://android-review.googlesource.com/c/platform/external/liburing/+/2276974
Change-Id: I0ac5dbb2b0dadb76713528e6ab0110ec071bad63
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'src/Makefile')
-rw-r--r-- | src/Makefile | 41 |
1 files changed, 28 insertions, 13 deletions
diff --git a/src/Makefile b/src/Makefile index dfca826..12cf49f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,22 +1,23 @@ +include ../Makefile.common + prefix ?= /usr includedir ?= $(prefix)/include libdir ?= $(prefix)/lib libdevdir ?= $(prefix)/lib CPPFLAGS ?= -override CPPFLAGS += -Iinclude/ -include ../config-host.h -CFLAGS ?= -g -fomit-frame-pointer -O2 -override CFLAGS += -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare +override CPPFLAGS += -D_GNU_SOURCE \ + -Iinclude/ -include ../config-host.h +CFLAGS ?= -g -O2 -Wall -Wextra -fno-stack-protector +override CFLAGS += -Wno-unused-parameter -Wno-sign-compare -DLIBURING_INTERNAL SO_CFLAGS=-fPIC $(CFLAGS) L_CFLAGS=$(CFLAGS) LINK_FLAGS= LINK_FLAGS+=$(LDFLAGS) ENABLE_SHARED ?= 1 -soname=liburing.so.2 -minor=0 -micro=0 -libname=$(soname).$(minor).$(micro) +soname=liburing.so.$(VERSION_MAJOR) +libname=liburing.so.$(VERSION) all_targets += liburing.a ifeq ($(ENABLE_SHARED),1) @@ -31,19 +32,31 @@ endif all: $(all_targets) -liburing_srcs := setup.c queue.c syscall.c register.c +liburing_srcs := setup.c queue.c register.c + +ifeq ($(CONFIG_NOLIBC),y) + liburing_srcs += nolibc.c + override CFLAGS += -nostdlib -nodefaultlibs -ffreestanding + override CPPFLAGS += -nostdlib -nodefaultlibs -ffreestanding + override LINK_FLAGS += -nostdlib -nodefaultlibs +else + liburing_srcs += syscall.c +endif +override CPPFLAGS += -MT "$@" -MMD -MP -MF "$@.d" liburing_objs := $(patsubst %.c,%.ol,$(liburing_srcs)) liburing_sobjs := $(patsubst %.c,%.os,$(liburing_srcs)) -$(liburing_objs) $(liburing_sobjs): include/liburing/io_uring.h - %.os: %.c $(QUIET_CC)$(CC) $(CPPFLAGS) $(SO_CFLAGS) -c -o $@ $< %.ol: %.c $(QUIET_CC)$(CC) $(CPPFLAGS) $(L_CFLAGS) -c -o $@ $< +# Include compiler generated dependency files. +-include $(liburing_objs:%=%.d) +-include $(liburing_sobjs:%=%.d) + AR ?= ar RANLIB ?= ranlib liburing.a: $(liburing_objs) @@ -66,9 +79,11 @@ ifeq ($(ENABLE_SHARED),1) ln -sf $(relativelibdir)$(libname) $(libdevdir)/liburing.so endif -$(liburing_objs): include/liburing.h - clean: @rm -f $(all_targets) $(liburing_objs) $(liburing_sobjs) $(soname).new - @rm -f *.so* *.a *.o + @rm -f *.so* *.a *.o *.d @rm -f include/liburing/compat.h + + @# When cleaning, we don't include ../config-host.mak, + @# so the nolibc objects are always skipped, clean them up! + @rm -f nolibc.ol nolibc.os |