moved cores to root (and patches within it)

This commit is contained in:
Shaun Inman 2023-02-04 20:19:05 -05:00
parent 49a2027e8f
commit e9a9e31afa
10 changed files with 19 additions and 20 deletions

8
.gitignore vendored
View file

@ -1,14 +1,12 @@
.DS_Store .DS_Store
build/ build/
cores/src
cores/output
private/ private/
releases/ releases/
*.o *.o
*.so *.so
*.elf *.elf
*.dtb *.dtb
# thanks I hate it
src/minarch/cores/*
!src/minarch/cores/makefile

View file

@ -44,27 +44,28 @@ $1_REPO ?= https://github.com/libretro/$(1)
$1_MAKE ?= make $(and $($1_MAKEFILE),-f $($1_MAKEFILE)) platform=$(UNION_PLATFORM) $($(1)_FLAGS) $1_MAKE ?= make $(and $($1_MAKEFILE),-f $($1_MAKEFILE)) platform=$(UNION_PLATFORM) $($(1)_FLAGS)
$1_BUILD_PATH ?= $(1) $1_BUILD_PATH ?= $(1)
$(1): src/$(1):
mkdir -p cores mkdir -p src
cd cores && git clone $(if $($1_HASH),,--depth 1) --recursive $$($(1)_REPO) $(1) cd src && git clone $(if $($1_HASH),,--depth 1) --recursive $$($(1)_REPO) $(1)
$(if $($1_HASH),cd $$($1_BUILD_PATH) && git checkout $($1_HASH) && echo $($1_HASH),) $(if $($1_HASH),cd src/$$($1_BUILD_PATH) && git checkout $($1_HASH) && echo $($1_HASH),)
$(1)/.patched: $(1) src/$(1)/.patched: src/$(1)
(test ! -f patches/$(1).patch) || (test -f $(1)/.patched) || (cd $(1) && $(PATCH) -p1 < ../../patches/$(1).patch && touch .patched && true) (test ! -f patches/$(1).patch) || (test -f src/$(1)/.patched) || (cd src/$(1) && $(PATCH) -p1 < ../../patches/$(1).patch && touch .patched && true)
$(1)_libretro.so: $(1)/.patched output/$(1)_libretro.so: src/$(1)/.patched
cd $$($1_BUILD_PATH) && $$($1_MAKE) $(PROCS) mkdir -p output
mv $$($1_BUILD_PATH)/$(if $($(1)_CORE),$($(1)_CORE),$(1)_libretro.so) $(1)_libretro.so cd src/$$($1_BUILD_PATH) && $$($1_MAKE) $(PROCS)
mv src/$$($1_BUILD_PATH)/$(if $($(1)_CORE),$($(1)_CORE),$(1)_libretro.so) output/$(1)_libretro.so
clone-$(1): $(1) clone-$(1): src/$(1)
patch-$(1): $(1)/.patched patch-$(1): src/$(1)/.patched
clean-$(1): clean-$(1):
test ! -d $(1) || cd $$($1_BUILD_PATH) && $$($1_MAKE) clean test ! -d src/$(1) || cd src/$$($1_BUILD_PATH) && $$($1_MAKE) clean
rm -rf $(1)_libretro.so rm -rf output/$(1)_libretro.so
$(1): $(1)_libretro.so $(1): output/$(1)_libretro.so
endef endef
@ -74,4 +75,4 @@ all: cores
$(foreach CORE,$(CORES),$(eval $(call TEMPLATE,$(CORE)))) $(foreach CORE,$(CORES),$(eval $(call TEMPLATE,$(CORE))))
cores: $(foreach CORE,$(CORES),$(CORE)_libretro.so) cores: $(foreach CORE,$(CORES),$(CORE))