mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-10 21:58:48 +01:00
Unify "script" and "project" under "util".
This commit is contained in:
38
Makefile
38
Makefile
@ -1,34 +1,34 @@
|
||||
# Top-level Makefile. This has targets for various utility things. To actually
|
||||
# compile Wren itself, it invokes script/wren.mk for the various configurations
|
||||
# compile Wren itself, it invokes util/wren.mk for the various configurations
|
||||
# that Wren can be built with.
|
||||
|
||||
# Executables are built to bin/. Libraries are built to lib/.
|
||||
|
||||
# A normal, optimized release build for the current CPU architecture.
|
||||
release:
|
||||
@ $(MAKE) -f script/wren.mk
|
||||
@ $(MAKE) -f util/wren.mk
|
||||
@ cp bin/wren wren # For convenience, copy the interpreter to the top level.
|
||||
|
||||
# A debug build for the current architecture.
|
||||
debug:
|
||||
@ $(MAKE) -f script/wren.mk MODE=debug
|
||||
@ $(MAKE) -f util/wren.mk MODE=debug
|
||||
|
||||
# A release build of just the VM.
|
||||
vm:
|
||||
@ $(MAKE) -f script/wren.mk vm
|
||||
@ $(MAKE) -f util/wren.mk vm
|
||||
|
||||
# Build all configurations.
|
||||
all: debug release
|
||||
@ $(MAKE) -f script/wren.mk LANG=cpp
|
||||
@ $(MAKE) -f script/wren.mk MODE=debug LANG=cpp
|
||||
@ $(MAKE) -f script/wren.mk ARCH=32
|
||||
@ $(MAKE) -f script/wren.mk LANG=cpp ARCH=32
|
||||
@ $(MAKE) -f script/wren.mk MODE=debug ARCH=32
|
||||
@ $(MAKE) -f script/wren.mk MODE=debug LANG=cpp ARCH=32
|
||||
@ $(MAKE) -f script/wren.mk ARCH=64
|
||||
@ $(MAKE) -f script/wren.mk LANG=cpp ARCH=64
|
||||
@ $(MAKE) -f script/wren.mk MODE=debug ARCH=64
|
||||
@ $(MAKE) -f script/wren.mk MODE=debug LANG=cpp ARCH=64
|
||||
@ $(MAKE) -f util/wren.mk LANG=cpp
|
||||
@ $(MAKE) -f util/wren.mk MODE=debug LANG=cpp
|
||||
@ $(MAKE) -f util/wren.mk ARCH=32
|
||||
@ $(MAKE) -f util/wren.mk LANG=cpp ARCH=32
|
||||
@ $(MAKE) -f util/wren.mk MODE=debug ARCH=32
|
||||
@ $(MAKE) -f util/wren.mk MODE=debug LANG=cpp ARCH=32
|
||||
@ $(MAKE) -f util/wren.mk ARCH=64
|
||||
@ $(MAKE) -f util/wren.mk LANG=cpp ARCH=64
|
||||
@ $(MAKE) -f util/wren.mk MODE=debug ARCH=64
|
||||
@ $(MAKE) -f util/wren.mk MODE=debug LANG=cpp ARCH=64
|
||||
|
||||
# Remove all build outputs and intermediate files. Does not remove downloaded
|
||||
# dependencies. Use cleanall for that.
|
||||
@ -43,16 +43,16 @@ cleanall: clean
|
||||
|
||||
# Run the tests against the debug build of Wren.
|
||||
test: debug
|
||||
@ $(MAKE) -f script/wren.mk MODE=debug test
|
||||
@ ./script/test.py $(suite)
|
||||
@ $(MAKE) -f util/wren.mk MODE=debug test
|
||||
@ ./util/test.py $(suite)
|
||||
|
||||
# Generate the Wren site.
|
||||
docs:
|
||||
@ ./script/generate_docs.py
|
||||
@ ./util/generate_docs.py
|
||||
|
||||
# Continuously generate the Wren site.
|
||||
watchdocs:
|
||||
@ ./script/generate_docs.py --watch
|
||||
@ ./util/generate_docs.py --watch
|
||||
|
||||
# Build the docs and copy them to a local "gh-pages" directory.
|
||||
gh-pages: docs
|
||||
@ -60,6 +60,6 @@ gh-pages: docs
|
||||
|
||||
# Build amalgamation of all Wren library files.
|
||||
amalgamation: src/include/wren.h src/vm/*.h src/vm/*.c
|
||||
./script/generate_amalgamation.py > build/wren.c
|
||||
./util/generate_amalgamation.py > build/wren.c
|
||||
|
||||
.PHONY: all amalgamation builtin clean debug docs gh-pages release test vm watchdocs
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
The Wren scripts in this directory get converted to C string literals into files
|
||||
with a `.wren.inc` extension. Those are then `#includ`ed into their respective
|
||||
with a `.wren.inc` extension. Those are then `#include`d into their respective
|
||||
`.c` files so that the interpreter can load them directly without having to do
|
||||
any file IO.
|
||||
|
||||
The script that does this translation is `script/wren_to_c_string.py`.
|
||||
The script that does this translation is `util/wren_to_c_string.py`.
|
||||
|
||||
When any of the ".wren" files in here are changed, the Makefile automatically
|
||||
updates the generated C headers.
|
||||
|
||||
@ -1,108 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{EBF43135-4A7A-400A-8F23-DF49907025AA}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>wren</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);$(SolutionDir)..\..\src\include</IncludePath>
|
||||
<LibraryPath>$(SolutionDir)..\..\build\vs\$(Configuration)\;$(SolutionDir)..\..\build\libuv\Release\lib\;$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86)</LibraryPath>
|
||||
<OutDir>$(SolutionDir)..\..\build\vs\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<IncludePath>$(SolutionDir)..\..\src\include;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(SolutionDir)..\..\build\vs\$(Configuration)\;$(SolutionDir)..\..\build\libuv\Release\lib\;$(LibraryPath)</LibraryPath>
|
||||
<OutDir>$(SolutionDir)..\..\build\vs\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\..\..\src;..\..\..\src\cli;..\..\..\src\module;..\..\..\include;..\..\..\build\libuv\include</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>wren_static_d.lib;libuv.lib;ws2_32.lib;psapi.lib;iphlpapi.lib;userenv.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\..\..\src;..\..\..\src\cli;..\..\..\src\module;..\..\..\include;..\..\..\build\libuv\include</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>wren_static.lib;libuv.lib;ws2_32.lib;psapi.lib;iphlpapi.lib;userenv.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\src\cli\io.c" />
|
||||
<ClCompile Include="..\..\..\src\cli\main.c" />
|
||||
<ClCompile Include="..\..\..\src\cli\vm.c" />
|
||||
<ClCompile Include="..\..\..\src\module\timer.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\src\cli\io.h" />
|
||||
<ClInclude Include="..\..\..\src\cli\vm.h" />
|
||||
<ClInclude Include="..\..\..\src\include\wren.h" />
|
||||
<ClInclude Include="..\..\..\src\module\timer.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\wren_lib\wren_lib.vcxproj">
|
||||
<Project>{89cf2c43-749e-4ec4-a7c3-3f22fba9b874}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@ -1,45 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\src\cli\main.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\cli\io.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\cli\vm.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\module\timer.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\src\include\wren.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\cli\io.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\cli\vm.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\module\timer.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@ -185,18 +185,18 @@ $(BUILD_DIR)/test/%.o: test/api/%.c $(MODULE_HEADERS) $(VM_HEADERS) $(TEST_HEADE
|
||||
@ $(CC) -c $(CFLAGS) $(CLI_FLAGS) -o $@ $(FILE_FLAG) $<
|
||||
|
||||
# Download libuv.
|
||||
$(LIBUV_DIR)/build/gyp/gyp: script/libuv.py
|
||||
@ ./script/libuv.py download
|
||||
$(LIBUV_DIR)/build/gyp/gyp: util/libuv.py
|
||||
@ ./util/libuv.py download
|
||||
|
||||
# Build libuv to a static library.
|
||||
$(LIBUV): $(LIBUV_DIR)/build/gyp/gyp script/libuv.py
|
||||
@ ./script/libuv.py build $(LIBUV_ARCH)
|
||||
$(LIBUV): $(LIBUV_DIR)/build/gyp/gyp util/libuv.py
|
||||
@ ./util/libuv.py build $(LIBUV_ARCH)
|
||||
|
||||
# Wren modules that get compiled into the binary as C strings.
|
||||
src/vm/wren_%.wren.inc: builtin/%.wren script/wren_to_c_string.py
|
||||
@ ./script/wren_to_c_string.py $@ $<
|
||||
src/vm/wren_%.wren.inc: builtin/%.wren util/wren_to_c_string.py
|
||||
@ ./util/wren_to_c_string.py $@ $<
|
||||
|
||||
src/module/%.wren.inc: src/module/%.wren script/wren_to_c_string.py
|
||||
@ ./script/wren_to_c_string.py $@ $<
|
||||
src/module/%.wren.inc: src/module/%.wren util/wren_to_c_string.py
|
||||
@ ./util/wren_to_c_string.py $@ $<
|
||||
|
||||
.PHONY: all cli test vm
|
||||
Reference in New Issue
Block a user