RE: [Edk2 Dev] GNUmakefile questions?

Subject: RE: [Edk2 Dev] GNUmakefile questions?

From: "Wang, Jian J" <>

To: <>

Date: 2008-05-07 18:35:56


"test" command always returns non-zero code if test failed, and cause =
make failure. It was removed recently. Please update your tools source =

We've had a discussion on cutomized build but haven't decide the =
details. Using makefile_targets.template is a good idea. The most =
difficult thing, I think, may be that it's not easy to define a good =
format of the template file, which is easy to read and change. The =
template used in is highly tied with the code itself. For =
example, the placeholder names in the template are fixed and cannot be =
changed. And customers cannot give their own placeholders unless they =
change the code in

If the customized build requirement is mostly for pre/post processing, =
how about we borrow the idea of Ant based build system? We were using =
 node to add prebuild and postbuild command. We still =
have [UserExtension] section in DSC/INF file, which gives us the =
possibility to do the same.

For example, we could use following format to describe targets in =
DSC/INF file:





cd $(BUILD_DIR)\IA32

"prebuild" and "postbuild" should be reserved targets which will be =
hard-coded in the platform level or module level makefile. ":" is used =
to specify the target dependency. The commands will be simply copied to =
the makefile.


-----Original Message-----
From: Andrew Fish []=20
Sent: 2008=C4=EA5=D4=C27=C8=D5 08:16
Subject: [Edk2 Dev] GNUmakefile questions?

On my package that does not create an FV I was getting an error doing =20
a cleanall. I noticed the following in the root GNUmakefile.

# Clean all generated files except to makefile
         test -e $(BUILD_DIR)/IA32 && rm -r -f $(BUILD_DIR)/IA32
         test -e $(FV_DIR) && rm -r -f $(FV_DIR)

other than the grammar issue in the comment, any package that does not =20
create an FV will generate an error.

Also it looks like this ends up in every makefile:

# run command for emulator platform only
         cd $(BUILD_DIR)/IA32
         cd $(BUILD_DIR)

It looks like run: is hard coded in, but cleanall: is =20
mapped to "cleanall_command"          : =20
self.GetRemoveDirectoryCommand(self.IntermediateDirectoryList, =20
MakeType), so it looks like the right thing could be put in the =20

Seems like we really need a way to support custom makefiles in a =20
project? Having to edit the python code does not seem like a good =20
solution, especially since all projects end up with the same generated =20
makefiles. The NT32 run command is just one example where a custom =20
makefile makes sense. What if a signing server is required or extra =20
steps are needed to make a release ROM?

Should we have a makefile_targets.template that replaces the template =20
code in That way new makefile targets can be added in to =20
the generate makefile? We would have to think about it but in the NT32 =20
case it makes more sense to override the makefile_target.txt at the =20
project level as opposed to the WORKSPACE level....

Andrew Fish
Work iPhone: 360-259-7562

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail: