build scripts
This commit is contained in:
parent
f27939ee67
commit
713784e783
@ -1,10 +1,15 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<RollForward>LatestMajor</RollForward>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
<OutputType>Library</OutputType>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<ImplicitUsings>disable</ImplicitUsings>
|
||||
<Nullable>disable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="out\MainClass.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
12
FusionCalculator.exe.csproj
Normal file
12
FusionCalculator.exe.csproj
Normal file
@ -0,0 +1,12 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AssemblyName>FusionCalculator</AssemblyName>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<ImplicitUsings>disable</ImplicitUsings>
|
||||
<Nullable>disable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
17
build_c.sh
17
build_c.sh
@ -6,12 +6,25 @@ BIN_FILE="bin/FusionCalculator.exe"
|
||||
SRC_FILES="$(find src/ -name '*.fu')"
|
||||
WARNINGS="-Wall -Wno-unused-value -Wno-unused-function -Wno-unused-variable -Wno-discarded-qualifiers"
|
||||
INCLUDES="$(pkg-config --cflags glib-2.0)"
|
||||
|
||||
if [[ $1 == '--debug' ]]; then
|
||||
COMPILER_ARGS="-O0 -g"
|
||||
else
|
||||
COMPILER_ARGS="-O2"
|
||||
fi
|
||||
LINKER_ARGS="$(pkg-config --libs glib-2.0) -lm"
|
||||
|
||||
rm -rf out bin
|
||||
mkdir out bin
|
||||
|
||||
fut -l c -D C -o "$OUT_FILE" $SRC_FILES
|
||||
args="-l c -D C -o "$OUT_FILE" $SRC_FILES"
|
||||
echo "------------[fut]------------"
|
||||
echo fut $args
|
||||
fut $args
|
||||
|
||||
gcc $WARNINGS $COMPILER_ARGS "$OUT_FILE" -o "$BIN_FILE" $INCLUDES $LINKER_ARGS
|
||||
if [[ $1 != '--translate-only' ]]; then
|
||||
echo "------------[gcc]------------"
|
||||
args="$WARNINGS $COMPILER_ARGS "$OUT_FILE" -o "$BIN_FILE" $INCLUDES $LINKER_ARGS"
|
||||
echo gcc $args
|
||||
gcc $args
|
||||
fi
|
||||
|
||||
@ -13,9 +13,13 @@ for src_file in $SRC_FILES; do
|
||||
echo "---------[$src_file]---------"
|
||||
out_file="out/$(basename $src_file .fu).cs"
|
||||
args="-l cs -D CS -n FusionCalculator $INCLUDES -o $out_file $src_file"
|
||||
echo "fu $args"
|
||||
echo fut $args
|
||||
fut $args
|
||||
done
|
||||
|
||||
if [[ $1 != '--translate-only' ]]; then
|
||||
echo "---------[FusionCalculator.csproj]---------"
|
||||
dotnet build FusionCalculator.csproj -o bin
|
||||
args="build -c Release FusionCalculator.exe.csproj -o bin"
|
||||
echo dotnet $args
|
||||
dotnet $args
|
||||
fi
|
||||
|
||||
Loading…
Reference in New Issue
Block a user