From: kub Date: Wed, 21 Dec 2022 08:03:05 +0000 (+0000) Subject: update submodules, fix for newer libchdr X-Git-Tag: v2.00~264 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d5288c2a41d78bf1c8bc5875d514c5166c242d14;p=picodrive.git update submodules, fix for newer libchdr --- diff --git a/Makefile b/Makefile index fbf25ba2..a00ecc73 100644 --- a/Makefile +++ b/Makefile @@ -295,16 +295,21 @@ endif endif ifeq (1,$(use_libchdr)) -CFLAGS += -DUSE_LIBCHDR +CHDR = pico/cd/libchdr +CFLAGS += -DUSE_LIBCHDR -I$(CHDR)/include + +# ouf... is there a better way to identify the include directories cmake uses? +CHDR_I = $(shell grep 'add_subdirectory.*EXCLUDE' $(CHDR)/CMakeLists.txt | sed 's/.*add_subdirectory[ ]*.//;s/EXCLUDE.*//') +# prepend includes to overload headers available in the toolchain +CFLAGS := $(patsubst %, -I$(CHDR)/%/include, $(CHDR_I)) $(CFLAGS) # chdr -CHDR = pico/cd/libchdr CHDR_OBJS += $(CHDR)/src/libchdr_chd.o $(CHDR)/src/libchdr_cdrom.o CHDR_OBJS += $(CHDR)/src/libchdr_flac.o CHDR_OBJS += $(CHDR)/src/libchdr_bitstream.o $(CHDR)/src/libchdr_huffman.o -# lzma -LZMA = $(CHDR)/deps/lzma-19.00 +# lzma - argh, what's make's way to filter CHDR_I for the string containing lzma? +LZMA = $(CHDR)/$(shell for d in $(CHDR_I); do echo $$d | grep lzma; done) LZMA_OBJS += $(LZMA)/src/CpuArch.o $(LZMA)/src/Alloc.o $(LZMA)/src/LzmaEnc.o LZMA_OBJS += $(LZMA)/src/Sort.o $(LZMA)/src/LzmaDec.o $(LZMA)/src/LzFind.o LZMA_OBJS += $(LZMA)/src/Delta.o @@ -314,9 +319,6 @@ OBJS += $(CHDR_OBJS) ifneq ($(STATIC_LINKING), 1) OBJS += $(LZMA_OBJS) endif -# ouf... prepend includes to overload headers available in the toolchain -CHDR_I = $(shell find $(CHDR) -name 'include') -CFLAGS := $(patsubst %, -I%, $(CHDR_I)) $(CFLAGS) endif ifeq "$(PLATFORM_ZLIB)" "1"