1*cdf0e10cSrcweir# Builds the SpreadSheet examples of the Developers Guide.
2*cdf0e10cSrcweir
3*cdf0e10cSrcweirPRJ = ../../../..
4*cdf0e10cSrcweirSETTINGS = $(PRJ)/settings
5*cdf0e10cSrcweir
6*cdf0e10cSrcweirinclude $(SETTINGS)/settings.mk
7*cdf0e10cSrcweirinclude $(SETTINGS)/std.mk
8*cdf0e10cSrcweirinclude $(SETTINGS)/dk.mk
9*cdf0e10cSrcweir
10*cdf0e10cSrcweirCSC_FLAGS = -warnaserror+ -noconfig
11*cdf0e10cSrcweirVBC_FLAGS = -warnaserror+
12*cdf0e10cSrcweirifeq "$(DEBUG)" "yes"
13*cdf0e10cSrcweirCC_FLAGS+=-Zi -MT
14*cdf0e10cSrcweirCSC_FLAGS += -debug+ -checked+ -define:DEBUG -define:TRACE
15*cdf0e10cSrcweirVBC_FLAGS += -debug+ -define:DEBUG=1 -define:TRACE=1
16*cdf0e10cSrcweirelse
17*cdf0e10cSrcweirCSC_FLAGS += -o
18*cdf0e10cSrcweirVBC_FLAGS += -o
19*cdf0e10cSrcweirendif
20*cdf0e10cSrcweir
21*cdf0e10cSrcweirTHIS_OUT_MISC = $(OUT_MISC)/csharp_SpreadsheetExamples
22*cdf0e10cSrcweir
23*cdf0e10cSrcweirSPREADSHEET_OUT:= $(OUT_BIN)/CSharp_SpreadsheetExamples
24*cdf0e10cSrcweirCLI_LIB_LOCATION = $(PRJ)\cli
25*cdf0e10cSrcweir
26*cdf0e10cSrcweir# Targets
27*cdf0e10cSrcweir.PHONY : ALL
28*cdf0e10cSrcweirALL : Info
29*cdf0e10cSrcweir
30*cdf0e10cSrcweirinclude $(SETTINGS)/stdtarget.mk
31*cdf0e10cSrcweir
32*cdf0e10cSrcweir
33*cdf0e10cSrcweir# build executables
34*cdf0e10cSrcweir#csc -lib:"d:\StarOffice 8" does not work. csc does not understand the quotes.
35*cdf0e10cSrcweir#but they are needed if the path contains a space. Therefore we use full path
36*cdf0e10cSrcweir#with the -reference switch
37*cdf0e10cSrcweir$(SPREADSHEET_OUT)/%.exe : %.cs SpreadsheetDocHelper.cs
38*cdf0e10cSrcweir	-$(MKDIR) $(subst /,$(PS),$(@D))
39*cdf0e10cSrcweir	csc $(CSC_FLAGS) \
40*cdf0e10cSrcweir		-target:exe \
41*cdf0e10cSrcweir		-out:$@ \
42*cdf0e10cSrcweir		-reference:"$(CLI_LIB_LOCATION)"\cli_basetypes.dll \
43*cdf0e10cSrcweir		-reference:"$(CLI_LIB_LOCATION)"\cli_uretypes.dll \
44*cdf0e10cSrcweir		-reference:"$(CLI_LIB_LOCATION)"\cli_oootypes.dll \
45*cdf0e10cSrcweir		-reference:"$(CLI_LIB_LOCATION)"\cli_ure.dll \
46*cdf0e10cSrcweir		-reference:"$(CLI_LIB_LOCATION)"\cli_cppuhelper.dll \
47*cdf0e10cSrcweir		$^
48*cdf0e10cSrcweir
49*cdf0e10cSrcweirSpreadsheetSample : $(SPREADSHEET_OUT)/SpreadsheetSample.exe
50*cdf0e10cSrcweir
51*cdf0e10cSrcweirGeneralTableSample : $(SPREADSHEET_OUT)/GeneralTableSample.exe
52*cdf0e10cSrcweir
53*cdf0e10cSrcweirViewSample : $(SPREADSHEET_OUT)/ViewSample.exe
54*cdf0e10cSrcweir
55*cdf0e10cSrcweir.PHONY : Info
56*cdf0e10cSrcweirifeq "$(OS)" "WIN"
57*cdf0e10cSrcweirInfo : SpreadsheetSample GenerateTableSample ViewSample
58*cdf0e10cSrcweir	@echo -------------------------------------------------------------------------------
59*cdf0e10cSrcweir	@echo Please use one of the following commands to execute the examples!
60*cdf0e10cSrcweir	@echo -
61*cdf0e10cSrcweir	@echo $(MAKE) GeneralTableSample.run
62*cdf0e10cSrcweir	@echo $(MAKE) SpreadsheetSample.run
63*cdf0e10cSrcweir	@echo $(MAKE) ViewSample.run
64*cdf0e10cSrcweir	@echo -------------------------------------------------------------------------------
65*cdf0e10cSrcweirelse
66*cdf0e10cSrcweirInfo :
67*cdf0e10cSrcweir	@echo --------------------------------------------------------------------------------
68*cdf0e10cSrcweir	@echo This example works only under Windows!
69*cdf0e10cSrcweir	@echo --------------------------------------------------------------------------------
70*cdf0e10cSrcweirendif
71*cdf0e10cSrcweir
72*cdf0e10cSrcweir%.run : $(SPREADSHEET_OUT)/%.exe
73*cdf0e10cSrcweir	@echo -------------------------------------------------------------------------------
74*cdf0e10cSrcweir	@echo Executing sample $@ $(UNORC) $(CONNECT_STRING)...
75*cdf0e10cSrcweir	@echo -------------------------------------------------------------------------------
76*cdf0e10cSrcweir	cd $(subst /,\\,$(SPREADSHEET_OUT)) && $(basename $@).exe
77*cdf0e10cSrcweir
78*cdf0e10cSrcweir.PHONY: clean
79*cdf0e10cSrcweirclean :
80*cdf0e10cSrcweir	-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_BIN)/CSharp_SpreadsheetExamples)
81*cdf0e10cSrcweir
82*cdf0e10cSrcweir
83