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 WriterDemo examples of the Developers Guide.
23
24PRJ = ../../../..
25SETTINGS = $(PRJ)/settings
26
27include $(SETTINGS)/settings.mk
28include $(SETTINGS)/std.mk
29include $(SETTINGS)/dk.mk
30
31CSC_FLAGS = -warnaserror+ -incremental- -noconfig
32VBC_FLAGS = -warnaserror+
33ifeq "$(DEBUG)" "yes"
34CC_FLAGS+=-Zi -MT
35CSC_FLAGS += -debug+ -checked+ -define:DEBUG -define:TRACE
36VBC_FLAGS += -debug+ -define:DEBUG=1 -define:TRACE=1
37else
38CSC_FLAGS += -o
39endif
40
41WRITERDEMO_OUT:= $(OUT_BIN)/VB_dotNET_WriterDemo
42
43# Targets
44.PHONY : ALL
45ALL : WriterDemo
46
47include $(SETTINGS)/stdtarget.mk
48
49# build executables
50$(WRITERDEMO_OUT)/%.exe: %.vb
51	-$(MKDIR) $(subst /,$(PS),$(@D))
52	vbc $(VBC_FLAGS) \
53		-target:exe \
54		-out:$@ \
55		-libpath:"$(PRJ)\cli" \
56		-reference:cli_basetypes.dll \
57		-reference:cli_uretypes.dll \
58		-reference:cli_oootypes.dll \
59		-reference:cli_ure.dll \
60		-reference:cli_cppuhelper.dll \
61		-reference:System.dll \
62		-reference:System.Drawing.dll \
63		-reference:System.Windows.Forms.dll \
64		$^
65
66ifeq "$(OS)" "WIN"
67WriterDemo : $(WRITERDEMO_OUT)/WriterDemo.exe
68	@echo -------------------------------------------------------------------------------
69	@echo Please use the following command to execute the example!
70	@echo -
71	@echo $(MAKE) WriterDemo.run
72	@echo -------------------------------------------------------------------------------
73else
74WriterDemo :
75	@echo --------------------------------------------------------------------------------
76	@echo This example works only under Windows!
77	@echo --------------------------------------------------------------------------------
78endif
79
80%.run : $(WRITERDEMO_OUT)/%.exe
81	@echo -------------------------------------------------------------------------------
82	@echo Executing sample $@ $(UNORC) $(CONNECT_STRING)...
83	@echo -------------------------------------------------------------------------------
84	cd $(subst /,\\,$(WRITERDEMO_OUT)) && $(basename $@).exe
85
86.PHONY: clean
87clean :
88	-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_BIN)/VB_dotNET_WriterDemo)
89
90