IMHO, the easiest way to build a package or module that is not in the WORKSPACE tree is to use symbolic links and the standard EDK II build system. Create a symbolic link to your package in the root of $WORKSPACE or a link to your module within the using package. Doing this on Linux is a well-known process (ln -s ...). On Windows (Windows 2000 or later) use the mklink command. For example: mklink /D PkgName C:\Somewhere\Unexpected. (also look up "Directory Junctions". There is not a lot of documentation out there for either.)
This is simple and compatible. This is the technique I use and allows me to keep my projects separate from my EDK II source tree. My project "packages" reside on a shared drive so that they are common between my Windows (XP & Win 7), Ubuntu, Fedora, and NetBSD machines. I build in all of these environments at least once a week. If I ever have a build break, I know it is because I have done something wrong in one of my packages and NOT because there is anything wrong with the EDK II distribution from www.tianocore.org. (Full disclosure: In the last six years, I have encountered TWO build breaks. I think this is a pretty good record and negligible for a "bleeding edge" repository.) By modifying your package's .dsc file (one line), you can also move the location of the Build directory, rename it, or cause other forms of mischief. Daryl McDaniel -----Original Message----- From: Rod Smith [mailto:[email protected]] Sent: Friday, February 22, 2013 8:33 AM To: [email protected] Subject: Re: [edk2] Projects outside the edk directory structure 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 ------------------------------------------------------------------------------ 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
