1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t; fill-column: 100 -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 # Builds the C++ Convertor example of the SDK.
13 SETTINGS
=$(PRJ
)/settings
15 include $(SETTINGS
)/settings.mk
16 include $(SETTINGS
)/std.mk
18 # Define non-platform/compiler specific settings
19 COMPONENT_NAME
=Convertor
21 OUT_COMP_INC
= $(OUT_INC
)/$(COMPONENT_NAME
)
22 OUT_COMP_GEN
= $(OUT_MISC
)/$(COMPONENT_NAME
)
23 OUT_COMP_OBJ
=$(OUT_OBJ
)/$(COMPONENT_NAME
)
25 CXXFILES
= Convertor.
cxx
27 OBJFILES
= $(patsubst %.
cxx,$(OUT_SLO_COMP
)/%.
$(OBJ_EXT
),$(CXXFILES
))
29 ENV_OFFICE_TYPES
=-env
:URE_MORE_TYPES
=$(URLPREFIX
)$(OFFICE_TYPES
)
36 include $(SETTINGS
)/stdtarget.mk
38 $(OUT_COMP_OBJ
)/%.
$(OBJ_EXT
) : %.
cxx $(SDKTYPEFLAG
)
39 -$(MKDIR
) $(subst /,$(PS
),$(@D
))
40 $(CC
) $(CC_FLAGS
) $(CC_INCLUDES
) -I
$(OUT_COMP_INC
) $(CC_DEFINES
) $(CC_OUTPUT_SWITCH
)$(subst /,$(PS
),$@
) $<
42 $(OUT_BIN
)/Convertor
$(EXE_EXT
) : $(OUT_COMP_OBJ
)/Convertor.
$(OBJ_EXT
)
43 -$(MKDIR
) $(subst /,$(PS
),$(@D
))
44 -$(MKDIR
) $(subst /,$(PS
),$(OUT_COMP_GEN
))
46 $(LINK
) $(EXE_LINK_FLAGS
) /OUT
:$@
/MAP
:$(OUT_COMP_GEN
)/$(basename $(@F
)).map \
47 $< $(CPPUHELPERLIB
) $(CPPULIB
) $(SALHELPERLIB
) $(SALLIB
)
49 $(LINK
) $(EXE_LINK_FLAGS
) $(LINK_LIBS
) -o
$@
$< \
50 $(CPPUHELPERLIB
) $(CPPULIB
) $(SALHELPERLIB
) $(SALLIB
) $(STDC
++LIB
)
52 $(INSTALL_NAME_URELIBS_BIN
) $@
56 CppConvertorExample
: $(OUT_BIN
)/Convertor
$(EXE_EXT
)
57 @echo
--------------------------------------------------------------------------------
58 @echo The example loads the
"$(QM)test.odt$(QM)" document in the Convertor example directory
59 @echo and convert it to
test.pdf
61 @echo Use the following command to execute the example
!
63 @echo
$(MAKE
) Convertor.run
65 @echo NOTE
: This example does not use the new UNO bootstrap mechanism
, it uses still a socket
66 @echo
$(SQM
) $(SQM
)connection. The example use the defaultBootstrap_InitialComponentContext method and provides
67 @echo
$(SQM
) $(SQM
)the additional office types via the UNO environment variable
-env
:URE_MORE_TYPES
=...
68 @echo
$(SQM
) $(SQM
)Before you can run this example you have to start your office in listening mode.
70 @echo
$(SQM
) $(SQM
)soffice
"$(QM)--accept=socket,host=localhost,port=2083;urp;StarOffice.ServiceManager$(QM)"
71 @echo
--------------------------------------------------------------------------------
73 %.run
: $(OUT_BIN
)/Convertor
$(EXE_EXT
)
74 cd
$(subst /,$(PS
),$(OUT_BIN
)) && $(basename $@
) $(ENV_OFFICE_TYPES
) $(subst \\,/,$(subst /,$(PS
),"$(OO_SDK_HOME)/examples/cpp/Convertor/test.odt"))
78 -$(DELRECURSIVE
) $(subst /,$(PS
),$(OUT_COMP_INC
))
79 -$(DELRECURSIVE
) $(subst /,$(PS
),$(OUT_COMP_GEN
))
80 -$(DELRECURSIVE
) $(subst /,$(PS
),$(OUT_COMP_OBJ
))
81 -$(DEL
) $(subst \\,\
,$(subst /,$(PS
),$(OUT_BIN
)/Convertor
*))
83 # vim: set noet sw=4 ts=4: