include $(dir $(lastword $(MAKEFILE_LIST)))../../Makefile.cfg
-COMPONENTS = utilities tables
+ACPI_DEBUG ?= no
+
BIN := ../bin-$(ARCH)/libacpica.a
_VERS := $(patsubst acpica-unix-%.tar.gz,%,$(wildcard acpica-unix-*.tar.gz))
ifeq ($(ACPICAVER),)
ifeq ($(_LATEST),)
- $(warning Unable to find an archive matching acpica-unix-%.tar.gz)
+ $(warning Unable to find an archive matching acpica-unix-%.tar.gz in Externals/ACPICA)
$(warning Go to https://www.acpica.org/downloads/ to get it)
- $(error No ACPICA archive found)
+ $(error No ACPICA archive found, disable ACPI with 'USE_ACPICA=0')
endif
ifneq ($(_LATEST),$(_VERS))
CPPFLAGS += -I $(ACPICAROOT)source/include -D _ACESS -D __KERNEL__
CPPFLAGS += -D ARCH=$(ARCH) -D ARCHDIR=$(ARCHDIR) -D PLATFORM=\"$(PLATFORM)\" -D ARCHDIR_IS_$(ARCHDIR)=1 -D PLATFORM_is_$(PLATFORM)=1
CPPFLAGS += -D KERNEL_VERSION=$(KERNEL_VERSION) -ffreestanding
+ifneq ($(ACPI_DEBUG),no)
+ CPPFLAGS += -D ACPI_DEBUG_OUTPUT=1 -D ACPI_DISASSEMBLER=1
+endif
CFLAGS += -Wall -fno-stack-protector -Wstrict-prototypes -std=gnu99 -g
-SRCS := $(foreach comp,$(COMPONENTS),$(wildcard $(COMPDIR)$(comp)/*.c))
+SRCS := $(wildcard $(COMPDIR)*/*.c)
OBJS := $(SRCS:$(COMPDIR)%.c=obj-$(ARCH)/%.o)
ACENV_H := $(ACPICAROOT)source/include/platform/acenv.h
@echo Re-run make to compile
endif
-all: $(BIN)
+all: $(BIN) include
clean:
- $(RM) -r obj-$(ARCH)/
+ $(RM) -r obj-$(ARCH)/ include
+
purge: clean
$(RM) -r $(ACPICAROOT)
@echo [AR] $@
@ar rcu $@ $(OBJS)
+include:
+ ln -s $(ACPICAROOT)source/include
+
$(ACPICAROOT): $(ACPICA_ARCHIVE)
tar -xf $(ACPICA_ARCHIVE)