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