On 02/21/2013 09:48 AM, Dan wrote: > I know its possible to create an application and build it outside of the edk2 > directory structure, because I have an existing one that works in that way. > However I had to make a number of changes that were supremely hacky and not > at all how I would want to work on the more complicated applications that I > would like to change to work like this. Is there a nice way that I can make > the edk2 libraries and functions available like I want? (My existing way > doesn't seem to link the actual function implementations)
This topic came up about three weeks ago; look for a thread entitled "UEFI Compilation dorectory" [sic]. It *CAN* be done, and under Linux at least, it's really not all that hard, provided you understand Makefiles (or whatever you'd use instead). My own rEFInd project (http://www.rodsbooks.com/refind/) builds in this way, albeit with some twists in that when I picked up the project (it's a fork of the earlier rEFIt), I used the GNU-EFI toolkit, since that's the only way I could get it to compile under Linux; the code wouldn't compile with TianoCore. I eventually got it working with TianoCore, but I've kept support for GNU-EFI, so I've got a master Makefile and then multiple additional Makefiles, some for GNU-EFI and others for TianoCore. (The naming of these isn't entirely consistent; I should clean that up.) In any event, I created the TianoCore Makefiles by first creating a standard EDK2 project and then studying the output of the build process. That enabled me to essentially reverse-engineer the build process to create a compatible Makefile. I also had to copy over AutoGen.c and AutoGen.h files. These mostly hold GUID definitions and a few structures, so you'd probably need to customize them for your own project or incorporate that code into other files. You'll also need to build some or all of the TianoCore package to get access to its binary library files for linking, as well as its custom make tools for linking a final binary. If you wanted to start from scratch with an out-of-tree build, you'd need to manually create some elements like the AutoGen.c and AutoGen.h files (or put the equivalent code elsewhere), and you'd need to understand enough of what's required to get it to work. You might want to look over rEFInd as a model, since it's the only open source project I know of that builds in this way. Pay attention to the Make.tiano files in the various subdirectories. Another comment, though: Depending on your needs, you might look into GNU-EFI (http://sourceforge.net/projects/gnu-efi/). It's a substantially smaller development library than TianoCore, and it doesn't support some of the newer EFI features; but it's intended to be used in a Linux/Unix environment with Makefiles, so it may be easier to get started using it in that sort of environment. There are also several open source projects that build with it, including rEFInd, gummiboot, shim, and PreBootloader (efitools), so there are plenty of examples to use as references. The Sourceforge page suggests that GNU-EFI works under Windows and OS X, as well as under Linux. My one attempt to get it to work with OS X failed, but I didn't put a lot of effort into it. -- Rod Smith [email protected] http://www.rodsbooks.com ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb _______________________________________________ edk2-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/edk2-devel
