2 # Acess2 OS - "Externals"
3 # - By John Hodge (thePowersGang)
6 # - Makefile code used by all externals
8 -include ../../Makefile.cfg
12 else ifeq ($(ARCH),x86_64)
15 $(error No BFD translation for $(ARCH) in Externals/core.mk)
18 #PREFIX=$(ACESSDIR)/Externals/Output
19 #EPREFIX=$(ACESSDIR)/Externals/Output/$(BFD)
20 PREFIX=$(ACESSDIR)/Externals/Output/$(ARCH)
22 SYSROOT=$(ACESSDIR)/Externals/Output/sysroot-$(BFD)
23 HOST=$(BFD)-acess_proxy-elf
26 # DEPS : Dependencies for this program/library
27 # TARBALL_PATTERN : $(wildcard ) format [glob] pattern
28 # TARBALL_TO_DIR : $(patsubst ) format conversion
29 # PATCHES : List of altered files in the source
30 # > If patches/%.patch exists, the original is patched, else patches/% is copied in
31 # [?]BTARGETS : Build targets (Defaults to all)
32 # [?]ARCHIVE : Optional forced archive (Defaults to latest)
33 # [?]NOBDIR : Set to non-empty to disable use of a separate build dir
35 # CONFIGURE_ARGS : Extra arguments to ./configure (ignoring host and prefix)
36 # [?]CONFIGURE_LINE : Command to create makefile (defaults to autotools configure)
37 # [?]AUTORECONF : Set to non-empty to regenerate ./configure
43 _VERS := $(wildcard $(TARBALL_PATTERN))
44 _VERS := $(sort $(_VERS))
45 _LATEST := $(lastword $(_VERS))
49 $(warning Unable to find an archive matching $(TARBALL_PATTERN))
50 $(error No archive found)
53 ifneq ($(_LATEST),$(_VERS))
54 $(warning Multiple archvies found, picked $(_LATEST))
59 DIR := $(patsubst $(TARBALL_TO_DIR_L),$(TARBALL_TO_DIR_R),$(ARCHIVE))
68 .PHONY: all clean install _patch _build
70 all: $(DIR) _patch _build
75 $(DIR): $(ARCHIVE) patches/UNIFIED.patch
77 ifneq ($(wildcard patches/UNIFIED.patch),)
78 cd $(DIR) && patch -p1 < ../patches/UNIFIED.patch
81 patches/UNIFIED.patch:
84 $(DIR)/%: patches/%.patch
86 @tar -xf $(ARCHIVE) $@
94 PATCHED_FILES := $(addprefix $(DIR)/,$(PATCHES))
95 _patch: $(DIR) $(PATCHED_FILES)