Kaydet (Commit) d6253c04 authored tarafından Rüdiger Timm's avatar Rüdiger Timm

INTEGRATION: CWS sdksample (1.5.4); FILE MERGED

2005/01/12 15:17:57 jsc 1.5.4.7: #i39890# change to new OpenDocument format
2004/11/11 10:33:55 jsc 1.5.4.6: #i29308# adapted
2004/07/30 14:30:08 jsc 1.5.4.5: #i29308# use quotes for unopath option
2004/07/30 08:36:30 jsc 1.5.4.4: #i29308# adjust ECHOLINE for windows
2004/07/29 12:22:51 jsc 1.5.4.3: #i29308# insert ECHOLINE macro to dump an empty line in manifest files
2004/06/07 12:23:54 jsc 1.5.4.2: #i29308# modify dependcies
2004/06/04 14:51:36 jsc 1.5.4.1: #i29308# use of new bootstrap feature
üst dfc154ee
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
# #
# $RCSfile: Makefile,v $ # $RCSfile: Makefile,v $
# #
# $Revision: 1.5 $ # $Revision: 1.6 $
# #
# last change: $Author: rt $ $Date: 2004-05-18 13:30:18 $ # last change: $Author: rt $ $Date: 2005-01-31 17:09:27 $
# #
# The Contents of this file are made available subject to the terms of # The Contents of this file are made available subject to the terms of
# the BSD license. # the BSD license.
...@@ -48,79 +48,104 @@ include $(SETTINGS)/std.mk ...@@ -48,79 +48,104 @@ include $(SETTINGS)/std.mk
include $(SETTINGS)/dk.mk include $(SETTINGS)/dk.mk
# Define non-platform/compiler specific settings # Define non-platform/compiler specific settings
COMPONENT_NAME=DocumentHandlingExamples SAMPLE_NAME=JavaDocumentHandlingExamples
OUT_COMP_CLASS = $(OUT_CLASS)/$(COMPONENT_NAME) SAMPLE_CLASS_OUT = $(OUT_CLASS)/$(SAMPLE_NAME)
SAMPLE_GEN_OUT = $(OUT_MISC)/$(SAMPLE_NAME)
JAVAFILES = \ DIRFLAG=$(OUT_MISC)/$(SAMPLE_NAME)_directory.flag
DocumentConverter.java \
DocumentLoader.java \
DocumentPrinter.java \
DocumentSaver.java
CLASSFILES = $(patsubst %.java,$(OUT_COMP_CLASS)/%.class,$(JAVAFILES)) APP1_NAME=DocumentConverter
APP1_JAR=$(SAMPLE_CLASS_OUT)/$(APP1_NAME).jar
APP2_NAME=DocumentLoader
APP2_JAR=$(SAMPLE_CLASS_OUT)/$(APP2_NAME).jar
APP3_NAME=DocumentPrinter
APP3_JAR=$(SAMPLE_CLASS_OUT)/$(APP3_NAME).jar
APP4_NAME=DocumentSaver
APP4_JAR=$(SAMPLE_CLASS_OUT)/$(APP4_NAME).jar
SDK_CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(CLASSPATH)\ SDK_CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(CLASSPATH)\
$(PATH_SEPARATOR)$(OUT_COMP_CLASS)) $(PATH_SEPARATOR)$(SAMPLE_CLASS_OUT))
# Targets # Targets
.PHONY: ALL .PHONY: ALL
ALL : \ ALL : \
JavaDocumentHandlingExamples $(SAMPLE_NAME)
include $(SETTINGS)/stdtarget.mk include $(SETTINGS)/stdtarget.mk
$(CLASSFILES) : $(JAVAFILES) $(SAMPLE_CLASS_OUT)/%.class : %.java
-$(MKDIR) $(subst /,$(PS),$(@D)) -$(MKDIR) $(subst /,$(PS),$(@D))
$(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(OUT_COMP_CLASS) $(JAVAFILES) $(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(SAMPLE_CLASS_OUT) $<
JavaDocumentHandlingExamples : $(CLASSFILES) $(SAMPLE_CLASS_OUT)/%.mf :
-$(MKDIR) $(subst /,$(PS),$(@D))
@echo Main-Class: com.sun.star.lib.loader.Loader> $@
$(ECHOLINE)>> $@
@echo Name: com/sun/star/lib/loader/Loader.class>> $@
@echo Application-Class: $*>> $@
$(SAMPLE_CLASS_OUT)/%.jar : $(SAMPLE_CLASS_OUT)/%.mf $(SAMPLE_CLASS_OUT)/%.class
-$(MKDIR) $(subst /,$(PS),$(@D))
+cd $(subst /,$(PS),$(SAMPLE_CLASS_OUT)) && $(SDK_JAR) cvfm $(@F) $*.mf $*.class
+$(SDK_JAR) uvf $@ $(SDK_JAVA_UNO_BOOTSTRAP_FILES)
$(APP1_JAR) : $(SAMPLE_CLASS_OUT)/$(APP1_NAME).mf $(SAMPLE_CLASS_OUT)/$(APP1_NAME).class
$(APP2_JAR) : $(SAMPLE_CLASS_OUT)/$(APP2_NAME).mf $(SAMPLE_CLASS_OUT)/$(APP2_NAME).class
$(APP3_JAR) : $(SAMPLE_CLASS_OUT)/$(APP3_NAME).mf $(SAMPLE_CLASS_OUT)/$(APP3_NAME).class
$(APP4_JAR) : $(SAMPLE_CLASS_OUT)/$(APP4_NAME).mf $(SAMPLE_CLASS_OUT)/$(APP4_NAME).class
$(SAMPLE_NAME) : $(APP1_JAR) $(APP2_JAR) $(APP3_JAR) $(APP4_JAR)
@echo -------------------------------------------------------------------------------- @echo --------------------------------------------------------------------------------
@echo The DocumentConverter search the "$(QM)./test$(QM)" directory for documents, convert @echo The $(APP1_NAME) search the "$(QM)./test$(QM)" directory for documents, convert
@echo them using using the "$(QM)MS Word 97$(QM)" filter and the extension "$(QM).doc$(QM)". @echo them using using the "$(QM)MS Word 97$(QM)" filter and the extension "$(QM).doc$(QM)".
@echo The list of possible filter names can changed but a normally uptodate list can be found @echo The converted files are store in "$(QM)$(SAMPLE_GEN_OUT)/converted_files$(QM)".
@echo The list of possible filter names can change. Normally an updated list can be found
@echo on "$(QM)http://www.openoffice.org/files/documents/25/111/filter_description.html$(QM)". @echo on "$(QM)http://www.openoffice.org/files/documents/25/111/filter_description.html$(QM)".
@echo - @echo -
@echo The DocumentLoader loads the document "$(QM)./test/test1.sxw$(QM)". @echo The $(APP2_NAME) loads the document "$(QM)./test/test1.odt$(QM)".
@echo - @echo -
@echo The DocumentPrinter prints the document "$(QM)./test/test1.sxw$(QM)" using the @echo The $(APP3_NAME) prints the document "$(QM)./test/test1.odt$(QM)" using the
@echo the specified printer. If the printer is unknown the defualt printer is used. @echo the specified printer. If the printer is unknown, the default printer is used.
@echo - @echo -
@echo The DocumentSaver loads the document "$(QM)./test/test1.sxw$(QM)" and save it @echo The $(APP5_NAME) loads the document "$(QM)./test/test1.odt$(QM)" and saves it
@echo under "$(QM)./test/testsave.sxw$(QM)". @echo under "$(QM)$(SAMPLE_GEN_OUT)/savetest/testsave.odt$(QM)".
@echo - @echo -
@echo Please use one of the following commands to execute the examples! @echo Please use one of the following commands to execute the examples!
@echo - @echo -
@echo make DocumentConverter.run @echo make $(APP1_NAME).run
@echo make DocumentLoader.run @echo make $(APP2_NAME).run
@echo make DocumentPrinter.run @echo make $(APP3_NAME).run
@echo make DocumentSaver.run @echo make $(APP4_NAME).run
@echo -------- @echo --------
@echo The examples need parameters. Please use one the following commands to @echo The examples need parameters. Please use one the following commands to
@echo start the demo if you do not want the default parameters specified in the @echo start the demo if you do not want the default parameters specified in the
@echo this makefile. Starting without parameters print a command line help: @echo this makefile. Starting without parameters print a command line help:
@echo --- DocumentConverter --- @echo --- $(APP1_NAME) ---
@echo java -classpath "$(QM)$(SDK_CLASSPATH)$(QM)" DocumentConverter "$(QM)directory$(QM)" "$(QM)filter name$(QM)" "$(QM)extension$(QM)" @echo java -jar $(APP1_NAME).jar "$(QM)directory$(QM)" "$(QM)filter name$(QM)" "$(QM)extension$(QM)" "$(QM)output_directory$(QM)"
@echo --- DocumentLoader --- @echo --- $(APP2_NAME) ---
@echo java -classpath "$(QM)$(SDK_CLASSPATH)$(QM)" DocumentLoader "$(QM)Url|path$(QM)" @echo java -jar $(APP2_NAME).jar "$(QM)Url|path$(QM)"
@echo --- DocumentPrinter --- @echo --- $(APP3_NAME) ---
@echo java -classpath "$(QM)$(SDK_CLASSPATH)$(QM)" DocumentPrinter "$(QM)printername$(QM)" "$(QM)filename$(QM)" "$(QM)pages$(QM)" @echo java -jar $(APP3_NAME).jar "$(QM)printername$(QM)" "$(QM)filename$(QM)" "$(QM)pages$(QM)"
@echo --- DocumentSaver --- @echo --- $(APP4_NAME) ---
@echo java -classpath "$(QM)$(SDK_CLASSPATH)$(QM)" DocumentSaver "$(QM)load Url|path$(QM)" "$(QM)save Url|path$(QM)" @echo java -jar $(APP4_NAME).jar "$(QM)load Url|path$(QM)" "$(QM)save Url|path$(QM)"
@echo -------------------------------------------------------------------------------- @echo --------------------------------------------------------------------------------
DocumentConverter.run: $(OUT_COMP_CLASS)/DocumentConverter.class $(APP1_NAME).run: $(APP1_JAR)
$(SDK_JAVA) -classpath "$(SDK_CLASSPATH)" $(basename $@) "./test" "MS Word 97" "doc" -$(MKDIR) $(subst /,$(PS),$(SAMPLE_GEN_OUT)/converted_files)
$(SDK_JAVA) -Dcom.sun.star.lib.loader.unopath="$(OFFICE_PROGRAM_PATH)" -jar $< "./test" "MS Word 97" "doc" "$(SAMPLE_GEN_OUT)/converted_files"
DocumentLoader.run: $(OUT_COMP_CLASS)/DocumentLoader.class $(APP2_NAME).run: $(APP2_JAR)
$(SDK_JAVA) -classpath "$(SDK_CLASSPATH)" $(basename $@) "./test/test1.sxw" $(SDK_JAVA) -Dcom.sun.star.lib.loader.unopath="$(OFFICE_PROGRAM_PATH)" -jar $< "./test/test1.odt"
DocumentPrinter.run: $(OUT_COMP_CLASS)/DocumentPrinter.class $(APP3_NAME).run: $(APP3_JAR)
$(SDK_JAVA) -classpath "$(SDK_CLASSPATH)" $(basename $@) "my_printer" "./test/test1.sxw" 1 $(SDK_JAVA) -Dcom.sun.star.lib.loader.unopath="$(OFFICE_PROGRAM_PATH)" -jar $< "my_printer" "./test/test1.odt" 1
DocumentSaver.run: $(OUT_COMP_CLASS)/DocumentSaver.class $(APP4_NAME).run: $(APP4_JAR)
$(SDK_JAVA) -classpath "$(SDK_CLASSPATH)" $(basename $@) "./test/test1.sxw" "./test/testsave.sxw" -$(MKDIR) $(subst /,$(PS),$(SAMPLE_GEN_OUT)/savetest)
$(SDK_JAVA) -Dcom.sun.star.lib.loader.unopath="$(OFFICE_PROGRAM_PATH)" -jar $< "./test/test1.odt" "$(SAMPLE_GEN_OUT)/savetest/testsave.odt"
.PHONY: clean .PHONY: clean
clean : clean :
-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_CLASS)) -$(DELRECURSIVE) $(subst /,$(PS),$(SAMPLE_CLASS_OUT))
-$(DELRECURSIVE) $(subst /,$(PS),$(SAMPLE_GEN_OUT))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment