Difference between revisions of "Build Environment Effort/Module Migration Tips"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Here are some useful tips for converting an OOo module to the new Build Environment)
(Undo revision 199739 by Ldb (Talk))
Line 89: Line 89:
 
|}
 
|}
  
 
+
{{Documentation/Note|Use '''gb_Library_OOOEXT''' instead of $(DLLPOSTFIX)$(DLLPOST)}}
{{Documentation/Note|Unit test support is new in CWS gnumake3.}}
+
 
+
* For each CppUnit test, create a CppunitTest_foo.mk makefile from the template.
+
In Module_foo.mk, use <code>gb_Module_add_check_targets</code> to activate the test.
+
* For each unoapi/complex test, create a JunitTest_foo.mk makefile from the template.
+
In Module_foo.mk, use <code>gb_Module_add_subsequentcheck_targets</code> to activate the test.
+
  
 
=== Tips 3: Components ===
 
=== Tips 3: Components ===

Revision as of 05:00, 7 March 2012

Edit.png

Build Environment Effort

Quick Navigation

About this template


The overview steps for migrating a module are tracked here

Here are some useful tips for converting an OOo module to the new Build Environment

Tips 1: Deliver to the solver

Usually there are some header files to be delivered to the solver and the header files, which located at $(SRCDIR)/module/inc. So you can use the Step 3 in Module Migration.

When you need to deliver some headers in source, you can create a file in the module root called Package_source.mk

$(eval $(call gb_Package_Package,toolkit_source,$(SRCDIR)/toolkit/source))
#deliver $(SRCDIR)/toolkit/source/ layout/core/bin.hxx to $SOLARVER/$INPATH/inc/layout/core/bin.hxx
$(eval $(call gb_Package_add_file,toolkit_source,inc/layout/core/bin.hxx,layout/core/bin.hxx))
...

When you need to deliver some utility files, such as *.xml, *cfg ..., you can create a file in the module root called Package_util.mk

$(eval $(call gb_Package_Package,toolkit_util,$(SRCDIR)/toolkit/util))
#deliver $(SRCDIR)/toolkit/util/tookit.xml to $SOLARVER/$INPATH/xml/toolkit.xml
$(eval $(call gb_Package_add_file,toolkit_util,xml/toolkit.xml,toolkit.xml))

Then don't forget to add this files in Module_toolkit.mk (in our case, for other modules, use the name of that module)

...
$(eval $(call gb_Module_add_targets,tools,\
    ...
    Package_source \
    Package_util \
    ...      
 ))
...

Tips 2: Useful Variations

When you writing the makefile, you may need some pre-defined vars for your function. Here is some useful vars.

Vars\OS Windows Linux MacOSX
GUI WNT UNX UNX
GUIBASE WIN unx aqua
OS WNT LINUX MACOSX
COM MSC GCC GCC
COM MSC GCC GCC
INPATH wntmsci12.pro unxlngi6.pro unxmacxi.pro
OUTDIR "$SOLARVER/$INPATH" "$SOLARVER/$INPATH" "$SOLARVER/$INPATH"
WORKDIR "$SOLARVER/$INPATH/workdir" "$SOLARVER/$INPATH/workdir" "$SOLARVER/$INPATH/workdir"
gb_Library_OOOEXT .dll .so .dylib

Template:Documentation/Note

Tips 3: Components

TO-DO...

I hope this tutorial gives you some useful tips with the new build system. If you find some other good tips, please to contribute here. Let's hack with the new build system!

Personal tools