2022-10-03 19:24:38 +00:00
|
|
|
APPS := init fib leap art memeater
|
2022-09-30 15:43:14 +00:00
|
|
|
|
|
|
|
APPS_DIR := $(LUNA_ROOT)/apps
|
2022-10-02 15:25:56 +00:00
|
|
|
APPS_SRC := $(APPS_DIR)/src
|
2022-09-30 15:43:14 +00:00
|
|
|
APPS_BIN := $(APPS_DIR)/bin
|
|
|
|
|
|
|
|
REAL_APPS := $(patsubst %, $(APPS_BIN)/%, $(APPS))
|
|
|
|
|
2022-10-02 18:45:04 +00:00
|
|
|
CFLAGS := -Wall -Wextra -Werror
|
2022-09-30 15:43:14 +00:00
|
|
|
|
2022-10-02 15:25:56 +00:00
|
|
|
$(APPS_BIN)/%: $(APPS_SRC)/%.c
|
2022-09-30 15:43:14 +00:00
|
|
|
@mkdir -p $(@D)
|
2022-10-02 15:25:56 +00:00
|
|
|
$(CC) $(CFLAGS) -o $@ $^
|
2022-10-10 19:24:21 +00:00
|
|
|
$(STRIP) $@
|
2022-09-30 15:43:14 +00:00
|
|
|
|
2022-10-02 10:44:32 +00:00
|
|
|
build: $(REAL_APPS)
|
2022-09-30 15:43:14 +00:00
|
|
|
|
2022-10-02 10:44:32 +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
|
|
|
|
|
2022-10-02 10:44:32 +00:00
|
|
|
clean:
|
2022-09-30 15:43:14 +00:00
|
|
|
rm -f $(APPS_BIN)/*
|