Home

O2 Makegen User Manual

image

Contents

1. Makegen User Manual Release 5 0 April 1998 2 Information in this document is subject to change without notice and should not be construed as a commitment by Technology The software described in this document is delivered under a license or nondisclosure agreement The software can only be used or copied in accordance with the terms of the agreement It is against the law to copy this software to magnetic tape disk or any other medium for any purpose other than the purchaser s own use Copyright 1992 1998 Technology All rights reserved No part of this publication can be reproduced stored in a retrieval system or transmitted in any form or by any means electronic mechanical photocopy without prior written permission of Technology Os OsEngine O2DBAccess OsEngine O Graph OsKit gt 25 O Tools and O2Web are registered trademarks of Technology SQL and AIX are registered trademarks of International Business Machines Corporation Sun SunOS and SOLARIS are registered trademarks of Sun Microsystems Inc X Window System is a registered trademark of the Massachusetts Institute of Technology Unix is a registered trademark of Unix System Laboratories Inc HPUX is a registered trademark of Hewlett Packard Company BOSX is a registered trademark of Bull S A IRIX is a registered trademark of Siemens Nixdorf A G NeXTStep
2. 1 1 System Overview The system architecture of is illustrated in Figure 1 1 External Interfaces Development Tools Dev Tools Standard Dev Tools Makegen OQL C Java Sa Database Engine ODB Engine BER E O Store Wen Figure 1 1 System Architecture The O system can be viewed as consisting of three components The Database Engine provides all the features of a Database system and an object oriented system This engine is accessed with Development Tools such as various programming languages O development tools and any standard development tool Numerous External Interfaces are provided encompassing is a versatile portable distributed high performance dynamic object oriented database system Database Engine e O Store The database management system provides low level facilities through OsStore API to access and manage a database disk volumes files records indices and transactions e O Engine The object database engine provides direct control of schemas classes objects and transactions through OsEngine API It provides full text indexing and search capabilities with O Search and spatial indexing and retrieval capabilities with OoSpatial It includes Notification manager for informing other clients connected to the same O server that an event
3. 52 Makegen User Manual Options of configuration file UseVersion Indicates whether Version mechanism is used or not default is false Define string list Adds or renames macro definitions to the compila tion or link phase None by default ExpClasses class_name s classes to be exported no default ExportLibFile file name list For AIX only Specifies export files for shared librar ies ExpOutputDir directory Directory path in which C files are generated cur rent directory by default HeadersDestDir direc tory Directory where all include files needed to use the generated library must be installed none by default ImpBag type name s Bag of classes or atomic types are imported ImpFiles file name s The C files where imported classes are defined no default ImpList type name s List of classes or atomic type are imported ImpSet type name s Set of classes or atomic type are imported ImpVarray type name s Varray of classes or atomic type are imported Includez directory list Adds directories containing files to be included at compilation or link None by default LibDestDir directory Directory where the generated library must be installed default none LibHeaders file name Files to be treated as the include file of the generated library default none LibName library name
4. Building an O2C application Building an O2Engine application Adding your own makefile Makegen User Manual 19 O2Makegen Configuration File 2 1 2 2 Introduction To build an application you need to provide a configuration file to supply information to to create a makefile The configuration file contains all the necessary information to build your application This information includes the names of source files and precompiled objects executables names The configuration file can have any name but generally the extension cf is used The configuration file is used by and specifies Application source files C cc and h Application library object files archive library shared library and o The library environment Macro definitions and include directories The C preprocessor is run on the configuration file to maximize flexibility You can use cpp macros to customize your configuration file The configuration file syntax A configuration file contains comment lines blank lines and directives A comment line is introduced by a semicolon going to the end of the line C comment syntax is also accepted A directive line contains one of a predefined set of options as the first word followed by user supplied information as in ExpClasses Person City If the user supplied information is a list of items each item
5. Library to build none by default LibObjs object files Object files needed to build the library no default O2Home directory O installation directory Default can be positioned in a site cf file see CUSTOMIZING o2makegen sec tion O2Schema schema name schema where classes will be imported no default O2Server server name server which must be used by import and export tools no default O2System system name system in which the schema resides no default PostTarget string list Specifies the targets in the user written makefile that will be executed after linking rules and before install tules of the generated makefile are executed All tar gets are executed once in the order listed Makegen User Manual 53 Reference Guide PreTarget string list Specifies the targets in the user written makefile that will be executed before any rules of the generated makefile are executed All targets are executed once in the order listed ProgramDestDir direc tory Directory in which the generated program must be installed none by default ProgramLib applica tion libraries name list Specifies the application specific libraries that should be linked with the application none by default For a library libx a or libx so sl you must give in the name list only the part x without lib and extension
6. ProgramLibDir library directories list Specifies the directories containing the application specific libraries none by default ProgramName execut able name Specifies the generation of the program called executable_name no default ProgramObjs object files name list Specifies the object files needed to build the execut able no default object_files RelocatableName Generates a relocatable called relocatable_name no relocatable_name default RelocatableObjs Object files needed to build the relocatable object The object files generated from the source files by an o2cpp_import or o2cpp_export command must not be in this list Repositories directory_list List of directories used as a C template repository during compilation or link phase None by default Sources source_files Source files making up the application or library SubDirs directory_list List of directories in which a make must be triggered Undefine string list Removes macro definitions to the compilation or link phase None by default UserLdFlags flags for the link editor Flags added to the link commands UserMakefile file name Specifies the user written makefile This makefile must contain all targets that are named in the PreTar get and PostTarget options It can also contains the targets all clean and install In this case the actions defined for these targets are exec
7. 2 3 3 Building a relocatable 2 3 4 Compiling sources 2 3 5 Debugging 2 3 6 Computing dependencies e 2 3 7 Installing an application 2 3 8 Triggering makefiles in sub directories 2 3 9 Example Makegen User Manual 21 2 2 Configuration File 2 3 1 Building an application If you want to obtain an executable you must use the following options ProgramName specifies the generation of the program called executable executable_name name no default ProgramObjs object files specifies the object files needed to build the executable name list no default ProgramLib application specifies the application specific libraries that should be libraries name list linked with the application none by default For a library libx a or libx so 1 you must give in the name list only the part x without the lib prefix and the suffix UserLdFlags flags for specifies flags added to the link command the link editor ProgramLibDir library specifies the directories containing the application specific directories list libraries none by default These options generate a target whose name is executable_name This target is added as dependency to the all target which is the default target The action associated with this target is the link edition of all object files and libraries for obtaining the executable If the option
8. ClassName ImpAllPub licMemberFunc Imports all public member functions of the class false by default FileName ClassName ImpAccessPri vateMember Automatically generates access meth ods for private members false by default FileName ImpUseFiles file name s Files which are required to parse File Name For example an include file not explicitly included in the FileName file none by default FileName ImpUseDir directory name s Directory path used to find files speci fied in FileName ImpUseFiles option none by default FileName ImpNoModification Pointers to objects of an imported class are not modified inside FileName by default they are transformed to persis tent pointers FileName ImpLibClasses class_name s Classes belonging to an external C library and used as a superclass of an imported class none by default UseConfirmClasses Indicates whether classes are automati cally confirmed or not after importation in Default is false Makegen User Manual 31 2 2 Configuration File To export classes you must provide the following information ExpOutputDir directory Directory path in which C files are generated current directory by default ExpClasses class_name s classes to be exported no default ExpClassName ExpType Type structure of the ExpClassName
9. Manual 35 O2Makegen Configuration File 2 8 UseMeta UseOQL UseLook and all specific editors UseVersion is not allowed In you must use the schema O Version and not a library all constructs the application clean removes all objects core install installs the application Building an gt API application If you use the O2Engine API interface you can also use If you set the option 02APITarget The generated makefile contains the necessary libraries to your executable For more information refer to the gt API documentation set When building an O Engine API application you can use the following options UseVersion UseOQL UseLook and all specific editors UseMeta is not allowed all constructs the application clean removes all objects core install installs the application 36 Makegen User Manual Adding your own makefile 2 3 9 Example 2 9 Adding your own makefile This option permits to add additional targets or actions which will be performed by the generated makefile This can be done by writing your own makefile and having up to two targets executed when the generated makefile runs PreTarget string Specifies the targets in the user written makefile list that will be executed before any rules of the gen erated makefile All targets are executed onc
10. applications are built using shared version of the libraries from runtime For debugging or delivery purposes you can use the archive versions of the runtime libraries by setting the following option Use ArchiveLib specifies which archive versions of O runtime libraries must be used in place of the shared libraries default is false Makegen User Manual Building a C application 2 3 9 Example 2 5 The following options indicate which runtime libraries should be used to build your application UseOql indicates whether OQL is used or o2sql not default is false UseLook indicates whether O Look is used o2look Xm Xt X11 or not default is false UseLkBrowser indicates whether O Look browser editor is used or not default is false o2look 02look_browser Xm Xt X11 editor is used or not default is false UselkDialog indicates whether dialog o2look o2look dialog box editor is used or not defaultis Xm Xt X11 false UseLkGraph indicates whether O Look graph o2look 02look_graph editor is used or not default is Xm Xt X11 false UseLkPict indicates whether O Look picture o2look o2look Xm Xt X11 UseLkText indicates whether Text editor is used or not default is false o2look 02look_text Xm Xt X11 mechanism is used or not default is false UseO2xt indicates whether O Xt
11. dependent information such as the name of source files header files which must be imported libraries to link command line options gives information about platforms makefile name cpp C preprocessor preprocesses the configuration file default template file gives the default for tools and commands used in the makefile located in OZHOMEBE config platform template file gives the tools and commands used in the makefile when different from the default located in O2HOME config user template file gives the tools and commands used in the makefile for a particular installation when different from the default and from the platform specific ones O2Makegen tool generates a makefile based on all input provided make tool builds the targets specified in the generated makefile Makegen User Manual 13 The Build Process 1 3 Using OsMakegen The model enforced by O Makegen is that within a directory only one program library or re locatable object can be created If you have multiple directories you can define one makefile per directory and a master makefile in the root directory which triggers the other sub makefiles in the sub directories When you run make you usually must tell it what to build The generated makefile allows you to invoke several targets Building And Installing An Application These entry points are crea
12. is also made available to C False by default ExpClassName Exp NoVirtual Specify that the exported methods are not virtual false by default ExpClassName Exp Methods method_name s O C methods of class ExpClassName to be exported none by default For more information refer to the ODMG C Binding documentation set When building an ODMG C application you can use the following options e UseMeta e UseVersion e UseOQL UseLook and all specific editors Warning The object files generated from the source files created by an o2cpp import or o2export command must not be in the ProgramObjs list nor in the LibObjs list The generated makefile contains 8 targets 32 Makegen User Manual Building a C application 2 3 9 Example all triggers export import and finally creation of the executable or of the library clean removes all object core clobber triggers clean unexport and unimport install installs executable or library with include files export exports all indicated O classes import imports all indicated C classes unexport destroys code generated by export unimport destroys O classes generated code and removes patch of the C classes Example 02C Target ProgramName odmg ProgramObjs main o o2connect o pragma o bag o list o set o array o collection o collection_int o collection_r
13. is used or o2xt not default is false UseVersion indicates whether O5 Version o2vm UseMeta indicates whether meta service is used or not default is false o2compiler o2syntax o2cruntime Refer to the O Look documentation set for more information about specific editors and o2xts Building application If you use the C binding you can use o2makegen to create a makefile which allows you to invoke new targets Makegen User Manual 29 O2Makegen Configuration File import unimport export unexport These targets invoke the o2cpp_import o2cpp unimport o2cpp export and o2cpp unexport tools These new targets are added to the dependency list of the target all So when you build your executable by calling make these new targets are triggered if necessary All necessary runtime libraries are automatically added to your executable To create this type of makefile you must set the following option in the configuration file 02C Target To use the import and or export tools from Os the makefile must know the following information O2Schema schema name schema where classes will be imported no default O2System system name system in which the schema resides no default O2Server server name server which must be used by import and export tools no default To import C classes
14. must be separated by one or more spaces Warning If the same label first word of a directive appears multiple times in the same file only the last appearance is relevant All other directives with the same label are ignored Makegen User Manual Basic options 2 3 If the user supplied information is an option preceding the label with the plus sign indicates that the option is active The minus sign indicates that the option is inactive For example Debug indicates that the debug mode is active All options are disabled by default except O2C Target As the C preprocessor is run on your configuration file before it is used you can place cpp directives anywhere in the configuration file to achieve effects such as conditional building Spaces and tabs can be inserted freely between elements without altering semantics Since the configuration file is line oriented line feeds cannot be inserted freely A followed by a new line is treated as a continuation line and permits to break a long line into many shorter lines Unprotected characters cause a search in the environment for the following name In this way HOME is expanded to the string in the process environment If characters are to be literal protect the character using a back slash as in HOME Basic options This section is divided up as follows 2 3 1 Building an application e 2 3 2 Building a library
15. ame Specifies the name of a private template file pushbacksize int_size Changes pushback and argument collection size from the default size 4096 50 Makegen User Manual Options of configuration file 5 2 Options of configuration file function member s ExpClassName Exp Specifies that the exported methods are not virtual NoVirtual false by default ExpClassName Exp methods of class ExpClassName to be Methods exported none by default method_name s FileName Class Imports C class_name as ClassName see C Name ImpAsClass Binding Guide class name FileName Class Specifies the file where the forwarded class is defined Name ImpForward none by default File file_ name FileName Class Member function s to be imported none by default Name ImpMember Func FileName ImpClasses class_name s Classes to be imported The definition of this class is found in FileName no default Classes class_name s FileName ImpForward Allclasses forwarded during the processing of File Classes class_name s Name none by default FileName ImpLib Classes belonging to an external C library and used as a superclass of an imported class none by default FileName ImpOutput Dir directory Path and directory in which C files are generated for the classes in FileName current directory by default Files file_na
16. ct the target Each target has one or more dependencies which can be other targets that must be executed first By recursively executing dependencies the make tool avoids unnecessary actions or compilations Makefiles may contain macros which are text symbols expanded when targets are executed These macros allow for more compact and readable makefiles The tool assists in building applications by creating makefiles that invoke and system tools to perform the build O Makegen reduces the time spent creating makefiles by reducing the information you provide to control what make does A powerful feature of is the capability to generate a platform dependent makefile from platform independent information stored in a configuration file All information you supply is independent of the platform and O Makegen generates all platform dependent stuff Makegen User Manual The O2Makegen tool You do not have to worry about platform dependencies O Makegen can be used to build applications using Oo ODMG C binding 2 C Interface to API runtime from Technology command line options C include file etc gt platform 1 1 1 configuration file template files default user o2makegen Makefile Executable library etc make configuration file provides application
17. e in the order listed PostTarget string Specifies the targets in the user written makefile list that will be executed after linking rules and before install rules of the generated makefile All targets are executed once in the order listed UserMakefile file Specifies the user written makefile This makefile name must contain all targets that are named in the Pre Target and PostTarget options It can also contain the targets all clean and install In this case the actions defined for these targets are executed after the corresponding actions defined in the gen erated makefile In your makefile you can use any of the Makefile macros defined in the generated makefile If you modify your makefile you must rerun to regenerate the makefile For example UserMakefile mymakefile PreTarget serverlaunch PostTarget servershut The user written makefile named mymakefile is specified by the option UserMakefile mymakefile contains the targets serverlaunch and servershut The target serverlaunch will be executed before anything The target servershut will be executed after the construction of the executable Makegen User Manual 37 O2Makegen Configuration File 38 Makegen User Manual 2 Customizing O Makegen This chapter is divided into the following sections Template files Syntax of a template file Lis
18. eal o collection_string o Sources main cc o2connect c pragma cc bag cc list cc set cc array cc collection cc collection int cc collection real cc collection string cc O2Home 502 HOME O2System O2MK SYSTEM O2Server 502 HOST O2Schema odmg s TUseOq1l ImpFiles schema hxx schema hxx ImpClasses A B node subnode Makegen User Manual 33 O2Makegen Configuration File 2 6 ImpSet B node int char double char d String short float ImpList A B node int char double char d String short float ImpBag A B node int char double char d String short float ImpVarray A B node int char double char d String short float To build the executable we must import the C classes B node subnode defined in the file schema hxx We also import collection Set List Bag and Varray for the type A B node int char double char d String short float All are imported the schema odmg s in the system O2MK SYSTEM using the server 5O2MK HOST You can note that O2MK HOME O2MK SYSTEM and O2MK HOST are environment variables and are evaluated during the makefile creation Because the Sources options have a value a depend target is created When you type make depend all dependencies of all files given in Sources are added at the end of the makefile The program name is odmg and is composed of all objects found in the ProgramObjs o
19. et is generated in the makefile 2 3 8 Triggering makefiles in sub directories The model enforced by o2makegen is that within a directory only one program library or re locatable object can be created If you have multiple directories you can define one makefile per directory and a master makefile in the root directory which triggers the other sub makefiles This master makefile can be generated by giving the following information in the configuration file SubDirs directory_list list of directories in which a make must be triggered The generated makefile contains four targets 26 Makegen User Manual Basic options 2 3 9 Example all triggers all targets of all makefiles found in the sub directories clean triggers clean targets of all makefiles found in the subdirectories clobber triggers clobber targets of all makefiles found in the subdirectories install triggers install targets of all makefiles found in the subdirectories Choosing one of these targets generates a call to each makefile found in each listed directory with the chosen target All submakefiles are executed once in the order listed 2 3 9 Example In a first directory named Lib this first configuration file will generate a makefile to construct the archive library my lib from the object files pragma o and collection o These object files are created from files and co
20. h their explanations Makegen User Manual 47 Troubleshooting Guidelines 27512 Configuration file You have not given a configuration file to is mandatory Retry with a configuration file name 27522 Unknown argu One or more options given to O Makegen are ments not recognized Consult the list of options 27532 Cannot create O Makegen cannot create its temporary file temporary file Maybe the file system where temporary files are created is full or you do not have sufficient access rights to the directory where temporary files are created By default this directory is usr tmp on UNIX there is no default value on windows You can modify it by using the environment variable TMPDIR 27542 Error during con O5Makegen has not recognized one or more figuration file options found in the configuration file analysis Another message gives you the unrecognized options and the line number in the configura tion file Verify the spelling of the options in the configuration file 27552 Error during O Makegen cannot create the makefile make file creation Maybe one template file used is wrong If you have created or modified a template file maybe you have forgotten to quote the macro name You can also retry to launch O Makegen using the pushbacksize option This option permits to resize structures used by the analyzer of O Makege
21. has occurred a Version manager for handling multiple object versions and a Replication API for synchronizing multiple copies of an system Makegen User Manual System Overview Programming Languages objects may be created and managed using the following programming languages utilizing all the features available with O persistence collection management transaction management OQL queries etc eC functions can be invoked by programs e C ODMG compliant C binding e Java ODMG compliant Java binding e O2C A powerful and elegant object oriented fourth generation language specialized for easy development of object database applications e OQL ODMG standard easy to use SQL like object query language with special features for dealing with complex objects and methods Development Tools OoGraph Create modify and edit any type of object graph e OsLook Design and develop graphical user interfaces provides interactive manipulation of complex and multimedia objects OsKit Library of predefined classes and methods for faster development of user applications e OsTools Complete graphical programming environment to design and develop database applications Standard Development Tools All standard programming languages can be used with standard environments e g Visual Sun Sparcworks External Interfaces e O Corba Create an O Orbix server to acces
22. in Os you can use the following options in addition to the one described in the above sections ImpFiles file name s files where imported classes are defined no default ImpList type name s list of classes or atomic types to be imported ImpBag type name s bag of classes or atomic types to be imported ImpSet type name s set of classes or atomic types to be imported ImpVarray type name s varray of classes or atomic types to be imported Makegen User Manual Building a C application 2 3 9 Example For each file given in the ImpFiles options you must give the following information FileName ImpClasses class_name s list of classes to be imported The defini tion of this class is found in FileName no default FileName InpOutputDir directory path and directory in which C files are generated for the classes in FileName cur rent directory by default FileName ImpForwardClasses class_name s All classes forwarded during the pro cessing of FileName none by default FileName ClassName ImpAsClass class_name Import class_name as ClassName see C Binding Guide FileName ClassName ImpForward File file name Specifies the file where the forwarded class is defined none by default FileName ClassName InpMember Func function member s Member function s to be imported none by default FileName
23. ion of the OpMakegen command Modifying these macros can lead to unexpected behavior of O Makegen Makegen User Manual List of modifiable macros 3 3 1 Default Command Definitions ArCmd bin ar clq to create libraries CcCmd bin cc to run C compiler CCCmd CC to run C compiler ChmodCmd bin chmod to change mode of file InstallCmd bin install to install files LdCmd bin ld to run loader MakeCmd bin make to run make MkdirCmd bin mkdir to make directory MvCmd bin mv f to move files CpCmd bin cp to copy files RanlibCmd bin true to clean up libraries RmCmd bin rm f to delete files TouchCmd bin touch to touch files PurifyCmd none to purify files QuantifyCmd none to quantify files 3 3 2 Default cc compiler flags OptimizedCFlag O cc compiler flags to turn on optimiza tion DebuggableCFlag g cc compiler flags to turn on debug info ProfilingCFlag G cc compiler flags to turn on profiling info PicCFlag none cc compiler flags to turn on pic code generation DefaultCOptions none default special cc compiler options SpecialCOptions none specific cc compiler options Makegen User Manual 43 3 Customizing O2Makegen 3 3 3 Default C compiler flags OptimizedCCFlag O CC compiler flags to turn on optimiza tion DebuggableCCFlag g CC compiler to turn
24. is a registered trademark of the NeXT Computer Inc Purify Quantify are registered trademarks of Pure Software Inc Windows is a registered trademark of Microsoft Corporation All other company or product names quoted are trademarks or registered trademarks of their respective trademark holders Who should read this manual This manual describes how to build applications by creating makefiles which invoke and system tools generates a platform dependent makefile from platform independent information stored in a configuration file may be utilized for building applications using C O2C C and OsEngine Other documents available are outlined click below See O2 Documentation set TABLE OF CONTENTS This manual is divided into the following chapters e 1 Introduction 2 Runtime Library e Example C application Makegen User Manual TABLE OF CONTENTS The Build Process 9 1 1 VCO DRIN inne 10 12 The O2Makegen tool 12 13 Using E anni 14 1 4 Invoking O2Makegen 16 O2Makegen Configuration File 19 SW E 20 2 2 The configuration file syntax 20 dio m 9 21 24 02 specifie ana 28 2 5 Building a C application e
25. lar definitions for one user or for one project Syntax of a template file A template file consists of a set of m4 macros m4 is a standard UNIX macro processor All symbols used in the generated makefile are defined in template files as m4 macros The primary function of m4 used in template file is define This is used to define and redefine macros The following input define name stuff causes the string name to be defined as stuff The left parenthesis must immediately follow the word define to signal that define has arguments 40 Makegen User Manual Syntax of a template file To redefine N the evaluation must be delayed by quoting define N 100 define N 200 The N in the second definition is replaced by 100 The result is equivalent to the following statement define 100 200 This statement causes an error since only things that look like names can be defined In m4 it is often wise to quote the first argument of a macro The following example will not redefine N define N 100 define N 200 Each occurrence of n in the replacement text where n is a digit is replaced by the n th argument Argument 0 is the name of the macro missing arguments are replaced by the null string is replaced by the number of arguments is replaced by a list of all the arguments separated by commas is equivalent to but each argument is quoted Comments and exa
26. les 53 ImpForwardClasses 51 ImpForwardFile 51 ImpLibClasses 51 ImpList 53 ImpMemberFunc 51 ImpNoModification 51 ImpOutputDir 51 ImpSet 53 ImpUseDirectory 51 ImpUseFiles 51 ImpVarray 53 Include 53 LibDestDir 53 LibHeaders 53 LibName 53 LibObjs 53 O2APITarget 52 O2C Target 52 O2CTarget 52 O2Home 53 O2LinkCTarget 52 O2Schema 53 O2Server 53 O2System 53 PostTarget 53 PreTarget 54 Profile 52 ProgramDestDir 54 ProgramLib 54 ProgramLibDir 54 ProgramName 54 ProgramObjs 54 Purify 52 Quantify 52 RelocatableName 54 RelocatableObjs 54 Repositories 54 Sources 54 SubDirs 54 Undefine 54 UseArchiveLib 52 UseConfirmClasses 52 UseLkBrowser 52 UseLkDialog 52 UseLkGraph 52 UseLkPict 52 UseLkText 52 UseLook 52 UseMeta 52 UseO2xt 52 UseOql 52 UserLdFlags 54 UserMakefile 54 UseVersion 53 13 directives 21 Debugging 24 debug 22 24 profile 22 24 purify 22 25 quantify 22 25 Default template file 13 Dependencies computing 25 depend 25 Sources 25 Makegen User Manual 57 INDEX F Flags 15 default C compiler flags 44 default CC compiler flags 43 install flags 45 linker flags 44 miscellaneous flags 44 Import export tools ExpClasses 32 ExpMethods 32 ExpNoVirtual 32 ExpOutputDir 32 ExpType 32 ImpBag 30 ImpFiles 30 ImpList 30 ImpSet 30 ImpVarray 30 Java 11 Library building 23 CreateArchiveLib 23 t CreateSharedLib 23 LibName 23 library name 23 Objs 23 UserLdFlag
27. llection cc by the compiler LibName my lib LibObjs pragma o collection o Sources pragma cc collection cc In a second directory named Prog this second configuration file will generate a Makefile to construct the executable prog from the object files main o o2connect o and foo o and from the archive library my lib These object files are created from C file main cc by the C compiler and C files o2connect c and foo c by the C compiler ProgramName my prog ProgramObjs main o o2connect o foo o ProgramLib my lib ProgramLibDir Lib Makegen User Manual 27 O2Makegen Configuration File 2 4 Sources main cc o2connect c foo c You can create a master makefile for these two directories in the parent directory SubDirs Lib Prog The generated makefile triggers first the makefile in the Lib directory to construct the my lib library and then the makefile in the Prog directory to construct the executable my prog which uses the library my lib O specific options These options specify information about environment used to generate the makefile These options must be valued if you want to use tools and or libraries from the environment This includes the following items O2Home directory O installation directory Default can be positioned in a site cf file see Customizing O Makegen section By default
28. me s FileName ImpUseDi Directory path used to find files specified in File rectory Name ImpUseFiles option none by default directory name s FileName ImpUse Files which are required to parse FileName For example an include file not explicitly included in the FileName file none by default ExpClassName Exp Type structure of the ExpClassName is also made Type available to C False by default FileName Class Automatically generates access methods for private Name ImpAccessPri members false by default vateMember FileName Class Imports all public member functions of the class false by Name ImpAllPublic default MemberFunc FileName ImpNo Pointers to objects of an imported class are not modi Modification fied inside FileName by default they are transformed to persistent pointers Makegen User Manual 51 5 Reference Guide Debug Permits generation of debuggable executable and add _d to the executable name 02C Target Used to find which O runtime libraries are necessary to build a ODMG C application true by default O2APITarget Used to find which runtime libraries are necessary to build a C application using the O5Engine API interface false by default xO2CTarget Use to find which O runtime libraries are necessary to build an executable from an program false by default O2LinkCTarge
29. mples are enclosed between and new line characters If you want to discard characters up to and including the next new line use the macro dnl For more information consult the m4 documentation For example we put here the contents of a site cf file define CCCmd usr bin CC define Installcmd etc install i define PurifyCmd purify Makegen User Manual 41 Customizing O2Makegen 3 3 Warning define StandardDefines DHP800 DHPUX DHPUX 90 define OptimizedCFlag 01 define PicCFlag Z define OptimizedCCFlag 01 define PicCCFlag 2 define StdCCIncludes I usr include CC define DefaultCCOptions z tal pta ptn ptb define StaticLDFlag Wl a archive define RelocLDFlag r E define DefaultLDOptions 1 Wl E define SpecialLDOptions PTREPOSITORIES define XDir usr lib X11R5 define MotifDir usr lib Motif1 2 In this template file we redefine the macro which gives the location of the C compiler Note that all macro names are quoted as explained above In the following section we describe each macro used in the template files List of modifiable macros You can redefine macros in the site cf template file You can also redefine macros in the file introduced by the deffile opt
30. n The default value is 4096 Try 8192 27572 Cannot find O Makegen does not know the machine type machine or os or the operating system Verify the spelling of type the values of the options 27582 Cannot find tem O5Makegen cannot retrieve the plate installation O2HOMB config directory or you do not have directory read access to it Verify your installation of 27592 Cannot access O Makegen cannot retrieve the template file template files Verify the content of the OSHOME config directory Verify if you have read access to the template files and to the directory Verify your installation of 27602 Cannot find O Makegen uses other programs and cannot name executable find one or more of these programs Verify the existence of the program and the execution right Makegen User Manual 5 Reference Guide This chapter is divided into the following sections Options of the O2Makegen tool Options of configuration file Makegen User Manual 49 Reference Guide 5 1 Options of the O Makegen tool help Displays a help facility and exit version Prints version number of o2makegen and exit verbose Enables verbose mode output makefile_name Specifies the name of the generated makefile Make file by default arch machine Specifies the target architecture name OS OS Specifies the target operating system name deffile file_n
31. of your application that dominate its execution time When you build your application set TQuantify Debug in the configuration file The generated executable is postfixed by quant After running your application the profile of execution is displayed For more information on Quantify see the Quantify documentation set The default value is false 2 3 6 Computing dependencies If you set the following in your configuration file Sources source files source files making up the application or library a depend target is generated Launching make depend modifies the makefile and adds all dependencies between source and include files Makegen User Manual 25 2 O2Makegen Configuration File 2 3 7 Installing an application The following installation information can be set in the configuration file to install the generated program or generated library elsewhere than in the current directory ProgramDestDir directory directory in which the generated program must be installed none by default LibDestDir directory directory where the generated library must be installed default none LibHeaders file_name file to be treated as the include file of the generated library default none HeadersDestDir directory directory where all include files needed to use the gen erated library must be installed none by default If this information is given an install targ
32. on debug info ProfilingCCFlag G CC compiler to turn on profiling info PicCCFlag none CC compiler to turn on pic code gener ation DefaultCCOptions none default special CC compiler options SpecialCCOptions none specific CC compiler options CCExtension extension of CC source files 3 3 4 Miscellaneous flags StdCCIncludes none location of specific includes StandardIncludes none I s for compiler StandardDefines none D s for compiler Xdir none directory containing the X Libraries MotifDir none directory containing the Motif Librar les 3 3 5 Linker flags RelocLDFlag r Linker flag to create a object from a list of object StaticLDFlag none Linker flag to use the static version of a library DefaultLDOptions none Linker default options 44 Makegen User Manual List of modifiable macros 3 3 6 Install flags InstBinFlag 0755 File mode of installed binary InstLibFlag 0664 File mode of installed library InstIncFlag 0444 File mode of installed include 3 3 7 Files used in clean target FilesToClean core Files to be deleted Makegen User Manual Customizing O2Makegen 46 Makegen User Manual Troubleshooting Guidelines This chapter gives advice to correct problems you may encounter when using OsMakegen Here is the list of error messages wit
33. on or link phase None by default Repositories directory_list list of directories used as a C template repository during compilation or link phase None by default 2 3 5 Debugging If you want to obtain an executable with the debug information you must set Debug in the configuration file The default value is false The generated executable is postfixed by _d You can use your favorite debugger to run your application Using the following keyword Profile Makegen User Manual Basic options 2 3 6 Computing dependencies permits to generate an executable or library which contains code for profiling using the OS supplied profiler The name of the executable or of the library is postfixed by p The default value is false Warning If Debug and Profile are set only Debug is relevant Profile is ignored The generated executable is postfixed by d Purify TM a product of Pure Software is a tool that you can use to track down memory leaks and errors in your application When you build your application set TPurify Debug in the configuration file The generated executable is postfixed by pure When you run your executable memory leakage and access errors are tracked down For more information on Purify see the Purify documentation set The default value is false You can also use Quantify TM another product of Pure Software It is a tool that identifies the portions
34. ption list The program uses the execute service So we set the option The Y character is used to break a directive in multiple lines Building a C application If you use the C interface to in your application you can use o2makegen to generate a makefile to build your application You must set the following option 34 Makegen User Manual Building an 2 application 02LinkCTarget For more information refer to the C Interface to O documentation set When building a C application you can use the following options UseMeta UseVersion e UseOQL UseLook and all specific editors all constructs the application clean removes all objects core install installs the application 2 7 Building an application If you want to build an executable from an application you must write a file containing the main procedure of your application This main procedure must make a connection to an server trigger the application using the 02 run application service and at the end disconnect from the server To build your application you can generate a makefile using the following option 02CTarget Do not forget to supply the name of the main object in the ProgramObj option For more information refer to the O C documentation set When building an O5C application you can use the following options Makegen User
35. s O database with CORBA e O DBAccess Connect applications to relational databases on remote hosts and invoke SQL statements e O ODBC Connect remote ODBC client applications to databases e O Web Create an O World Wide Web server to access an database through the internet network Makegen User Manual 11 The Build Process 1 2 gt tool Most software are built using the same underlying procedures obtain user source code files create automatically generated source code files if any use compiler to convert source code to machine code supply any additional compiled objects and libraries use a linker to create an executable install executable and other files needed at run time There are many ways of building an application Software development environments vary widely Tools that support the build process such as O Makegen must therefore be highly flexible to allow for the largest range of situations On UNIX and MS Windows systems application building is supported by the make utility which uses input file known as makefile to invoke system utilities like compiler and linker to build application The make utility contains logic to minimize the steps needed to build applications by avoiding unnecessary steps Makefiles contain entries known as targets which in turn have rules which are lists of commands to execute to constru
36. s 29 25 Building a application ga ol aile 34 2 7 Building an O2C application 35 2 8 Building an O2Engine application 36 2 9 Adding your own 37 Customizing O2Makegen 39 3 1 Template 40 32 of template fila 40 3 3 List of modifiable maoros na 42 Troubleshooting Guidelines 47 Reference Guide 49 5 1 Options of the O2Makegen tool 50 5 2 Options of configuration file 51 Makegen User Manual TABLE CONTENTS INDEX 55 Makegen User Manual TABLE OF CONTENTS Makegen User Manual 1 The Build Process GENERAL OVERVIEW OF THE OzMAKEGEN TOOL Congratulations You are now a user of the tool This chapter gives an overview of the system and describes the different steps in binding together the layers of an Os application to build an executable The chapter is divided into the following sections e System Overview The O2Makegen tool Using O2Makegen Invoking O2Makegen Makegen User Manual 9 1 The Build Process
37. s clean target files 45 default C compiler flags 44 default CC compiler flags 43 default command definitions 43 install flags 45 linker flags 44 miscellaneous flags 44 platform 40 site 40 syntax 40 user 40 U User template file 13 60 Makegen User Manual
38. s 23 M make 13 Makefile 12 generated makefile all 33 clean 33 clobber 33 export 33 import 33 install 33 unexport 33 unimport 33 makefile triggering 26 all 27 clean 27 clobber 27 install 27 SubDirs 26 master 14 sub makefile 14 user makefile PostTarget 37 PreTarget 37 serverlaunch 37 servershut 37 UserMakefile 37 58 Makegen User Manual INDEX O2 T UseArchiveLib 28 UseOql 29 Advantages 12 Architecture 10 O2Home 28 UseLkBrowser 29 UseLkDialog 29 UseLkGraph 29 UseLkPict 29 UseLkText 29 UseLook 29 UseMeta 29 UseO2xt 29 UseVersion 29 OC O Corba 11 O DBAccess 11 OsEngine 10 OsGraph 11 2 config directory 26 48 11 OeLook 11 OoMakegen 12 13 dependencies depend 15 error messages 48 invoking 16 options arch 50 deffile 50 help 50 50 output 50 pushbacksize 48 50 verbose 50 version 50 TMPDIR 48 troubleshooting 47 usr tmp 48 use 14 all 14 clean 14 clobber 14 install 14 gt 11 O Store 10 O Tools 11 O Web 11 OQL 11 Interface 28 P Platform template file 13 R Relocatable building 23 RelocatableName 23 RelocatableObjs 24 UserLdFlags 24 Rules 12 Runtime libraries 28 29 30 52 S Site template file 40 Source files 20 compiling 24 Define 24 Include 24 Repositories 24 Makegen User Manual INDEX Undefine 24 System Architecture 10 Features 12 Template files 40 default 40 macro
39. s Debug Profile Purify or Quantify are set the name of the executable is changed and is postfixed by d p pure and quant Warning runtime libraries must not appear in the ProgramLib list The following option is specific to AIX ExportLibFile file name list Export files are ASCII files identifying external symbols that are made available for another object executable to import See the AIX documentation set for more information Makegen User Manual Basic options 2 3 2 Building a library 2 3 2 Building a library If you want to construct an archive library you must use the following options LibName library name specifies library to build no default UserLdFlags flags for the specifies flags added to the link commands link editor Objs LibObjs specifies object files needed to build the library no default The object files generated from the source files by an o2cpp_import or o2cpp_export command must not be in this list CreateArchiveLib specifies the type of library to be built CreateArch iveLib permits to build an archive library Archive library is the default CreateSharedLib specifies the type of library to be built Create SharedLib permits to build a shared library Indicating CreateSharedLib builds an archive lib These options generate a target whose name is library_name This target is added as dependency to the all target
40. sh to have additional actions performed by the generated makefile This can be done by adding a user makefile which is invoked by the generated makefile The makefile generated by O Makegen contains definitions related to the machine type the operating system and its version These definitions allow portions of your source code to be machine dependent They are passed to the compiler by means of D flags These definitions are described below HP machines DHP800 DHPUX DHPUX_9x DHPUX_10x Makegen User Manual 15 The Build Process 1 4 IBM or Bull machines DIBMRS600 DAIX DAIX_32 DAIX_42 Sun machines DSPARC DSOLARIS DSOLARIS 2x DSUNOS DSUNOS 41 Silicon Graphic machines DSGI DIRIX DIRIX 5 x Digital Alpha Machines DALPHA DOSF1 Intel machines DX86 DSCO DSCO 32 DSOLARIS DSOLARIS 2x DWIN32 x is the release number Invoking O Makegen The syntax is the following o2makegen options configuration_file where options are Makegen User Manual Invoking O2Makegen help displays a help facility and exits version prints version number of o2makegen and exits verbose enables verbose mode output makefile_name specifies the name of the generated makefile Make file by default arch machine specifies the target architecture name OS 05 specifies the target operating system name deffile file_name specifies
41. t Use to find which O runtime libraries are necessary to build a application using the interface to false by default Profile Generates profiled executable and add _p to the exe cutable name Purify Applies Purify on the executable and add _pure to the executable name Quantify Applies Quantify on the executable and add _quant to the executable name UseArchiveLib Specifies that the archive version of 02 runtime library must be used instead of the shared libraries default is false UseConfirmClasses Indicates whether classes are automatically confirmed or not after importation in 02 default is false UseLkBrowser Indicates whether O5Look browser editor is used or not default is false UseLkDialog Indicates whether O5Look dialog box editor is used or not default is false UseLkGraph Indicates whether O Look graph editor is used or not default is false UseLkPict Indicates whether O5Look picture editor is used or not default is false UseLkText Indicates whether O5Look Text editor is used or not default is false UseLook Indicates whether O Look is used or not default is false UseMeta Indicates whether meta service is used or not default is false UseO2xt Indicates whether O5Xt is used or not default is false UseOql Indicates whether OQL is used or not default is false
42. t of modifiable macros Makegen User Manual 39 Customizing O2Makegen 3 1 3 2 Template files When O Makegen is used it obtains definitions for the target system from template files Template files are supplied with O Makegen in the directory O2HOME config A template file defines symbols which can be names of tools operating system commands options etc Default template files contain all default definitions These files have the extension mak They must not be modified Platform template files override default definition found in the default template files The platform template file is named using the machine and operating system name for example sparc solaris 24 cf is the template file for Sparc machines with Solaris 2 4 The extension of these files is cf Normally this file will not be modified But you can modify the site template files The content of this file overrides the content of the platform template file The file is named after the machine and operating system name with the site cf extension for example sparc solaris 24 site cf is the site template file for Sparc machine with Solaris 2 4 This file can be modified to adapt o2makegen to your site configuration A last template file is used to override definitions the user template file This file is introduced by the deffile option of the command This template file permits to have particu
43. ted in the makefile to build and install an application all Creates the executable or the library install Installs the executable or the library and the include files necessary when using the library Whenever you run make all products of the build process are placed in the directory in which make is run Removing Generated Files These entry points are created in the makefile to remove generated files clean removes all the temporary files e g object files and the executable or library clobber performs clean and removes the files generated by tools Makegen User Manual Using O2Makegen e Generating Dependencies The following entry point is created in the makefile to generate dependencies depend adds dependency rules to the makefile The default target i e the one chosen when you run make without indicating a target is all Not all entry points are created in the makefile all clean clobber always created install is created only if the destination is given in the configuration file depend is created only if all sources are given in the configuration file Depending on the type of executable some targets are added to the generated makefile For example when you build a Oo application import and unimport targets are created to import and unimport C classes definitions in the database You may wi
44. the name of a private template file pushbacksize int size sets pushback and argument collection size default 4096 The default values for arch and os options are the architecture and the operating system on which o2makegen is running The arch option recognizes the following machine type SPARC HP800 SGI IBMRS6000 DECALPHA RM X86 The os option recognizes the values SUNOS 41 SOLARIS 2x HPUX 9x HPUX 10x IRIX 5x AIX 32 AIX 42 OSF1 SINIX 54 Makegen User Manual 17 1 The Build Process SCO_32 WINDOWS x is the release number 1 4 1 External influences You can use the TMPDIR environment variable to set the directory in which OsMakegen creates temporary files On Sparc with SUNOS 41 OsMakegen uses the Sun executable usr 5bin m4 available with the system V software installation option 1 4 2 Return value OsMakegen exits with one of the following values 0 if makefile generation is successful gt 0 if aborted due to processing errors lt 0 if makefile generation carried out but with warning messages The following chapter describes the configuration file contents in more details 18 Makegen User Manual O5Makegen Configuration File This chapter is divided into the following sections Introduction The configuration file syntax Basic options O2 specific options Building a application Building a C application
45. uted after the corresponding actions defined in the generated make file 54 Makegen User Manual INDEX Makegen User Manual 55 INDEX Application building 22 C application 34 O2LinkCTarget 35 UseLook 35 UseMeta 35 UseOQL 35 UseVersion 35 C application 29 O2Schema 30 O2Server 30 O2System 30 executable name 22 application 35 all 36 clean 36 install 36 O2CTarget 35 UseLook 36 UseMeta 36 UseOQL 36 API application 36 all 36 clean 36 install 36 UseLook 36 UseMeta 36 UseOQL 36 UseVersion 36 ProgramLib 22 ProgramLibDir 22 ProgramName 22 ProgramObjs 22 UserLdFlags 22 Application installing 26 HeadersDestDir 26 Install 26 LibDestDir 26 LibHeaders 26 ProgramDestDir 26 Architecture 10 C Interface 11 Configuration file 13 20 building application 22 building library 23 building relocatable 23 C application 34 compiling sources 24 computing dependencies 25 debugging 24 installing application 26 application 35 OsEngine API application 36 syntax 20 triggering makefiles 26 user makefile 37 56 Makegen User Manual INDEX Configuration file options Debug 52 Define 53 ExpClasses 53 ExpMethods 51 ExpNoVirtual 51 ExportLibFile 53 ExpOutputDir 53 ExpType 51 HeadersDestDir 53 ImpAccessPrivateMember 51 ImpAllPublicMemberFunc 51 ImpAsClass 51 ImpBag 53 ImpClasses 51 ImpFi
46. which is the default target Using CreateSharedLib and CreateArchiveLib constructs a shared library and not a shared library and an archive library within one makefile If none is used an archive library is built by default The action associated with this target is the archival of all object files in a library 2 3 3 Building a relocatable If you want to construct a relocatable object you must use the following options RelocatableName generation of a relocatable called relocatable name relocatable name no default Makegen User Manual 23 2 O2Makegen Configuration File UserLdFlags flags for the flags added to the link commands link editor RelocatableObjs Object files needed to build the relocatable object object_files These options generate a target whose name is relocatable_name This target is added as dependency to the all target which is the default target The action associated with this target is the construction of one object from all object files 2 3 4 Compiling sources To compile your source files you can supply the following information Define string_list adds or renames macro definitions to the compilation or link phase None by default Undefine string_list removes macro definitions to the compilation or link phase None by default Include directory_list adds directory containing files to be included at com pilati

Download Pdf Manuals

image

Related Search

Related Contents

QuickNet System Floor Heating System Installation Manual  CAT_RM300_070705.doc  SERVICE MANUAL PT-CW230/PT-CX200  on page 5-15.  OPERATING INSTRUCTIONS: AVN 200 PORTABLE  EBDSPIR-AT-DD User Guide - Metway Electrical Industries Limited  

Copyright © All rights reserved.
Failed to retrieve file