272
edits
Hamzaalloush (talk | contribs) (→MXE: how MXE works) |
|||
| Line 70: | Line 70: | ||
== MXE == | == MXE == | ||
=== What is MXE === | |||
MXE is essentially a set of useful tools and a Makefile, that provides a compact, command-line driven environment for which to cross-compile Windows binaries on Unix-like platforms. | |||
=== MXE's Makefile === | |||
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 example, a simple: | |||
<pre> | |||
$ cd mxe/ | |||
$ make | |||
</pre> | |||
this will parse through, a table set of software names, that are contained within an index.html file. | |||
it does by way of use the GNU Make Standard Library, using set_create, an example of this is. mxe/Makefile, Line:47, exporting the variable ${PKGS} with all software names found in index.html: | |||
<pre> | |||
PKGS := $(call set_create,\ | |||
$(shell $(SED) -n 's/^.* class="package">\([^<]*\)<.*$$/\1/p' '$(TOP_DIR)/index.html')) | |||
</pre> | |||
an example of a software name, which is contained in this table set of software names, is: | |||
<pre> | |||
<tr> | |||
<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> | |||
</tr> | |||
</pre> | |||
=== MXE's Makefile build process === | |||
MXE's Makefile does not itself build software 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">foo</td></nowiki> to a variable $(1), it becomes in this example $(1)="fgfs". | |||
for example, if you were to pass the name of the software to be cross-compile to the GNU make utility, such as: | |||
<pre> | |||
$ make fgfs | |||
</pre> | |||
$(1) would be substituted by "fgfs". | |||
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 result 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> | |||
to obtain a cross-compilation of a useful software, MXE refers to a file that contains the string returned by software name, suffixed by .mk(example, fgfs.mk), in the mxe/src/ directory, you must provide this file. | |||
=== *.MK file === | |||
''''TO DO'''' | |||
=== Project inspiration === | |||
{{FGCquote | {{FGCquote | ||
|Your best would then be, mxe: [http://mxe.cc/ http://mxe.cc/]<br/> | |Your best would then be, mxe: [http://mxe.cc/ http://mxe.cc/]<br/> | ||
edits