summaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/Makefile b/src/Makefile
index 5e46a9d..09ff395 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -32,11 +32,22 @@ 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 -fno-stack-protector
+ override CPPFLAGS += -nostdlib -nodefaultlibs -ffreestanding -fno-stack-protector
+ override LINK_FLAGS += -nostdlib -nodefaultlibs
+else
+ liburing_srcs += syscall.c
+endif
liburing_objs := $(patsubst %.c,%.ol,$(liburing_srcs))
liburing_sobjs := $(patsubst %.c,%.os,$(liburing_srcs))
+$(liburing_srcs): syscall.h lib.h
+
$(liburing_objs) $(liburing_sobjs): include/liburing/io_uring.h
%.os: %.c
@@ -73,3 +84,7 @@ clean:
@rm -f $(all_targets) $(liburing_objs) $(liburing_sobjs) $(soname).new
@rm -f *.so* *.a *.o
@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