summaryrefslogtreecommitdiff
path: root/bin/MakeProjectCreator/README
blob: 8b69baa3bdce4eed829f4b791899dbb643c09499 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
The Makefile, Project and Workspace Creator.
Designed by Justin Michel (michel_j@ociweb.com) and Chad Elliott.
Implemented by Chad Elliott (elliott_c@ociweb.com).


A single tool (mpc.pl) can be used to generate tool specific input (i.e.
Makefile, dsp, vcproj, etc).  The generator takes platform and building
tool generic files (mpc files) as input which describe basic information
needed to generate a "project" file for various build tools.  These tools
include GNU Make, NMake, Visual C++ 6, Visual C++ 7, etc.

One of the many unique and useful features of the Makefile, Project and
Workspace Creator is that the project definition files can employ the idea
of inheritance.  This feature allows a user to set up a basic base project
(mpb file) that can contain information that is applicable to all
sub-projects.  Things such as include paths, library paths and inter-project
dependencies could be described in this base project and any project that
inherits from it would contain this information as well.

Another set of files, known as template input files (mpd files), provides
the generator with the necessary information to fill platform and build
tool specific information for dynamic and static library and binary
executable projects.

Together, the generic input files and the template input files are applied
toward a platform and build specific template (mpt file) to create the final
product (a build tool specific input file).  These templates contain
"variables" that are filled in by the project creator with information
gathered through the mpc and mpd files and possibly by default values set
within the template itself.

Workspaces are defined by providing a list of mpc files in a single (mwc)
file.  For each mpc file specified, the workspace creator (mwc.pl) calls
upon the project creator to generate the project.  After all of the projects
are successfully generated, the tool specific workspace is generated
containing the projects and any defined inter-project dependency information
(if supported by the build tool).  If no workspace files are provided to the
workspace creator, then the current directory is traversed and any mpc files
located will be part of the workspace that is generated.


Workspace Declarations
----------------------

workspace(workspace_name) {
  file.mpc
  directory
}

Workspaces can contain individual mpc files or directories.  In the case of
a directory, the workspace creator will traverse it and use any mpc files
that are found.  The workspace files should have an 'mwc' extension.


Project Declarations
--------------------

project(project_name) : baseproject, anotherbaseproject {
  exename   = foo
  includes += "."
  libpaths  = directory
  idlflags -= -Sc

  Source_Files {
    file1.cpp
    file2.cpp
    .
    .
    fileN.cpp
  }

  Header_Files {
    file1.h
    file2.h
    .
    .
    fileN.h
  }
}


The (project_name) part of the project declaration is optional.  If it is
left off, the project name will default to the directory name.  Inheritance
is optional.


Project Keywords
----------------
exename		Specifies the name of the executable that will be created
sharedname	Specifies the name of the shared library that will be created
staticname	Specifies the name of the static library that will be created
dllout		(Windows Only) Specifies where the dll will be placed
libout		(Windows Only) Specifies where the lib will be placed
install		Specifies where the executable (or library non-Windows) will go
idlflags	Specifies the idl flags to be used when processing idl files
idlgendir       Specifies the output directory for idl generated files.
                If a listed idl file has a directory as part of the name,
                the generated files will go in that directory unless
                idlgendir specifies otherwise.
idlpreprocessor	Simple assignment used in the gnu template only
pch_header	Specifies the precompiled header file name
pch_source	Specifies the precompiled source file name
ssl             Specifies that the project will use ssl
tao		Specifies that the project will use TAO
version         Specifies the version number for the library or executable

libpaths	Specifies 1 or more locations to find libraries
includes	Specifies 1 or more locations to find include files
libs		Specifies 1 or more libraries to link into the exe or library
defaultlibs	Specifies 1 or more default libraries to link in
depends         Specifies 1 or more project names upon which this project depends
dllflags	(Windows Only) Specifies preprocessor flags needed for dll's
libflags	(Windows Only) Specifies preprocessor flags needed for lib's

verbatim        This allows arbitrary information to be place in a generated
                project file.  The syntax is as follows:

                verbatim(<project type>, <location>) {
                  ..
                  ..
                }

                When MPC is generating a project of type <project type> and
                comes upon a marker that matches the <location> name, it
                will place the text found inside the construct directly into
                the generated project.  If you need to preserve whitespace,
                the line or lines should be placed inside double quotes.

The Following are GNU only:
requires        Specifies which tao macros should be set to build the target
avoids          Specifies which tao macros should not be set to build the target
compname        Specifies the argument to pass to the ace_components script
comps           Specifies which components are required to build the target
tagname         Specifies the make macro to check before building the target
tagchecks       Specifies the values for tagname to check


Special Keywords Available to Templates
---------------------------------------
project_name	This contains the name of the project.
project_file	This contains the name of the output file.
guid		This is used by the VC7 project and workspace creator.
configurations	When used within a foreach context, this info (each
		configuration) is gathered for use with the VC7 workspace
		creator.
flag_overrides  Used to determine flags that have been overriden on a per
                file basis.


Defaulting Behavior
-------------------
1) If a project name is not specified

   it will be defaulted to the name of the current directory

2) If a particular list is not specified (Source_Files, Header_Files, etc.)

   all of the files in the directory will be added to the corresponding list
   by extension

3) If idl files exist in the directory and
   the IDL_Files components are left defaulted (i.e. not listed) and
   none of the idl generated files are listed in the corresponding lists

   the project is assumed to be a TAO project, the idl files are added to
   the IDL_Files list  and all of the (would be) generated files will be
   added to the front of the corresponding lists (source, inline and
   header lists)

4) If files are listed in the Source_Files list and
   a corresponding header or inline file exists

   the corresponding file will be added to the corresponding list (if it
   isn't already there)

5) If a sharedname is specified and staticname is not

   staticname is assigned the sharedname value (the same applies if
   staticname is specified and sharedname is not)

6) If a target name is not listed (exename, sharedname or staticname)

   it is assumed that the target is a library and the name chosen matches
   the name of the current directory

7) If pch_header is not specified and a header file matches *_pch.h

   it is assumed to be the precompiled header file (the same applies to
   pch_source)

8) If -relative is not used to set ACE_ROOT and the ACE_ROOT environment
   variable is set

   it will be used to set the relative value for ACE_ROOT.  If -relative is
   not used to set TAO_ROOT, it will be set from the TAO_ROOT environment
   variable.  If that is not set, the relative value of ACE_ROOT plus /TAO.

Processing Order
----------------
1) Project file is read
2) Template input file is read
3) Template file is read
4) Output project is written