APPS := init APPS_DIR := $(LUNA_ROOT)/apps APPS_OBJ := $(APPS_DIR)/lib APPS_BIN := $(APPS_DIR)/bin REAL_APPS := $(patsubst %, $(APPS_BIN)/%, $(APPS)) ASMC := nasm ASMFLAGS := -felf64 LD := x86_64-elf-ld APP_LDFLAGS := -T$(APPS_DIR)/apps.ld -nostdlib $(APPS_OBJ)/%.o: $(APPS_DIR)/%.asm @mkdir -p $(@D) $(ASMC) $(ASMFLAGS) -o $@ $^ $(APPS_BIN)/%: $(APPS_OBJ)/%.o @mkdir -p $(@D) $(LD) $(APP_LDFLAGS) -o $@ $^ apps-build: $(REAL_APPS) apps-install: $(REAL_APPS) @mkdir -p $(LUNA_ROOT)/initrd/bin cp $(REAL_APPS) $(LUNA_ROOT)/initrd/bin apps-clean: rm -f $(APPS_OBJ)/* rm -f $(APPS_BIN)/*