1*0c00bdccSAriel Constenla-Haile#**************************************************************
2*0c00bdccSAriel Constenla-Haile#
3*0c00bdccSAriel Constenla-Haile#  Licensed to the Apache Software Foundation (ASF) under one
4*0c00bdccSAriel Constenla-Haile#  or more contributor license agreements.  See the NOTICE file
5*0c00bdccSAriel Constenla-Haile#  distributed with this work for additional information
6*0c00bdccSAriel Constenla-Haile#  regarding copyright ownership.  The ASF licenses this file
7*0c00bdccSAriel Constenla-Haile#  to you under the Apache License, Version 2.0 (the
8*0c00bdccSAriel Constenla-Haile#  "License"); you may not use this file except in compliance
9*0c00bdccSAriel Constenla-Haile#  with the License.  You may obtain a copy of the License at
10*0c00bdccSAriel Constenla-Haile#
11*0c00bdccSAriel Constenla-Haile#    http://www.apache.org/licenses/LICENSE-2.0
12*0c00bdccSAriel Constenla-Haile#
13*0c00bdccSAriel Constenla-Haile#  Unless required by applicable law or agreed to in writing,
14*0c00bdccSAriel Constenla-Haile#  software distributed under the License is distributed on an
15*0c00bdccSAriel Constenla-Haile#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*0c00bdccSAriel Constenla-Haile#  KIND, either express or implied.  See the License for the
17*0c00bdccSAriel Constenla-Haile#  specific language governing permissions and limitations
18*0c00bdccSAriel Constenla-Haile#  under the License.
19*0c00bdccSAriel Constenla-Haile#
20*0c00bdccSAriel Constenla-Haile#**************************************************************
21*0c00bdccSAriel Constenla-Haile
2234dd1e25SAndrew Rist
23cdf0e10cSrcweir# Builds the WriterDemo examples of the Developers Guide.
24cdf0e10cSrcweir
25cdf0e10cSrcweirPRJ = ../../../..
26cdf0e10cSrcweirSETTINGS = $(PRJ)/settings
27cdf0e10cSrcweir
28cdf0e10cSrcweirinclude $(SETTINGS)/settings.mk
29cdf0e10cSrcweirinclude $(SETTINGS)/std.mk
30cdf0e10cSrcweirinclude $(SETTINGS)/dk.mk
31cdf0e10cSrcweir
32cdf0e10cSrcweirCSC_FLAGS = -warnaserror+ -incremental- -noconfig
33cdf0e10cSrcweirVBC_FLAGS = -warnaserror+
34cdf0e10cSrcweirifeq "$(DEBUG)" "yes"
35cdf0e10cSrcweirCC_FLAGS+=-Zi -MT
36cdf0e10cSrcweirCSC_FLAGS += -debug+ -checked+ -define:DEBUG -define:TRACE
37cdf0e10cSrcweirVBC_FLAGS += -debug+ -define:DEBUG=1 -define:TRACE=1
38cdf0e10cSrcweirelse
39cdf0e10cSrcweirCSC_FLAGS += -o
40cdf0e10cSrcweirendif
41cdf0e10cSrcweir
42cdf0e10cSrcweirWRITERDEMO_OUT:= $(OUT_BIN)/VB_dotNET_WriterDemo
43cdf0e10cSrcweir
44cdf0e10cSrcweir# Targets
45cdf0e10cSrcweir.PHONY : ALL
46cdf0e10cSrcweirALL : WriterDemo
47cdf0e10cSrcweir
48cdf0e10cSrcweirinclude $(SETTINGS)/stdtarget.mk
49cdf0e10cSrcweir
50cdf0e10cSrcweir# build executables
51cdf0e10cSrcweir$(WRITERDEMO_OUT)/%.exe: %.vb
52cdf0e10cSrcweir	-$(MKDIR) $(subst /,$(PS),$(@D))
53cdf0e10cSrcweir	vbc $(VBC_FLAGS) \
54cdf0e10cSrcweir		-target:exe \
55cdf0e10cSrcweir		-out:$@ \
56cdf0e10cSrcweir		-libpath:"$(PRJ)\cli" \
57cdf0e10cSrcweir		-reference:cli_basetypes.dll \
58cdf0e10cSrcweir		-reference:cli_uretypes.dll \
59cdf0e10cSrcweir		-reference:cli_oootypes.dll \
60cdf0e10cSrcweir		-reference:cli_ure.dll \
61cdf0e10cSrcweir		-reference:cli_cppuhelper.dll \
62cdf0e10cSrcweir		-reference:System.dll \
63cdf0e10cSrcweir		-reference:System.Drawing.dll \
64cdf0e10cSrcweir		-reference:System.Windows.Forms.dll \
65cdf0e10cSrcweir		$^
66cdf0e10cSrcweir
67cdf0e10cSrcweirifeq "$(OS)" "WIN"
68cdf0e10cSrcweirWriterDemo : $(WRITERDEMO_OUT)/WriterDemo.exe
69cdf0e10cSrcweir	@echo -------------------------------------------------------------------------------
70cdf0e10cSrcweir	@echo Please use the following command to execute the example!
71cdf0e10cSrcweir	@echo -
72cdf0e10cSrcweir	@echo $(MAKE) WriterDemo.run
73cdf0e10cSrcweir	@echo -------------------------------------------------------------------------------
74cdf0e10cSrcweirelse
75cdf0e10cSrcweirWriterDemo :
76cdf0e10cSrcweir	@echo --------------------------------------------------------------------------------
77cdf0e10cSrcweir	@echo This example works only under Windows!
78cdf0e10cSrcweir	@echo --------------------------------------------------------------------------------
79cdf0e10cSrcweirendif
80cdf0e10cSrcweir
81cdf0e10cSrcweir%.run : $(WRITERDEMO_OUT)/%.exe
82cdf0e10cSrcweir	@echo -------------------------------------------------------------------------------
83cdf0e10cSrcweir	@echo Executing sample $@ $(UNORC) $(CONNECT_STRING)...
84cdf0e10cSrcweir	@echo -------------------------------------------------------------------------------
85cdf0e10cSrcweir	cd $(subst /,\\,$(WRITERDEMO_OUT)) && $(basename $@).exe
86cdf0e10cSrcweir
87cdf0e10cSrcweir.PHONY: clean
88cdf0e10cSrcweirclean :
89cdf0e10cSrcweir	-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_BIN)/VB_dotNET_WriterDemo)
90cdf0e10cSrcweir
91