From 65ba015d6c1f248d36ad01a653bc49637804b15b Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Sun, 10 Aug 2025 15:46:33 -0400 Subject: working usermode objdir iteration --- apps/init/Makefile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 apps/init/Makefile (limited to 'apps/init/Makefile') diff --git a/apps/init/Makefile b/apps/init/Makefile new file mode 100644 index 0000000..642ca38 --- /dev/null +++ b/apps/init/Makefile @@ -0,0 +1,21 @@ +include $(CONFIG) + +CFILES := $(wildcard *.c) +OFILES := $(patsubst %.c,%.o,$(CFILES)) +OFILES += $(STATICLIBS) + +CFLAGS := -ffreestanding -nostdlib -g +LDFLAGS := -T $(TARGET_MACHINE).ld +OCFLAGS := -O binary \ + --set-section-flags .bss=alloc,load,contents + +all: $(OFILES) + $(LD) $(LDFLAGS) ${OFILES} -o init.elf + objcopy $(OCFLAGS) init.elf $(OUT)/init + +clean: + -rm ${OFILES} + -rm init.elf + +%.o:%.c + $(CC) $(CFLAGS) -c $< -o $@ -- cgit v1.2.1