ifeq ($(TARGET),x86_64-nrk) CLANG_TRIPLE := x86_64-elf endif SRCDIR := acpica/source/ OBJDIR := $(OUT_DIR).obj/$(TARGET)/ SRCS := $(wildcard $(SRCDIR)components/*/*.c) SRCS := $(filter-out $(SRCDIR)components/disassembler/%,$(SRCS)) SRCS := $(filter-out $(SRCDIR)components/debugger/%,$(SRCS)) SRCS := $(filter-out $(SRCDIR)components/resources/rsdump.c,$(SRCS)) #SRCS := $(filter-out $(SRCDIR)components/events/%,$(SRCS)) SRCS += $(SRCDIR)components/hardware/hwacpi.c #SRCS += $(SRCDIR)common/ahuuids.c $(SRCDIR)common/ahids.c #SRCS += $(SRCDIR)compiler/aslmapenter.c OBJS := $(SRCS:$(SRCDIR)%.c=$(OBJDIR)%.o) CPPFLAGS := -I $(SRCDIR)include/ -D NRK -DACPI_DEBUG_OUTPUT -DACPI_APPLICATION CFLAGS := -ffreestanding -Wno-redundant-decls -Wno-unused-function -nostdlib -nodefaultlibs -lgcc CFLAGS += -O2 -fPIC .PHONY: all clean srcdir all: $(OUT_DIR)/libacpica-$(TARGET).a clean: rm -rf $(OUT_DIR)libacpica-$(TARGET).a $(OBJDIR) $(OUT_DIR)/libacpica-$(TARGET).a: $(SRCDIR) $(OBJS) @echo [AR] $@ @rm -f $@ && ar rc $@ $(OBJS) $(OBJDIR)%.o: $(SRCDIR)%.c _Makefile @mkdir -p $(dir $@) @echo [GCC] -o $@ @gcc $(CFLAGS) $(CPPFLAGS) -m64 -o $@ -c $<