From cd8598cae457fe6a98b40650c831e9970a6e3f37 Mon Sep 17 00:00:00 2001 From: tpoole Date: Tue, 28 Feb 2017 10:30:28 +0000 Subject: [PATCH] Improved the standalone BLOCKS-SDK build --- extras/BLOCKS/Makefile | 24 +++++++++++++++++ extras/BLOCKS/doxygen/process_source_files.py | 13 +++++---- extras/BLOCKS/juce_modules.txt | 5 ---- .../standalone_sdk/create_standalone_sdk.py | 27 ------------------- 4 files changed, 30 insertions(+), 39 deletions(-) create mode 100644 extras/BLOCKS/Makefile delete mode 100644 extras/BLOCKS/juce_modules.txt delete mode 100644 extras/BLOCKS/standalone_sdk/create_standalone_sdk.py diff --git a/extras/BLOCKS/Makefile b/extras/BLOCKS/Makefile new file mode 100644 index 0000000000..a32b47a6ea --- /dev/null +++ b/extras/BLOCKS/Makefile @@ -0,0 +1,24 @@ +# Execute this Makefile in an empty directory to create the contents of the +# standalone SDK repository. + +ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) + +JUCE_MODULES := juce_audio_basics juce_audio_devices juce_blocks_basics juce_core juce_events +SDK_JUCE_MODULES := $(addprefix SDK/,$(JUCE_MODULES)) + +FILES := $(wildcard $(ROOT_DIR)/standalone_sdk/*) +SDK_FILES := $(notdir $(FILES)) + +all: $(SDK_FILES) $(SDK_JUCE_MODULES) + +# Create $(SDK_JUCE_MODULES) +SDK/%: $(ROOT_DIR)/../../modules/% + rm -rf $@ + cp -r $< $@ + +$(SDK_JUCE_MODULES): $(SDK_FILES) + +# Create $(SDK_FILES) +%: $(ROOT_DIR)/standalone_sdk/% + rm -rf $@ + cp -r $< $@ diff --git a/extras/BLOCKS/doxygen/process_source_files.py b/extras/BLOCKS/doxygen/process_source_files.py index bc90516819..e23f1f79f1 100644 --- a/extras/BLOCKS/doxygen/process_source_files.py +++ b/extras/BLOCKS/doxygen/process_source_files.py @@ -71,10 +71,8 @@ def add_doxygen_group(path, group_name): ############################################################################### # Get the list of JUCE modules to include. -juce_modules = [] -with open("../juce_modules.txt", "r") as f: - for line in f: - juce_modules.append(line.strip()) +juce_modules = ("juce_audio_basics", "juce_audio_devices", + "juce_blocks_basics", "juce_core", "juce_events") # A temporary directory to hold our preprocessed source files. build_directory = "build" @@ -94,13 +92,14 @@ module_definitions = [] for module_name in juce_modules: # Copy the required modules. - original_module_dir = os.path.join("..", "..", "..", "modules", module_name) + original_module_dir = os.path.join("..", "..", "..", "modules", + module_name) module_path = os.path.join(build_directory, module_name) shutil.copytree(original_module_dir, module_path) # Parse the module header to get module information. module_header = os.path.join(module_path, module_name + ".h") - with open (module_header, "r") as f: + with open(module_header, "r") as f: content = f.read() block_info_result = re.match(r".*BEGIN_JUCE_MODULE_DECLARATION" "(.*)" @@ -138,7 +137,7 @@ for module_name in juce_modules: if os.path.isdir(os.path.join(module_path, x))] module_groups = {} for subdir in subdirs: - subgroup_name = "{n}-{s}".format(n=module_name, s=subdir) + subgroup_name = "{n}-{s}".format(n=module_name, s=subdir) module_groups[subgroup_name] = os.path.join(module_path, subdir) module_definiton.append("") module_definiton.append( diff --git a/extras/BLOCKS/juce_modules.txt b/extras/BLOCKS/juce_modules.txt deleted file mode 100644 index ee38d54a49..0000000000 --- a/extras/BLOCKS/juce_modules.txt +++ /dev/null @@ -1,5 +0,0 @@ -juce_audio_basics -juce_audio_devices -juce_blocks_basics -juce_core -juce_events diff --git a/extras/BLOCKS/standalone_sdk/create_standalone_sdk.py b/extras/BLOCKS/standalone_sdk/create_standalone_sdk.py deleted file mode 100644 index 8100c7b17b..0000000000 --- a/extras/BLOCKS/standalone_sdk/create_standalone_sdk.py +++ /dev/null @@ -1,27 +0,0 @@ -# Run this script in an empty directory to create the contents of the -# standalone SDK repository. - -import os -import shutil - -script_dir = os.path.dirname(os.path.realpath(__file__)) - -# Get the list of JUCE modules to include. -juce_modules = [] -with open(os.path.join(script_dir, "..", "juce_modules.txt"), "r") as f: - for line in f: - juce_modules.append(line.strip()) - -# Copy the required modules into the SDK dir. -sdk_dir = "SDK" -shutil.copytree(os.path.join(script_dir, sdk_dir), sdk_dir) -for module_name in juce_modules: - shutil.copytree(os.path.join(script_dir, "..", "..", "..", "modules", - module_name), - os.path.join(sdk_dir, module_name)) - -# Copy the examples. -shutil.copytree(os.path.join(script_dir, "examples"), "examples") - -# Copy the README. -shutil.copyfile(os.path.join(script_dir, "README.md"), "README.md")