| 1 |
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t; fill-column: 100 -*- |
| 2 |
# |
| 3 |
# This file is part of the LibreOffice project. |
| 4 |
# |
| 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/. |
| 8 |
# |
| 9 |
|
| 10 |
# Builds the C++ lokconvert example of the SDK. |
| 11 |
|
| 12 |
PRJ=../../.. |
| 13 |
SETTINGS=$(PRJ)/settings |
| 14 |
|
| 15 |
include $(SETTINGS)/settings.mk |
| 16 |
include $(SETTINGS)/std.mk |
| 17 |
|
| 18 |
# Define non-platform/compiler specific settings |
| 19 |
COMPONENT_NAME=lokconvert |
| 20 |
|
| 21 |
OUT_COMP_INC = $(OUT_INC)/$(COMPONENT_NAME) |
| 22 |
OUT_COMP_GEN = $(OUT_MISC)/$(COMPONENT_NAME) |
| 23 |
OUT_COMP_OBJ=$(OUT_OBJ)/$(COMPONENT_NAME) |
| 24 |
|
| 25 |
CXXFILES = lokconvert.cxx |
| 26 |
|
| 27 |
OBJFILES = $(patsubst %.cxx,$(OUT_SLO_COMP)/%.$(OBJ_EXT),$(CXXFILES)) |
| 28 |
|
| 29 |
# Targets |
| 30 |
.PHONY: ALL |
| 31 |
ALL : \ |
| 32 |
CpplokconvertExample |
| 33 |
|
| 34 |
include $(SETTINGS)/stdtarget.mk |
| 35 |
|
| 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),$@) $< |
| 39 |
|
| 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 |
| 53 |
|
| 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 -------------------------------------------------------------------------------- |
| 64 |
|
| 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")) |
| 67 |
|
| 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*)) |
| 74 |
|
| 75 |
# vim: set noet sw=4 ts=4: |