ifeq ($(TARGET),i686-sel4-unknown) machine_width := 32 CLANG_TRIPLE := i386-elf endif ifeq ($(TARGET),x86_64-sel4-unknown) machine_width := 64 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/dbfileio.c,$(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 ROBIGALIA -D ACPI_LIBRARY #CPPFLAGS += -D ACPI_DEBUG_OUTPUT=1 # -D ACPI_DISASSEMBLER=1 CFLAGS := -ffreestanding CFLAGS += -O2 CFLAGS += -D ROBIGALIA_MACHINE_WIDTH=$(machine_width) .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 [CLANG] -o $@ @clang -target $(CLANG_TRIPLE) -o $@ -c $< $(CFLAGS) $(CPPFLAGS)