Start cleaning up the makefiles
Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
parent
57cea708dc
commit
9f3252f7ca
11 changed files with 148 additions and 188 deletions
147
deps/Makefile
vendored
147
deps/Makefile
vendored
|
@ -4,29 +4,8 @@
|
|||
# Created by falkTX
|
||||
#
|
||||
|
||||
# --------------------------------------------------------------
|
||||
# Import base definitions
|
||||
|
||||
DISTRHO_NAMESPACE = CardinalDISTRHO
|
||||
DGL_NAMESPACE = CardinalDGL
|
||||
USE_NANOVG_FBO = true
|
||||
WASM_EXCEPTIONS = true
|
||||
include ../dpf/Makefile.base.mk
|
||||
|
||||
# --------------------------------------------------------------
|
||||
# Build config
|
||||
|
||||
ifeq ($(BSD),true)
|
||||
SYSDEPS ?= true
|
||||
else
|
||||
SYSDEPS ?= false
|
||||
endif
|
||||
|
||||
ifeq ($(SYSDEPS),true)
|
||||
DEP_PATH = $(abspath sysroot)
|
||||
else
|
||||
DEP_PATH = $(abspath ../src/Rack/dep)
|
||||
endif
|
||||
ROOT = ..
|
||||
include $(ROOT)/Makefile.base.mk
|
||||
|
||||
# --------------------------------------------------------------
|
||||
# custom build flags
|
||||
|
@ -110,7 +89,7 @@ SPACE +=
|
|||
|
||||
CMAKE = cmake
|
||||
CMAKE += -DCMAKE_INSTALL_LIBDIR=lib
|
||||
CMAKE += -DCMAKE_INSTALL_PREFIX='$(DEP_PATH)'
|
||||
CMAKE += -DCMAKE_INSTALL_PREFIX='$(RACK_DEP_PATH)'
|
||||
CMAKE += -DBUILD_SHARED_LIBS=OFF
|
||||
|
||||
# make sure debug/release matches
|
||||
|
@ -184,7 +163,7 @@ endif
|
|||
# Fix up configure
|
||||
|
||||
CONFIGURE = ./configure
|
||||
CONFIGURE += --prefix="$(DEP_PATH)"
|
||||
CONFIGURE += --prefix="$(RACK_DEP_PATH)"
|
||||
CONFIGURE += --host=$(TARGET_MACHINE)
|
||||
CONFIGURE += --enable-static
|
||||
CONFIGURE += --disable-shared
|
||||
|
@ -226,58 +205,58 @@ DEP_MAKE2 += CONFIGURE="$(ENV) $(CONFIGURE)"
|
|||
# --------------------------------------------------------------
|
||||
# Rack internal dependencies target
|
||||
|
||||
$(DEP_PATH)/lib/%.a:
|
||||
$(DEP_MAKE2) -C $(DEP_PATH) lib/$*.a
|
||||
$(RACK_DEP_PATH)/lib/%.a:
|
||||
$(DEP_MAKE2) -C $(RACK_DEP_PATH) lib/$*.a
|
||||
|
||||
$(DEP_PATH)/jansson-2.12:
|
||||
$(DEP_MAKE2) -C $(DEP_PATH) jansson-2.12
|
||||
$(RACK_DEP_PATH)/jansson-2.12:
|
||||
$(DEP_MAKE2) -C $(RACK_DEP_PATH) jansson-2.12
|
||||
|
||||
# libarchive: skip shared lib and ensure libzstd is enabled
|
||||
$(DEP_PATH)/lib/libarchive.a: $(DEP_PATH)/lib/libzstd.a $(DEP_PATH)/libarchive-3.4.3/.stamp-patched
|
||||
$(RACK_DEP_PATH)/lib/libarchive.a: $(RACK_DEP_PATH)/lib/libzstd.a $(RACK_DEP_PATH)/libarchive-3.4.3/.stamp-patched
|
||||
|
||||
$(DEP_PATH)/lib/libarchive_static.a: $(DEP_PATH)/lib/libzstd.a $(DEP_PATH)/libarchive-3.4.3/.stamp-patched
|
||||
$(RACK_DEP_PATH)/lib/libarchive_static.a: $(RACK_DEP_PATH)/lib/libzstd.a $(RACK_DEP_PATH)/libarchive-3.4.3/.stamp-patched
|
||||
|
||||
$(DEP_PATH)/libarchive-3.4.3/.stamp-patched:
|
||||
$(DEP_MAKE2) -C $(DEP_PATH) libarchive-3.4.3
|
||||
sed -i -e "618,625d" $(DEP_PATH)/libarchive-3.4.3/CMakeLists.txt
|
||||
awk 'NR==616{print " SET(HAVE_LIBZSTD 1)"}1' $(DEP_PATH)/libarchive-3.4.3/CMakeLists.txt > $(DEP_PATH)/libarchive-3.4.3/CMakeLists.txt2
|
||||
mv $(DEP_PATH)/libarchive-3.4.3/CMakeLists.txt2 $(DEP_PATH)/libarchive-3.4.3/CMakeLists.txt
|
||||
sed -i -e "238,243d" $(DEP_PATH)/libarchive-3.4.3/libarchive/CMakeLists.txt
|
||||
sed -i -e "s/TARGETS archive archive_static/TARGETS archive_static/" $(DEP_PATH)/libarchive-3.4.3/libarchive/CMakeLists.txt
|
||||
$(RACK_DEP_PATH)/libarchive-3.4.3/.stamp-patched:
|
||||
$(DEP_MAKE2) -C $(RACK_DEP_PATH) libarchive-3.4.3
|
||||
sed -i -e "618,625d" $(RACK_DEP_PATH)/libarchive-3.4.3/CMakeLists.txt
|
||||
awk 'NR==616{print " SET(HAVE_LIBZSTD 1)"}1' $(RACK_DEP_PATH)/libarchive-3.4.3/CMakeLists.txt > $(RACK_DEP_PATH)/libarchive-3.4.3/CMakeLists.txt2
|
||||
mv $(RACK_DEP_PATH)/libarchive-3.4.3/CMakeLists.txt2 $(RACK_DEP_PATH)/libarchive-3.4.3/CMakeLists.txt
|
||||
sed -i -e "238,243d" $(RACK_DEP_PATH)/libarchive-3.4.3/libarchive/CMakeLists.txt
|
||||
sed -i -e "s/TARGETS archive archive_static/TARGETS archive_static/" $(RACK_DEP_PATH)/libarchive-3.4.3/libarchive/CMakeLists.txt
|
||||
touch $@
|
||||
|
||||
# libsamplerate: skip tests, fails to build in some systems and are not needed or wanted anyway
|
||||
$(DEP_PATH)/lib/libsamplerate.a: $(DEP_PATH)/libsamplerate-0.1.9/.stamp-patched
|
||||
$(RACK_DEP_PATH)/lib/libsamplerate.a: $(RACK_DEP_PATH)/libsamplerate-0.1.9/.stamp-patched
|
||||
|
||||
$(DEP_PATH)/libsamplerate-0.1.9/.stamp-patched:
|
||||
$(DEP_MAKE2) -C $(DEP_PATH) libsamplerate-0.1.9
|
||||
sed -i -e "s/src doc examples tests/src/" $(DEP_PATH)/libsamplerate-0.1.9/Makefile.in
|
||||
$(RACK_DEP_PATH)/libsamplerate-0.1.9/.stamp-patched:
|
||||
$(DEP_MAKE2) -C $(RACK_DEP_PATH) libsamplerate-0.1.9
|
||||
sed -i -e "s/src doc examples tests/src/" $(RACK_DEP_PATH)/libsamplerate-0.1.9/Makefile.in
|
||||
touch $@
|
||||
|
||||
# libspeexdsp: hide symbols
|
||||
$(DEP_PATH)/lib/libspeexdsp.a: $(DEP_PATH)/speexdsp-SpeexDSP-1.2rc3/.stamp-patched
|
||||
$(RACK_DEP_PATH)/lib/libspeexdsp.a: $(RACK_DEP_PATH)/speexdsp-SpeexDSP-1.2rc3/.stamp-patched
|
||||
|
||||
$(DEP_PATH)/speexdsp-SpeexDSP-1.2rc3/.stamp-patched:
|
||||
$(DEP_MAKE2) -C $(DEP_PATH) speexdsp-SpeexDSP-1.2rc3 \
|
||||
$(RACK_DEP_PATH)/speexdsp-SpeexDSP-1.2rc3/.stamp-patched:
|
||||
$(DEP_MAKE2) -C $(RACK_DEP_PATH) speexdsp-SpeexDSP-1.2rc3 \
|
||||
WGET="wget -c http://downloads.xiph.org/releases/speex/speexdsp-1.2rc3.tar.gz && mv speexdsp-1.2rc3.tar.gz speexdsp-SpeexDSP-1.2rc3.tgz #" \
|
||||
SHA256SUM="true" \
|
||||
UNTAR="mkdir -p speexdsp-SpeexDSP-1.2rc3 && tar -x --strip-components=1 --directory=$(DEP_PATH)/speexdsp-SpeexDSP-1.2rc3 -f"
|
||||
sed -i -e "s/#pragma GCC visibility push/#error we dont want this/" $(DEP_PATH)/speexdsp-SpeexDSP-1.2rc3/configure
|
||||
UNTAR="mkdir -p speexdsp-SpeexDSP-1.2rc3 && tar -x --strip-components=1 --directory=$(RACK_DEP_PATH)/speexdsp-SpeexDSP-1.2rc3 -f"
|
||||
sed -i -e "s/#pragma GCC visibility push/#error we dont want this/" $(RACK_DEP_PATH)/speexdsp-SpeexDSP-1.2rc3/configure
|
||||
touch $@
|
||||
|
||||
# custom zstd build for only building static libs
|
||||
$(DEP_PATH)/lib/libzstd.a: $(DEP_PATH)/zstd-1.4.5/.stamp-patched
|
||||
cd $(DEP_PATH)/zstd-1.4.5/build/cmake && $(CMAKE) -DZSTD_BUILD_STATIC=ON -DZSTD_BUILD_PROGRAMS=OFF -DZSTD_BUILD_SHARED=OFF -DZSTD_MULTITHREAD_SUPPORT=OFF .
|
||||
$(DEP_MAKE2) -C $(DEP_PATH)/zstd-1.4.5/build/cmake
|
||||
$(DEP_MAKE2) -C $(DEP_PATH)/zstd-1.4.5/build/cmake install
|
||||
$(RACK_DEP_PATH)/lib/libzstd.a: $(RACK_DEP_PATH)/zstd-1.4.5/.stamp-patched
|
||||
cd $(RACK_DEP_PATH)/zstd-1.4.5/build/cmake && $(CMAKE) -DZSTD_BUILD_STATIC=ON -DZSTD_BUILD_PROGRAMS=OFF -DZSTD_BUILD_SHARED=OFF -DZSTD_MULTITHREAD_SUPPORT=OFF .
|
||||
$(DEP_MAKE2) -C $(RACK_DEP_PATH)/zstd-1.4.5/build/cmake
|
||||
$(DEP_MAKE2) -C $(RACK_DEP_PATH)/zstd-1.4.5/build/cmake install
|
||||
|
||||
# zstd cmake is borked, see https://github.com/facebook/zstd/issues/1401
|
||||
# zstd also fails to build on old systems, patch that too
|
||||
$(DEP_PATH)/zstd-1.4.5/.stamp-patched:
|
||||
$(DEP_MAKE2) -C $(DEP_PATH) zstd-1.4.5
|
||||
sed -i -e "56,66d" $(DEP_PATH)/zstd-1.4.5/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake
|
||||
sed -i -e "146,175d" $(DEP_PATH)/zstd-1.4.5/programs/util.c
|
||||
sed -i -e "142,144d" $(DEP_PATH)/zstd-1.4.5/programs/util.c
|
||||
$(RACK_DEP_PATH)/zstd-1.4.5/.stamp-patched:
|
||||
$(DEP_MAKE2) -C $(RACK_DEP_PATH) zstd-1.4.5
|
||||
sed -i -e "56,66d" $(RACK_DEP_PATH)/zstd-1.4.5/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake
|
||||
sed -i -e "146,175d" $(RACK_DEP_PATH)/zstd-1.4.5/programs/util.c
|
||||
sed -i -e "142,144d" $(RACK_DEP_PATH)/zstd-1.4.5/programs/util.c
|
||||
touch $@
|
||||
|
||||
# --------------------------------------------------------------
|
||||
|
@ -298,12 +277,12 @@ else ifeq ($(MACOS),true)
|
|||
QUICKJS_MAKE_FLAGS += CONFIG_DARWIN=y
|
||||
endif
|
||||
|
||||
$(DEP_PATH)/lib/libquickjs.a:
|
||||
$(RACK_DEP_PATH)/lib/libquickjs.a:
|
||||
$(DEP_MAKE) $(QUICKJS_MAKE_FLAGS) -C $(CURDIR)/QuickJS
|
||||
install -d $(DEP_PATH)/include
|
||||
install -d $(DEP_PATH)/lib
|
||||
install -d $(RACK_DEP_PATH)/include
|
||||
install -d $(RACK_DEP_PATH)/lib
|
||||
install -m644 $(CURDIR)/QuickJS/libquickjs.a $@
|
||||
install -m644 $(CURDIR)/QuickJS/quickjs.h $(DEP_PATH)/include/quickjs.h
|
||||
install -m644 $(CURDIR)/QuickJS/quickjs.h $(RACK_DEP_PATH)/include/quickjs.h
|
||||
|
||||
# --------------------------------------------------------------
|
||||
# SurgeXT target
|
||||
|
@ -383,45 +362,45 @@ ifneq ($(NOPLUGINS),true)
|
|||
TARGETS += $(SURGE_LIB)
|
||||
endif
|
||||
|
||||
TARGETS += $(DEP_PATH)/lib/libjansson.a
|
||||
TARGETS += $(DEP_PATH)/lib/libquickjs.a
|
||||
TARGETS += $(DEP_PATH)/lib/libsamplerate.a
|
||||
TARGETS += $(DEP_PATH)/lib/libspeexdsp.a
|
||||
TARGETS += $(RACK_DEP_PATH)/lib/libjansson.a
|
||||
TARGETS += $(RACK_DEP_PATH)/lib/libquickjs.a
|
||||
TARGETS += $(RACK_DEP_PATH)/lib/libsamplerate.a
|
||||
TARGETS += $(RACK_DEP_PATH)/lib/libspeexdsp.a
|
||||
|
||||
ifeq ($(WINDOWS),true)
|
||||
TARGETS += $(DEP_PATH)/lib/libarchive_static.a
|
||||
TARGETS += $(RACK_DEP_PATH)/lib/libarchive_static.a
|
||||
else
|
||||
TARGETS += $(DEP_PATH)/lib/libarchive.a
|
||||
TARGETS += $(RACK_DEP_PATH)/lib/libarchive.a
|
||||
endif
|
||||
|
||||
TARGETS += $(DEP_PATH)/lib/libzstd.a
|
||||
TARGETS += $(RACK_DEP_PATH)/lib/libzstd.a
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
clean:
|
||||
$(DEP_MAKE) $(QUICKJS_MAKE_FLAGS) -C $(CURDIR)/QuickJS clean
|
||||
rm -f $(TARGETS)
|
||||
rm -f $(DEP_PATH)/*.tgz
|
||||
rm -f $(DEP_PATH)/*.tar.gz
|
||||
rm -rf $(DEP_PATH)/bin
|
||||
rm -rf $(DEP_PATH)/include
|
||||
rm -rf $(DEP_PATH)/lib
|
||||
rm -rf $(DEP_PATH)/share
|
||||
rm -rf $(DEP_PATH)/jansson-2.12
|
||||
rm -rf $(DEP_PATH)/libarchive-3.4.3
|
||||
rm -rf $(DEP_PATH)/libsamplerate-0.1.9
|
||||
rm -rf $(DEP_PATH)/speexdsp-SpeexDSP-1.2rc3
|
||||
rm -rf $(DEP_PATH)/zstd-1.4.5
|
||||
rm -f $(RACK_DEP_PATH)/*.tgz
|
||||
rm -f $(RACK_DEP_PATH)/*.tar.gz
|
||||
rm -rf $(RACK_DEP_PATH)/bin
|
||||
rm -rf $(RACK_DEP_PATH)/include
|
||||
rm -rf $(RACK_DEP_PATH)/lib
|
||||
rm -rf $(RACK_DEP_PATH)/share
|
||||
rm -rf $(RACK_DEP_PATH)/jansson-2.12
|
||||
rm -rf $(RACK_DEP_PATH)/libarchive-3.4.3
|
||||
rm -rf $(RACK_DEP_PATH)/libsamplerate-0.1.9
|
||||
rm -rf $(RACK_DEP_PATH)/speexdsp-SpeexDSP-1.2rc3
|
||||
rm -rf $(RACK_DEP_PATH)/zstd-1.4.5
|
||||
rm -rf $(SURGE_DEP_PATH)
|
||||
|
||||
download: \
|
||||
$(DEP_PATH)/jansson-2.12 \
|
||||
$(DEP_PATH)/libarchive-3.4.3/.stamp-patched \
|
||||
$(DEP_PATH)/libsamplerate-0.1.9/.stamp-patched \
|
||||
$(DEP_PATH)/speexdsp-SpeexDSP-1.2rc3/.stamp-patched \
|
||||
$(DEP_PATH)/zstd-1.4.5/.stamp-patched
|
||||
$(RACK_DEP_PATH)/jansson-2.12 \
|
||||
$(RACK_DEP_PATH)/libarchive-3.4.3/.stamp-patched \
|
||||
$(RACK_DEP_PATH)/libsamplerate-0.1.9/.stamp-patched \
|
||||
$(RACK_DEP_PATH)/speexdsp-SpeexDSP-1.2rc3/.stamp-patched \
|
||||
$(RACK_DEP_PATH)/zstd-1.4.5/.stamp-patched
|
||||
|
||||
quickjs: $(DEP_PATH)/lib/libquickjs.a
|
||||
quickjs: $(RACK_DEP_PATH)/lib/libquickjs.a
|
||||
surge: $(SURGE_LIB)
|
||||
|
||||
# --------------------------------------------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue