1 # Builds the TerminationTest example of the Developers Guide.
4 SETTINGS
= $(PRJ
)/settings
6 include $(SETTINGS
)/settings.mk
7 include $(SETTINGS
)/std.mk
10 APP_NAME
= TerminationTest
13 APP_SRC_DIR
= $(subst /,$(PS
),$(CURDIR
))
14 APP_BIN_DIR
= $(subst /,$(PS
),$(OUT_BIN
))
15 APP_MISC_DIR
= $(subst /,$(PS
),$(OUT_MISC
)/$(APP_NAME
))
17 APP_PROJ_NAME
= $(APP_NAME
).
$(APP_LANG
)proj
18 APP_PROJ_FILE
= $(APP_MISC_DIR
)/$(APP_PROJ_NAME
)
20 APP_EXE_NAME
= $(APP_NAME
)$(EXE_EXT
)
21 APP_EXE_FILE
= $(APP_BIN_DIR
)/$(APP_EXE_NAME
)
23 DOTNET_FLAGS
= -c Release
24 LO_NUPKG_ID
= LibreOffice.Bindings
25 LO_NUPKG_VERSION
= 0.1.0
26 LO_NUPKG_DIR
= $(abspath
$(PRJ
)/dotnet
)
32 include $(SETTINGS
)/stdtarget.mk
36 $(ECHO
) "<Project Sdk=\"Microsoft.NET.Sdk\">" > $@
37 $(ECHO
) " <PropertyGroup>" >> $@
38 $(ECHO
) " <AssemblyName>$(APP_NAME)</AssemblyName>" >> $@
39 $(ECHO
) " <TargetFramework>net8.0</TargetFramework>" >> $@
40 $(ECHO
) " <OutputType>exe</OutputType>" >> $@
41 $(ECHO
) " <PublishSingleFile>true</PublishSingleFile>" >> $@
42 $(ECHO
) " <SelfContained>false</SelfContained>" >> $@
43 $(ECHO
) " <IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>" >> $@
44 $(ECHO
) " <RestoreAdditionalProjectSources>$(LO_NUPKG_DIR)</RestoreAdditionalProjectSources>" >> $@
45 $(ECHO
) " </PropertyGroup>" >> $@
46 $(ECHO
) " <ItemGroup>" >> $@
47 $(ECHO
) " <PackageReference Include=\"$(LO_NUPKG_ID)\" Version=\"$(LO_NUPKG_VERSION)\" />" >> $@
48 $(ECHO
) " <Compile Include=\"$(APP_SRC_DIR)/*.$(APP_LANG)\" />" >> $@
49 $(ECHO
) " </ItemGroup>" >> $@
50 $(ECHO
) "</Project>" >> $@
53 $(APP_EXE_FILE
) : $(APP_PROJ_FILE
)
55 $(SDK_DOTNET
) publish
$< $(DOTNET_FLAGS
) -o
$(<D
)
56 $(COPY
) $(<D
)/$(APP_EXE_NAME
) $@
59 $(APP_NAME
) : $(APP_EXE_FILE
)
60 $(ECHO
) --------------------------------------------------------
61 $(ECHO
) Use the following commands to run the example
:
62 $(ECHO
) $(MAKE
) run OR
$(MAKE
) $(APP_NAME
).run
64 $(ECHO
) And the following commands to
clean the example
:
65 $(ECHO
) $(MAKE
) clean OR
$(MAKE
) $(APP_NAME
).
clean
66 $(ECHO
) --------------------------------------------------------
68 .PHONY
: $(APP_NAME
).run run
69 $(APP_NAME
).run run
: $(APP_EXE_FILE
)
72 .PHONY
: $(APP_NAME
).
clean clean
73 $(APP_NAME
).
clean clean :
74 -$(DELRECURSIVE
) $(APP_MISC_DIR
)
75 -$(DEL
) $(APP_EXE_FILE
)