Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / odk / examples / CLI / CSharp / Spreadsheet / Makefile
blob6d03200e4a7f13f97cbb7d45ec0b4938a3895bed
2 # This file is part of the LibreOffice project.
4 # This Source Code Form is subject to the terms of the Mozilla Public
5 # License, v. 2.0. If a copy of the MPL was not distributed with this
6 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 # This file incorporates work covered by the following license notice:
10 # Licensed to the Apache Software Foundation (ASF) under one or more
11 # contributor license agreements. See the NOTICE file distributed
12 # with this work for additional information regarding copyright
13 # ownership. The ASF licenses this file to you under the Apache
14 # License, Version 2.0 (the "License"); you may not use this file
15 # except in compliance with the License. You may obtain a copy of
16 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 # Builds the SpreadSheet examples of the Developers Guide.
20 # This Makefile is supposed to be run by a GNU Make built for native
21 # Windows Not the Cygwin GNU Make, not dmake, not Microsoft's NMAKE.
22 # But yeah, that is what the setsdkenv_windows.bat file in
23 # ../../../.. presumably tries to set up.
25 PRJ = ../../../..
26 SETTINGS = $(PRJ)/settings
28 include $(SETTINGS)/settings.mk
29 include $(SETTINGS)/std.mk
31 CSC_FLAGS = -warnaserror+ -noconfig -platform:x86
32 VBC_FLAGS = -warnaserror+
33 ifeq "$(DEBUG)" "yes"
34 CC_FLAGS+=-Zi -MT
35 CSC_FLAGS += -debug+ -checked+ -define:DEBUG -define:TRACE
36 VBC_FLAGS += -debug+ -define:DEBUG=1 -define:TRACE=1
37 else
38 CSC_FLAGS += -o
39 VBC_FLAGS += -o
40 endif
42 THIS_OUT_MISC = $(OUT_MISC)/csharp_SpreadsheetExamples
44 SPREADSHEET_OUT:= $(OUT_BIN)/CSharp_SpreadsheetExamples
46 ifneq "$(OUTDIR)" ""
47 # We are running in a LO build environment, good
48 CLI_LIB_LOCATION = $(OUTDIR)\bin
49 else
50 # Bad guess, but hey, this is how it was
51 CLI_LIB_LOCATION = $(PRJ)\cli
52 endif
54 # Targets
55 .PHONY : ALL
56 ALL : Info
58 include $(SETTINGS)/stdtarget.mk
61 # build executables
62 #csc -lib:"d:\StarOffice 8" does not work. csc does not understand the quotes.
63 #but they are needed if the path contains a space. Therefore we use full path
64 #with the -reference switch
65 $(SPREADSHEET_OUT)/%.exe : %.cs SpreadsheetDocHelper.cs
66 -$(MKDIR) $(subst /,$(PS),$(@D))
67 csc $(CSC_FLAGS) \
68 -target:exe \
69 -out:$@ \
70 -reference:"$(CLI_LIB_LOCATION)"\cli_basetypes.dll \
71 -reference:"$(CLI_LIB_LOCATION)"\cli_uretypes.dll \
72 -reference:"$(CLI_LIB_LOCATION)"\cli_oootypes.dll \
73 -reference:"$(CLI_LIB_LOCATION)"\cli_ure.dll \
74 -reference:"$(CLI_LIB_LOCATION)"\cli_cppuhelper.dll \
77 SpreadsheetSample : $(SPREADSHEET_OUT)/SpreadsheetSample.exe
79 GeneralTableSample : $(SPREADSHEET_OUT)/GeneralTableSample.exe
81 ViewSample : $(SPREADSHEET_OUT)/ViewSample.exe
83 .PHONY : Info
84 ifeq "$(OS)" "WIN"
85 Info : SpreadsheetSample GeneralTableSample ViewSample
86 @echo -------------------------------------------------------------------------------
87 @echo Please use one of the following commands to execute the examples!
88 @echo -
89 @echo $(MAKE) GeneralTableSample.run
90 @echo $(MAKE) SpreadsheetSample.run
91 @echo $(MAKE) ViewSample.run
92 @echo -------------------------------------------------------------------------------
93 else
94 Info :
95 @echo --------------------------------------------------------------------------------
96 @echo This example works only under Windows!
97 @echo --------------------------------------------------------------------------------
98 endif
100 %.run : $(SPREADSHEET_OUT)/%.exe
101 @echo -------------------------------------------------------------------------------
102 @echo Executing sample $@ $(UNORC) $(CONNECT_STRING)...
103 @echo -------------------------------------------------------------------------------
104 cd $(subst /,\\,$(SPREADSHEET_OUT)) && $(basename $@).exe
106 .PHONY: clean
107 clean :
108 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_BIN)/CSharp_SpreadsheetExamples)