1# Builds the WriterDemo 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+ -incremental- -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
18endif
19
20WRITERDEMO_OUT:= $(OUT_BIN)/VB_dotNET_WriterDemo
21
22# Targets
23.PHONY : ALL
24ALL : WriterDemo
25
26include $(SETTINGS)/stdtarget.mk
27
28# build executables
29$(WRITERDEMO_OUT)/%.exe: %.vb
30	-$(MKDIR) $(subst /,$(PS),$(@D))
31	vbc $(VBC_FLAGS) \
32		-target:exe \
33		-out:$@ \
34		-libpath:"$(PRJ)\cli" \
35		-reference:cli_basetypes.dll \
36		-reference:cli_uretypes.dll \
37		-reference:cli_oootypes.dll \
38		-reference:cli_ure.dll \
39		-reference:cli_cppuhelper.dll \
40		-reference:System.dll \
41		-reference:System.Drawing.dll \
42		-reference:System.Windows.Forms.dll \
43		$^
44
45ifeq "$(OS)" "WIN"
46WriterDemo : $(WRITERDEMO_OUT)/WriterDemo.exe
47	@echo -------------------------------------------------------------------------------
48	@echo Please use the following command to execute the example!
49	@echo -
50	@echo $(MAKE) WriterDemo.run
51	@echo -------------------------------------------------------------------------------
52else
53WriterDemo :
54	@echo --------------------------------------------------------------------------------
55	@echo This example works only under Windows!
56	@echo --------------------------------------------------------------------------------
57endif
58
59%.run : $(WRITERDEMO_OUT)/%.exe
60	@echo -------------------------------------------------------------------------------
61	@echo Executing sample $@ $(UNORC) $(CONNECT_STRING)...
62	@echo -------------------------------------------------------------------------------
63	cd $(subst /,\\,$(WRITERDEMO_OUT)) && $(basename $@).exe
64
65.PHONY: clean
66clean :
67	-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_BIN)/VB_dotNET_WriterDemo)
68
69