Debian Codegraph @

odk/examples/cpp/Draw/Makefile

raw symbols SCIP
1 #
2 # This file is part of the LibreOffice project.
3 #
4 # This Source Code Form is subject to the terms of the Mozilla Public
5 # License, v. 2.0. If a copy of the MPL was not distributed with this
6 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 #
8 # This file incorporates work covered by the following license notice:
9 #
10 # Licensed to the Apache Software Foundation (ASF) under one or more
11 # contributor license agreements. See the NOTICE file distributed
12 # with this work for additional information regarding copyright
13 # ownership. The ASF licenses this file to you under the Apache
14 # License, Version 2.0 (the "License"); you may not use this file
15 # except in compliance with the License. You may obtain a copy of
16 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
17 #
18
19 # Builds the C++ Draw example of the SDK.
20
21 PRJ=../../..
22 SETTINGS=$(PRJ)/settings
23
24 include $(SETTINGS)/settings.mk
25 include $(SETTINGS)/std.mk
26
27 # Define non-platform/compiler specific settings
28 COMPONENT_NAME=Draw
29
30 OUT_COMP_INC = $(OUT_INC)/$(COMPONENT_NAME)
31 OUT_COMP_GEN = $(OUT_MISC)/$(COMPONENT_NAME)
32 OUT_COMP_OBJ=$(OUT_OBJ)/$(COMPONENT_NAME)
33
34 CXXFILES = Draw.cxx
35
36 OBJFILES = $(patsubst %.cxx,$(OUT_SLO_COMP)/%.$(OBJ_EXT),$(CXXFILES))
37
38 ENV_OFFICE_TYPES=-env:URE_MORE_TYPES=$(URLPREFIX)$(OFFICE_TYPES)
39
40 # Targets
41 .PHONY: ALL
42 ALL : \
43 CppDrawExample
44
45 include $(SETTINGS)/stdtarget.mk
46
47 $(OUT_COMP_OBJ)/%.$(OBJ_EXT) : %.cxx $(SDKTYPEFLAG)
48 -$(MKDIR) $(subst /,$(PS),$(@D))
49 $(CC) $(CC_FLAGS) $(CC_INCLUDES) -I$(OUT_COMP_INC) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $<
50
51 $(OUT_BIN)/Draw$(EXE_EXT) : $(OUT_COMP_OBJ)/Draw.$(OBJ_EXT)
52 -$(MKDIR) $(subst /,$(PS),$(@D))
53 -$(MKDIR) $(subst /,$(PS),$(OUT_COMP_GEN))
54 ifeq "$(OS)" "WIN"
55 $(LINK) $(EXE_LINK_FLAGS) /OUT:$@ /MAP:$(OUT_COMP_GEN)/$(basename $(@F)).map \
56 $< $(CPPUHELPERLIB) $(CPPULIB) $(SALHELPERLIB) $(SALLIB)
57 else
58 $(LINK) $(EXE_LINK_FLAGS) $(LINK_LIBS) -o $@ $< \
59 $(CPPUHELPERLIB) $(CPPULIB) $(SALHELPERLIB) $(SALLIB) $(STDC++LIB)
60 ifeq "$(OS)" "MACOSX"
61 $(INSTALL_NAME_URELIBS_BIN) $@
62 endif
63 endif
64
65 CppDrawExample : $(OUT_BIN)/Draw$(EXE_EXT)
66 @echo --------------------------------------------------------------------------------
67 @echo The example connects to the office server, create an empty documents and puts some
68 @echo shapes on it.
69 @echo -
70 @echo Use the following command to execute the example!
71 @echo -
72 @echo $(MAKE) Draw.run
73 @echo -
74 @echo --------------------------------------------------------------------------------
75
76 %.run: $(OUT_BIN)/Draw$(EXE_EXT)
77 cd $(subst /,$(PS),$(OUT_BIN)) && $(basename $@) $(ENV_OFFICE_TYPES)
78
79 .PHONY: clean
80 clean :
81 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_INC))
82 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_GEN))
83 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_OBJ))
84 -$(DEL) $(subst \\,\,$(subst /,$(PS),$(OUT_BIN)/Draw*))