Luna/apps/Makefile

29 lines
526 B
Makefile
Raw Normal View History

2022-09-30 15:43:14 +00:00
APPS := init
APPS_DIR := $(LUNA_ROOT)/apps
APPS_OBJ := $(APPS_DIR)/lib
APPS_BIN := $(APPS_DIR)/bin
REAL_APPS := $(patsubst %, $(APPS_BIN)/%, $(APPS))
ASMFLAGS := -felf64
2022-10-02 15:01:30 +00:00
LDFLAGS := -nostdlib
2022-09-30 15:43:14 +00:00
$(APPS_OBJ)/%.o: $(APPS_DIR)/%.asm
@mkdir -p $(@D)
2022-10-02 15:01:30 +00:00
$(ASM) $(ASMFLAGS) -o $@ $^
2022-09-30 15:43:14 +00:00
$(APPS_BIN)/%: $(APPS_OBJ)/%.o
@mkdir -p $(@D)
$(LD) $(APP_LDFLAGS) -o $@ $^
build: $(REAL_APPS)
2022-09-30 15:43:14 +00:00
install: $(REAL_APPS)
2022-09-30 15:43:14 +00:00
@mkdir -p $(LUNA_ROOT)/initrd/bin
cp $(REAL_APPS) $(LUNA_ROOT)/initrd/bin
clean:
2022-09-30 15:43:14 +00:00
rm -f $(APPS_OBJ)/*
rm -f $(APPS_BIN)/*