X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Externals%2FACPICA%2FMakefile;h=835614d3424d99b639d6862381e5efbbae75082e;hb=a36ce5dd9d40b37c30bdb0603f5c95004f271e8c;hp=f91aa553f3057a177f6860644724fa6c53dd0326;hpb=2c9b2856a7c2aaf6cbf3827c27d40dc456525a92;p=tpg%2Facess2.git diff --git a/Externals/ACPICA/Makefile b/Externals/ACPICA/Makefile index f91aa553..835614d3 100644 --- a/Externals/ACPICA/Makefile +++ b/Externals/ACPICA/Makefile @@ -2,11 +2,29 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../Makefile.cfg -COMPONENTS = utilities tables +ACPI_DEBUG ?= no + BIN := ../bin-$(ARCH)/libacpica.a -ACPICAVER = 20121114 +_VERS := $(patsubst acpica-unix-%.tar.gz,%,$(wildcard acpica-unix-*.tar.gz)) +_VERS := $(sort $(_VERS)) +_LATEST := $(lastword $(_VERS)) + +ifeq ($(ACPICAVER),) + ifeq ($(_LATEST),) + $(warning Unable to find an archive matching acpica-unix-%.tar.gz) + $(warning Go to https://www.acpica.org/downloads/ to get it) + $(error No ACPICA archive found) + endif + + ifneq ($(_LATEST),$(_VERS)) + $(warning Multiple archvies found, picked $(_LATEST)) + endif + ACPICAVER := $(_LATEST) +endif + ACPICAROOT := acpica-unix-$(ACPICAVER)/ +ACPICA_ARCHIVE := acpica-unix-$(ACPICAVER).tar.gz COMPDIR := $(ACPICAROOT)source/components/ KERNELDIR := ../../KernelLand/Kernel/ @@ -14,9 +32,12 @@ CPPFLAGS += -I $(KERNELDIR)include -I$(KERNELDIR)arch/$(ARCHDIR)/include -D_MODU 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 @@ -24,25 +45,35 @@ ACACESS_H := $(ACPICAROOT)source/include/platform/acacess.h .PHONY: all clean -all: $(BIN) +ifeq ($(words $(SRCS)),0) +extract: $(ACPICAROOT) + @echo Re-run make to compile +endif + +all: $(BIN) include clean: - $(RM) obj-$(ARCH)/ + $(RM) -r obj-$(ARCH)/ include + +purge: clean + $(RM) -r $(ACPICAROOT) $(BIN): $(OBJS) @mkdir -p $(dir $@) @echo [AR] $@ @ar rcu $@ $(OBJS) -#include_exp/acpi: $(ACPICAROOT)source/include -# @mkdir -p $(dir $@) -# ln -s ../$< $@ +include: + ln -s $(ACPICAROOT)source/include + +$(ACPICAROOT): $(ACPICA_ARCHIVE) + tar -xf $(ACPICA_ARCHIVE) $(ACACESS_H): acacess.h cp $< $@ -$(ACENV_H): acpica-unix-$(ACPICAVER).tar.gz Makefile - tar -x -O -f acpica-unix-$(ACPICAVER).tar.gz $(ACENV_H) | sed 's/aclinux/acacess/' | sed 's/_LINUX/_ACESS/' > $@ +$(ACENV_H): $(ACPICA_ARCHIVE) Makefile + tar -x -O -f $(ACPICA_ARCHIVE) $(ACENV_H) | sed 's/aclinux/acacess/' | sed 's/_LINUX/_ACESS/' > $@ obj-$(ARCH)/%.o: $(COMPDIR)%.c $(ACENV_H) $(ACACESS_H) @mkdir -p $(dir $@)