Changes

Jump to: navigation, search

Real World Mozilla Makefile Lab

109 bytes removed, 14:05, 1 April 2008
Resources
[[Dive into Real World Mozilla]] > [[Dive into Real World Mozilla Day 2]] > Makefile Lab
== Overview ==
This lab is designed to give you first-hand experience creating a simple Makefile and using Make to build software. While the Mozilla build system is much more complex than this example, the ideas learned here will get you started understanding how Mozilla is built.
For nostalgic reasons we will work with the source code to Evan Weaver's nled editor, written in C.
== Instructions ==
The lab machines have already been set-up to use MSVC 8 and MozillaBuild RC1. You only need to run '''Mozilla-Build MSVC 8.bat''' (there is a link on the desktop) to begin (i.e., you shouldn't need to install anything).
# Create Download and extract the nled [http://cs.senecac.on.ca/~david.humphrey/nled-2.52-src.zip source code]# Start Mozilla-Build MSVC8.bat to get a proper build environment# Move to the directory called where you extracted the source# Using a text editor, create a file in this directory named '''C:\ffMakefile''' # Examine all the .c files to hold determine dependencies with the source.h files# Make sure Write targets and rules for each of the tree is object files and the final executable# Write a '''not redclean''' on [http://tinderboxtarget in order to delete all .mozillaobj and .org/showbuilds.cgi?tree=Firefox tinderbox]exe files# Check-out You will know you are done when the Firefox code from '''CVS''' following commands result in nled.exe being produced:  $ make $ make clean  or, if you want to combine this into Cone line:\ff (  $ make && make clean == Hints ==* [http://developermsdn2.mozillamicrosoft.orgcom/en-us/docslibrary/Mozilla_Source_Code_%28CVS%29 instructions are here]8we9bhf4(VS.80). You can use either of the following CVSROOT values:#* :pserver:anonymous@cvsaspx CL -mirror.mozilla.org:/cvsrootc option]#* :pserver:anonymous@hera.senecac.on.ca:/cvsroot# Create a '''.mozconfig''' file ([http://developermsdn2.mozillamicrosoft.orgcom/en-us/docslibrary/Configuring_Build_Options instructions are hereyb8e9b8y(VS.80).aspx CL -Fo option]) in * The default extension for object files on win32 is '''C:\ff\mozilla.obj''' with the following:vs. .o on Unix#* Use an Object Directory To create the executable (OBJDIRnled.exe) named you must link all .obj files ''and'objdir'''#* '''Disableuser32.lib''' Optimization#* '''Enable''' Debugging#* Use '''Shared''' libraries instead of Static# Build Running make with the source ([http://developer.mozilla.org/en/docs/Build_and_Install instructions are here])# wait, wait, wait...NOTE: the build process (a debug build) takes approximately '''1 hour-n''' to complete in option will show you all the lab.# Test your new browser:## Set the following environment variables to turn-off assertion dialogs and allow for multiple versions of the browser commands make is going to be run simultaneously, which is helpful when debugging makefiles:##* export XPCOM_DEBUG_BREAK=warn##* export MOZ_NO_REMOTE=1## Run the browser as follows:<code>C:\ff\mozilla\objdir\dist\bin\firefox $ make -Profilemanager</code>## When prompted, create a new profile called '''development'''## In the address bar, enter the following URI and note the build information: '''about:'''n
== Resources ==
* [http://benjamin.smedbergs.us/blog/2007-01-12/mozillabuild-rc1/ MozillaBuild RC1 for Win32]
* [http://webtoolswww.mozillagnu.org/buildsoftware/configmake/manual/ GNU Make Manual] * [http://www.eng.hawaii.edu/Tutor/Make/ Make Tutorial]* [[Makefile.cgi MOZCONFIG Build Configuratorin Template for In-Tree Extensions]]

Navigation menu