1 #**************************************************************
2 #
3 #  Licensed to the Apache Software Foundation (ASF) under one
4 #  or more contributor license agreements.  See the NOTICE file
5 #  distributed with this work for additional information
6 #  regarding copyright ownership.  The ASF licenses this file
7 #  to you under the Apache License, Version 2.0 (the
8 #  "License"); you may not use this file except in compliance
9 #  with the License.  You may obtain a copy of the License at
10 #
11 #    http://www.apache.org/licenses/LICENSE-2.0
12 #
13 #  Unless required by applicable law or agreed to in writing,
14 #  software distributed under the License is distributed on an
15 #  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 #  KIND, either express or implied.  See the License for the
17 #  specific language governing permissions and limitations
18 #  under the License.
19 #
20 #**************************************************************
21 
22 # Builds the SpreadSheet examples of the Developers Guide.
23 
24 PRJ = ../../../..
25 SETTINGS = $(PRJ)/settings
26 
27 include $(SETTINGS)/settings.mk
28 include $(SETTINGS)/std.mk
29 include $(SETTINGS)/dk.mk
30 
31 CSC_FLAGS = -warnaserror+ -noconfig
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
41 
42 THIS_OUT_MISC = $(OUT_MISC)/csharp_SpreadsheetExamples
43 
44 SPREADSHEET_OUT:= $(OUT_BIN)/CSharp_SpreadsheetExamples
45 CLI_LIB_LOCATION = $(PRJ)\cli
46 
47 # Targets
48 .PHONY : ALL
49 ALL : Info
50 
51 include $(SETTINGS)/stdtarget.mk
52 
53 
54 # build executables
55 #csc -lib:"d:\OpenOffice 4" does not work. csc does not understand the quotes.
56 #but they are needed if the path contains a space. Therefore we use full path
57 #with the -reference switch
58 $(SPREADSHEET_OUT)/%.exe : %.cs SpreadsheetDocHelper.cs
59 	-$(MKDIR) $(subst /,$(PS),$(@D))
60 	csc $(CSC_FLAGS) \
61 		-target:exe \
62 		-out:$@ \
63 		-reference:"$(CLI_LIB_LOCATION)"\cli_basetypes.dll \
64 		-reference:"$(CLI_LIB_LOCATION)"\cli_uretypes.dll \
65 		-reference:"$(CLI_LIB_LOCATION)"\cli_oootypes.dll \
66 		-reference:"$(CLI_LIB_LOCATION)"\cli_ure.dll \
67 		-reference:"$(CLI_LIB_LOCATION)"\cli_cppuhelper.dll \
68 		$^
69 
70 SpreadsheetSample : $(SPREADSHEET_OUT)/SpreadsheetSample.exe
71 
72 GeneralTableSample : $(SPREADSHEET_OUT)/GeneralTableSample.exe
73 
74 ViewSample : $(SPREADSHEET_OUT)/ViewSample.exe
75 
76 .PHONY : Info
77 ifeq "$(OS)" "WIN"
78 Info : SpreadsheetSample GeneralTableSample ViewSample
79 	@echo -------------------------------------------------------------------------------
80 	@echo Please use one of the following commands to execute the examples!
81 	@echo -
82 	@echo $(MAKE) GeneralTableSample.run
83 	@echo $(MAKE) SpreadsheetSample.run
84 	@echo $(MAKE) ViewSample.run
85 	@echo -------------------------------------------------------------------------------
86 else
87 Info :
88 	@echo --------------------------------------------------------------------------------
89 	@echo This example works only under Windows!
90 	@echo --------------------------------------------------------------------------------
91 endif
92 
93 %.run : $(SPREADSHEET_OUT)/%.exe
94 	@echo -------------------------------------------------------------------------------
95 	@echo Executing sample $@ $(UNORC) $(CONNECT_STRING)...
96 	@echo -------------------------------------------------------------------------------
97 	cd $(subst /,\\,$(SPREADSHEET_OUT)) && $(basename $@).exe
98 
99 .PHONY: clean
100 clean :
101 	-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_BIN)/CSharp_SpreadsheetExamples)
102 
103 
104