-
Notifications
You must be signed in to change notification settings - Fork 81
/
Makefile
37 lines (29 loc) · 1.61 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
include Make.common
GRUB_LIB = $(GRUB_DIR)/libgrub.a
CFLAGS += -DGRUB_FILE=\"$(subst $(srcdir)/,,$<)\" -DLZO_CFG_FREESTANDING -DGRUB
CFLAGS += -I$(GRUB_DIR) -I$(GRUB_DIR)/include -I$(GRUB_DIR)/grub-core/lib/minilzo -I$(GRUB_DIR)/grub-core/lib/zstd
OBJS = $(SRC_DIR)/grub.o $(GRUB_DIR)/grub-core/kern/err.o $(GRUB_DIR)/grub-core/kern/list.o \
$(GRUB_DIR)/grub-core/kern/misc.o $(GRUB_DIR)/grub-core/lib/crc.o \
$(GRUB_DIR)/grub-core/lib/minilzo/minilzo.o $(GRUB_DIR)/grub-core/lib/zstd/entropy_common.o \
$(GRUB_DIR)/grub-core/lib/zstd/error_private.o $(GRUB_DIR)/grub-core/lib/zstd/fse_decompress.o \
$(GRUB_DIR)/grub-core/lib/zstd/huf_decompress.o $(GRUB_DIR)/grub-core/lib/zstd/xxhash.o \
$(GRUB_DIR)/grub-core/lib/zstd/zstd_common.o $(GRUB_DIR)/grub-core/lib/zstd/zstd_decompress.o
-include $(OBJS:.o=.d)
.PHONY: all clean
.DEFAULT_GOAL := all
all: $(GNUEFI_LIB) $(GRUB_LIB)
$(MAKE) -C $(SRC_DIR)
$(GRUB_DIR)/include/grub/cpu_$(CPU_ARCH):
@rm -rf $(GRUB_DIR)/include/grub/cpu*
@echo [LN] $(GRUB_DIR)/include/grub/$(CPU_ARCH) -\> $(GRUB_DIR)/include/grub/cpu
@cd $(GRUB_DIR)/include/grub && ln -s $(CPU_ARCH) cpu && touch cpu_$(CPU_ARCH)
$(GRUB_DIR)/config.h:
@echo [CP] $(notdir $@)
@cp $(CURDIR)/config.h $(GRUB_DIR)
$(GRUB_LIB): $(GRUB_DIR)/config.h $(GRUB_DIR)/include/grub/cpu_$(CPU_ARCH) $(OBJS)
@echo [AR] $(notdir $@)
@$(AR) sq $@ $(OBJS)
clean: clean.common
$(MAKE) -C $(SRC_DIR) clean
rm -rf $(GRUB_DIR)/include/grub/cpu*
rm -f $(OBJS) $(LIB_TARGET) $(GRUB_DIR)/config.h $(GRUB_DIR)/*.a