diff options
author | Juergen Schmidt <jsc@openoffice.org> | 2002-12-19 21:54:08 +0000 |
---|---|---|
committer | Juergen Schmidt <jsc@openoffice.org> | 2002-12-19 21:54:08 +0000 |
commit | 3b906d275d4683a181adc287dd0e30739d0082ce (patch) | |
tree | ab8a2799c699f937767fc2abaaba21c0e38009cb /odk/examples/java/ToDo | |
parent | ecab58156e8987642c9e51dedb05a07765f29cc8 (diff) |
#99053# new build env
Diffstat (limited to 'odk/examples/java/ToDo')
-rw-r--r-- | odk/examples/java/ToDo/Makefile | 149 |
1 files changed, 80 insertions, 69 deletions
diff --git a/odk/examples/java/ToDo/Makefile b/odk/examples/java/ToDo/Makefile index 1d0d95b9e6ad..5aba65240cd3 100644 --- a/odk/examples/java/ToDo/Makefile +++ b/odk/examples/java/ToDo/Makefile @@ -1,100 +1,111 @@ -# Builds the java demo component. +# Builds the Java Calc Addin example of the SDK. -PRJ=..$(PS)..$(PS).. -SETTINGS=../../../settings +PRJ=../../.. +SETTINGS=$(PRJ)/settings include $(SETTINGS)/settings.mk - -include $(SETTINGS)/dk.mk include $(SETTINGS)/std.mk +include $(SETTINGS)/dk.mk # Define non-platform/compiler specific settings -COMPONENT_NAME=ToDo -OUT_COMPONENT = $(OUT_CLASS)$(PS)$(COMPONENT_NAME) -COMPONENT_RDB_NAME = $(COMPONENT_NAME).rdb -COMPONENT_RDB = $(OUT_BIN)$(PS)$(COMPONENT_RDB_NAME) -COMPONENT_PACKAGE_NAME = $(COMPONENT_NAME).zip -COMPONENT_PACKAGE_URL = $(subst \\,/,"file:///$(COMPONENT_PACKAGE_DIR)$(PS)$(COMPONENT_PACKAGE_NAME)") -COMPONENT_JAR_NAME = $(COMPONENT_NAME).jar -COMPONENT_JAR = $(OUT_CLASS)$(PS)$(COMPONENT_JAR_NAME) -COMPONENT_MANIFESTFILE = $(OUT_COMPONENT)$(PS)$(COMPONENT_NAME).Manifest - -REGISTERFLAG = $(OUT_MISC)$(PS)$(COMPONENT_NAME)_register_component.flag -COMPONENTJARFLAG = $(OUT_MISC)$(PS)$(COMPONENT_NAME)_create_component_jar.flag -TYPEFLAG= $(OUT_MISC)$(PS)$(COMPONENT_NAME)_type_generation.flag -JAVAFLAG= $(OUT_MISC)$(PS)$(COMPONENT_NAME)_javac.flag +COMPONENT1_NAME=ToDo +OUT_COMP_CLASS=$(OUT_CLASS)/$(COMPONENT1_NAME) +OUT_COMP_GEN=$(OUT_MISC)/$(COMPONENT1_NAME) +COMPONENT1_RDB_NAME=$(COMPONENT1_NAME).rdb +COMPONENT1_RDB=$(OUT_COMP_GEN)/$(COMPONENT1_RDB_NAME) +COMPONENT1_PACKAGE=$(OUT_BIN)/$(COMPONENT1_NAME).zip +COMPONENT1_PACKAGE_URL=$(subst \\,\,"$(COMPONENT_PACKAGE_DIR)$(PS)$(COMPONENT1_NAME).zip") +COMPONENT1_JAR_NAME=$(COMPONENT1_NAME).jar +COMPONENT1_JAR=$(OUT_CLASS)/$(COMPONENT1_JAR_NAME) +COMPONENT1_MANIFESTFILE=$(OUT_COMP_CLASS)/$(COMPONENT1_NAME).Manifest + +REGISTERFLAG=$(OUT_MISC)$(PS)java_$(COMPONENT1_NAME)_register_component.flag IDLFILES = XToDo.idl # normally the idl file should be stored in a directory tree fitting the module structure, # for the example we know the module structure -PACKAGE = org$(PS)openoffice +PACKAGE = org/openoffice -JAVAFILES = ToDo.java +JAVAFILES = ToDo.java -GENJAVAFILES = $(patsubst %.idl,$(OUT_MISC)$(PS)$(PACKAGE)$(PS)%.java,$(IDLFILES)) -GENURDFILES = $(subst \\,\,$(patsubst %.idl,$(OUT_MISC)$(PS)%.urd,$(IDLFILES))) +GENJAVAFILES = $(patsubst %.idl,$(OUT_COMP_GEN)/$(PACKAGE)/%.java,$(IDLFILES)) +GENURDFILES = $(patsubst %.idl,$(OUT_COMP_GEN)/%.urd,$(IDLFILES)) -CLASSFILES = $(patsubst %.java,$(OUT_COMPONENT)$(PS)%.class,$(JAVAFILES)) +CLASSFILES = $(patsubst %.java,$(OUT_COMP_CLASS)/%.class,$(JAVAFILES)) +CLASSFILES += $(subst $(OUT_COMP_GEN),$(OUT_COMP_CLASS),$(GENJAVAFILES:.java=.class)) -CLASSFILES += $(patsubst %.java,$(OUT_COMPONENT)$(PS)$(PACKAGE)$(PS)%.class,$(GENJAVAFILES)) -COMPONENT_CLASSFILES = $(COMPONENT_NAME).class $(COMPONENT_NAME)$$$(COMPONENT_NAME)Implementation.class -COMPONENT_CLASSFILES += $(subst $(OUT_MISC)$(PS),,$(GENJAVAFILES:.java=.class)) +$(COMPONENT1_NAME)_CLASSFILES = $(COMPONENT1_NAME).class \ + $(COMPONENT1_NAME)$$$(COMPONENT1_NAME)Implementation.class -SDK_CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(OFFICE_CLASSES_DIR)$(PS)jurt.jar\ - $(PATH_SEPARATOR)$(OFFICE_CLASSES_DIR)$(PS)unoil.jar\ - $(PATH_SEPARATOR)$(OFFICE_CLASSES_DIR)$(PS)ridl.jar\ - $(PATH_SEPARATOR)$(OFFICE_CLASSES_DIR)$(PS)sandbox.jar\ - $(PATH_SEPARATOR)$(OFFICE_CLASSES_DIR)$(PS)java_uno.jar\ - $(PATH_SEPARATOR)$(OFFICE_CLASSES_DIR)$(PS)juh.jar\ - $(PATH_SEPARATOR)$(OFFICE_CLASSES_DIR)$(PS)jut.jar\ - $(PATH_SEPARATOR)$(OUT_COMPONENT)) +$(COMPONENT1_NAME)_CLASSFILES += $(subst $(OUT_COMP_GEN)/,,$(GENJAVAFILES:.java=.class)) -OFFICE_FILEURL = $(subst \,/,$(OFFICE_PROGRAM_PATH)) +SDK_CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(OFFICE_CLASSES_DIR)/jurt.jar\ + $(PATH_SEPARATOR)$(OFFICE_CLASSES_DIR)/unoil.jar\ + $(PATH_SEPARATOR)$(OFFICE_CLASSES_DIR)/ridl.jar\ + $(PATH_SEPARATOR)$(OFFICE_CLASSES_DIR)/sandbox.jar\ + $(PATH_SEPARATOR)$(OFFICE_CLASSES_DIR)/juh.jar\ + $(PATH_SEPARATOR)$(OUT_COMP_CLASS)) # Targets .PHONY: ALL -ALL : register +ALL : JavaToDoExample include $(SETTINGS)/stdtarget.mk -$(OUT_COMPONENT) : $(OUT) $(OUT_CLASS) - $(MKDIR) $@ - -$(OUT_COMPONENT)$(PS)$(COMPONENT_NAME).Manifest : $(OUT_COMPONENT) - @echo RegistrationClassName: $(COMPONENT_NAME)> $@ - -$(TYPEFLAG) : $(IDLFILES) - $(BIN_DIR)$(PS)idlc -I. -I$(IDL_DIR) -O$(OUT_MISC) $^ - $(BIN_DIR)$(PS)regmerge $(COMPONENT_RDB) /UCR $(GENURDFILES) -# $(BIN_DIR)$(PS)regmerge $(COMPONENT_RDB) / $(DKREGISTRYNAME) - $(BIN_DIR)$(PS)javamaker -BUCR -Torg.openoffice.XToDo -O$(OUT_MISC) $(COMPONENT_RDB) $(DKREGISTRYNAME) - @echo bla > $@ - -$(JAVAFLAG) : $(OUT_COMPONENT) $(TYPEFLAG) $(JAVAFILES) - javac -classpath "$(SDK_CLASSPATH)" -d $(OUT_COMPONENT) $(GENJAVAFILES) $(JAVAFILES) - @echo bla > $@ - -$(COMPONENTJARFLAG) : $(COMPONENT_MANIFESTFILE) $(JAVAFLAG) -# jar cvfm $(COMPONENT_JAR) $(COMPONENT_MANIFESTFILE) -C $(OUT_COMPONENT) . - cd $(OUT_COMPONENT) && jar cvfm $(COMPONENT_JAR) $(COMPONENT_MANIFESTFILE) $(COMPONENT_CLASSFILES) - $(COPY) $(COMPONENT_JAR) $(OUT_BIN) - cd $(OUT_BIN) && jar cvfM $(COMPONENT_PACKAGE_NAME) $(COMPONENT_JAR_NAME) $(COMPONENT_RDB_NAME) - $(DEL) $(OUT_BIN)$(PS)$(COMPONENT_JAR_NAME) - -$(DEL) $(REGISTERFLAG) - @echo $(COMPONENT_PACKAGE_URL) - @echo bla > $@ - -$(REGISTERFLAG) : $(COMPONENTJARFLAG) +$(OUT_COMP_GEN) : $(OUT) + $(MKDIR) $(subst /,$(PS),$@) + $(MKDIR) $(subst /,$(PS),$(OUT_COMP_CLASS)) + +$(OUT_COMP_CLASS)/%.Manifest : $(OUT_COMP_GEN) + @echo RegistrationClassName: $(basename $(@F))> $@ + +$(OUT_COMP_GEN)/%.urd : %.idl $(OUT_COMP_GEN) + idlc -C -I. -I$(IDL_DIR) -O$(OUT_COMP_GEN) $< + +$(OUT_COMP_GEN)/%.rdb : $(GENURDFILES) + -$(DEL) $(subst /,$(PS),$@) + regmerge $@ /UCR $(GENURDFILES) + +$(OUT_COMP_GEN)/%.java : $(COMPONENT1_RDB) $(OUT_COMP_GEN) + javamaker -BUCR -nD -T$(subst /,.,$(patsubst $(OUT_COMP_GEN)/%.java,%,$@)) -O$(OUT_COMP_GEN) $(COMPONENT1_RDB) $(DKREGISTRYNAME) + +$(CLASSFILES) : $(OUT_COMP_GEN) $(JAVAFILES) $(GENJAVAFILES) + javac -classpath "$(SDK_CLASSPATH)" -d $(OUT_COMP_CLASS) $(GENJAVAFILES) $(JAVAFILES) + +$(OUT_CLASS)/%.jar : $(OUT_COMP_CLASS)/%.Manifest $(CLASSFILES) + cd $(OUT_COMP_CLASS) && jar cvfm ../$(@F) $(<F) $($(basename $(@F))_CLASSFILES) + +$(OUT_BIN)/%.zip : $(OUT_COMP_GEN)/%.rdb $(OUT_CLASS)/%.jar + $(COPY) $(subst /,$(PS),$<) $(subst /,$(PS),$(OUT_CLASS)) + cd $(OUT_CLASS) && jar cvfM ../bin/$(@F) $(^F) + $(DEL) $(subst /,$(PS),$(OUT_CLASS)/$(<F)) + +$(REGISTERFLAG) : $(COMPONENT1_PACKAGE) ifneq "$(SDK_AUTO_DEPLOYMENT)" "" - cd $(OFFICE_PROGRAM_PATH) && pkgchk $(COMPONENT_PACKAGE_URL) - @echo bla > $@ + -$(DEL) $(subst /,$(PS),$@) + $(DEPLOYTOOL) $(COMPONENT1_PACKAGE_URL) + @echo flagged > $(subst /,$(PS),$@) else @echo -------------------------------------------------------------------------------- @echo If you want to install your component automatically, please set the environment - @echo variable SDK_AUTO_DEPLOYMENT = YES. + @echo variable SDK_AUTO_DEPLOYMENT = YES. But note that auto deployment is only + @echo possible if no office instance is running. @echo -------------------------------------------------------------------------------- endif -register: $(REGISTERFLAG) +JavaToDoExample : $(REGISTERFLAG) + @echo -------------------------------------------------------------------------------- + @echo The ToDo Java component was installed if SDK_AUTO_DEPLOYMENT = YES. + @echo Please load the ToDo.sxc document to see how this component works, see + @echo the example description. + @echo -------------------------------------------------------------------------------- + +.PHONY: clean +clean : + -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_CLASS)) + -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_GEN)) + -$(DEL) $(subst /,$(PS),$(COMPONENT1_PACKAGE_URL)) + -$(DEL) $(subst /,$(PS),$(COMPONENT1_JAR)) + -$(DEL) $(subst /,$(PS),$(REGISTERFLAG)) |