Building FlightGear - Cross Compiling: Difference between revisions

Jump to navigation Jump to search
→‎MXE: to do, clean up
(→‎MXE: to do, clean up)
Line 79: Line 79:
the Makefile provides a set of Unix portable target-rules for the native GNU make utility.
the Makefile provides a set of Unix portable target-rules for the native GNU make utility.


for a full set of target-rules that can be passed as arguments to the GNU make utility, visit: http://mxe.cc/#usage
for the full set of targets that can be passed as arguments to the GNU make utility, visit: http://mxe.cc/#usage


for example, a simple:
for example, a simple:
Line 87: Line 87:
</pre>
</pre>


this will parse through, a table set of software names, that are contained within an index.html file.
by use of native tools such as the GNU Make Standard Library functions and simple substitution, the Makefile parses through a list of package names, that are contained within an index.html file, and stores them into a white-space separated string.


it does by way of use the GNU Make Standard Library, using the function "set_create" to create the set, an example of this is at {mxe_dir}/Makefile, Line:47.
MXE's Makefile, Line:47  
 
exporting the variable ${PKGS} with all software names found in index.html:
<pre>
<pre>
PKGS      := $(call set_create,\
PKGS      := $(call set_create,\
Line 97: Line 95:
</pre>
</pre>


an example of a software name, which is contained in this table set of software names, is:
packages are contained in index.html as html table elements, the name of the package is the value of html subtype "package":  
<pre>
<pre>
<tr>
        <td class="package">simgear</td>
        <td class="website"><a href="https://sourceforge.net/projects/flightgear/">SimGear - Simulator Construction Tools</a></td>
</tr>
<tr>
<tr>
         <td class="package">fgfs</td>
         <td class="package">fgfs</td>
         <td class="website"><a href="https://sourceforge.net/projects/flightgear/">FlightGear Flight Simulator: free open-source multiplatform flight sim</a></td>
         <td class="website"><a href="https://sourceforge.net/projects/flightgear/">FlightGear Flight Simulator</a></td>
</tr>
</tr>
</pre>
</pre>
Line 107: Line 109:
=== MXE's Makefile build process ===
=== MXE's Makefile build process ===


MXE's Makefile, does not build software by itself. or rather, it does not generate configuration for software, it instead acquires software name from the table set of software names, it then passes this string returned by <nowiki><td class="package">fgfs</td></nowiki> to a variable $(1), it export $(1)="" in this example to $(1)="fgfs".
MXE's Makefile, does not build software by itself. or rather, it does not generate configuration for software.


for example, if you were to pass the name of the software to be cross-compile to the GNU make utility, such as:
for example, if you were to pass the name of a package to be cross-compiled to the GNU make utility in MXE, such as:  
<pre>
<pre>
$ make fgfs
$ make fgfs
</pre>  
</pre>  


$(1) would be substituted by "fgfs".
'''TO DO'''
 
in the mxe/Makefile, Line:362, 'make' will only build a blank file such as $(PREFIX)/$(3)/installed/$(1), which attempts to declare a successful build when all the commands below returned an exit status of (0), example.
 
<pre>
.PHONY: $(1)
$(1): $(PREFIX)/$(3)/installed/$(1)
$(PREFIX)/$(3)/installed/$(1): $(TOP_DIR)/src/$(1).mk \
                          $(wildcard $(TOP_DIR)/src/$(1)-*.patch) \
                          $(wildcard $(TOP_DIR)/src/$(1)-test*) \
                          $(addprefix $(PREFIX)/$(3)/installed/,$(value $(call LOOKUP_PKG_RULE,$(1),DEPS,$(3)))) \
                          | $(if $(DONT_CHECK_REQUIREMENTS),,check-requirements) $(3)
</pre>
 
an installed/$(1) file, is a file indicating what MXE thought was a successful build. in our example, a $(PREFIX)/$(3)/installed/fgfs, is an empty file generated for this purpose.
 
$(PREFIX): returns the absolute path of ${mxe_dir}/usr
 
$(3): is the triplet name, in the form of ${triplet}.${linker_configuration}. see: https://sourceforge.net/p/mingw-w64/wiki2/TypeTriplets/
 
to obtain a cross-compilation of a useful software, MXE refers to a file in the ${mxe_dir}/src/ directory that contains a file with string $(1), suffixed by ".mk" (example, fgfs.mk), this file is used for configuration and Makefile generation of software.


=== *.MK file ===
=== *.MK file ===


''''TO DO''''
'''TO DO'''




272

edits

Navigation menu