Simplify using designated initializers
[LibreOffice.git] / odk / examples / cpp / lokconvert / Makefile
blobfa72a5256ebf54b76e82061a79e4a1762d5093f1
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++ lokconvert example of the SDK.
12 PRJ=../../..
13 SETTINGS=$(PRJ)/settings
15 include $(SETTINGS)/settings.mk
16 include $(SETTINGS)/std.mk
18 # Define non-platform/compiler specific settings
19 COMPONENT_NAME=lokconvert
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 = lokconvert.cxx
27 OBJFILES = $(patsubst %.cxx,$(OUT_SLO_COMP)/%.$(OBJ_EXT),$(CXXFILES))
29 # Targets
30 .PHONY: ALL
31 ALL : \
32 CpplokconvertExample
34 include $(SETTINGS)/stdtarget.mk
36 $(OUT_COMP_OBJ)/%.$(OBJ_EXT) : %.cxx $(SDKTYPEFLAG)
37 -$(MKDIR) $(subst /,$(PS),$(@D))
38 $(CC) $(CC_FLAGS) $(CC_INCLUDES) -I$(OUT_COMP_INC) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $<
40 $(OUT_BIN)/lokconvert$(EXE_EXT) : $(OUT_COMP_OBJ)/lokconvert.$(OBJ_EXT)
41 -$(MKDIR) $(subst /,$(PS),$(@D))
42 -$(MKDIR) $(subst /,$(PS),$(OUT_COMP_GEN))
43 ifeq "$(OS)" "WIN"
44 $(LINK) $(EXE_LINK_FLAGS) /OUT:$@ /MAP:$(OUT_COMP_GEN)/$(basename $(@F)).map \
45 $< $(CPPUHELPERLIB) $(CPPULIB) $(SALHELPERLIB) $(SALLIB)
46 else
47 $(LINK) $(EXE_LINK_FLAGS) $(LINK_LIBS) -o $@ $< \
48 $(CPPUHELPERLIB) $(CPPULIB) $(SALHELPERLIB) $(SALLIB) $(STDC++LIB)
49 ifeq "$(OS)" "MACOSX"
50 $(INSTALL_NAME_URELIBS_BIN) $@
51 endif
52 endif
54 CpplokconvertExample : $(OUT_BIN)/lokconvert$(EXE_EXT)
55 @echo --------------------------------------------------------------------------------
56 @echo The example loads the "$(QM)test.odt$(QM)" document in the lokconvert example directory
57 @echo and convert it to PDF
58 @echo -
59 @echo Use the following command to execute the example!
60 @echo -
61 @echo $(MAKE) lokconvert.run
62 @echo -
63 @echo --------------------------------------------------------------------------------
65 %.run: $(OUT_BIN)/lokconvert$(EXE_EXT)
66 cd $(subst /,$(PS),$(OUT_BIN)) && $(basename $@) $(subst \\,/,$(subst /,$(PS),"$(OO_SDK_HOME)/examples/cpp/lokconvert/test.odt" "$(PWD)/test.pdf"))
68 .PHONY: clean
69 clean :
70 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_INC))
71 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_GEN))
72 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_OBJ))
73 -$(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_BIN)/lokconvert*))
75 # vim: set noet sw=4 ts=4: