summaryrefslogtreecommitdiff
path: root/service/Makefile
diff options
context:
space:
mode:
authorAda Christine <adachristine18@gmail.com>2024-03-03 08:44:42 +0000
committerAda Christine <adachristine18@gmail.com>2024-03-03 08:44:42 +0000
commitf61da8be06fdfebc598cba783e78117319231140 (patch)
tree0ef21f89e98a985ab5d985aaac1e032c868e8b81 /service/Makefile
parent9681d6a6cbde12b00beab62683b8db98f680ba2b (diff)
build changes
Diffstat (limited to 'service/Makefile')
-rw-r--r--service/Makefile37
1 files changed, 37 insertions, 0 deletions
diff --git a/service/Makefile b/service/Makefile
new file mode 100644
index 0000000..d6e762d
--- /dev/null
+++ b/service/Makefile
@@ -0,0 +1,37 @@
+include ../defaults.mk
+
+LDFLAGS += -z max-page-size=4096 --export-dynamic -pic \
+ -z separate-code -pie -Bsymbolic -shared \
+ -z noexecstack -g
+
+VPATH := ../lib
+
+TARGET := kjarna.os
+.DEFAULT: $(TARGET)
+
+CPPFLAGS += -I../api/posix -I../api/libc -I../api -I.
+
+CFLAGS += -fPIC -fvisibility=hidden -mgeneral-regs-only
+
+LDSCRIPT := kc.ld
+
+CRT_OBJS := start_x86_64.o dynamic_x86_64.o elf64.o kjarna.o
+LIB_OBJS := memcmp.o memcpy.o memmove.o memset.o string.o stdio.o \
+ printf.o
+APP_OBJS := main.o
+
+OBJS := $(CRT_OBJS) $(LIB_OBJS) $(APP_OBJS)
+
+DEPS := $(patsubst %.o,%.d,$(OBJS))
+
+$(TARGET): $(LDSCRIPT) $(MAKEFILE_LIST)
+$(TARGET): $(OBJS)
+
+CLEANLIST := $(wildcard $(OBJS) $(TARGET))
+DCLEANLIST := $(wildcard $(DEPS))
+
+include ../rules.mk
+-include $(DEPS)
+
+.DEFAULT: $(TARGET)
+