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