Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[build] Build .cab file in preparation for UEFI Secure Boot signing
Signed-off-by: Michael Brown <mbrown@fensystems.co.uk>
  • Loading branch information
mcb30 committed Apr 13, 2015
1 parent 2b01197 commit 13308db
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
2 changes: 2 additions & 0 deletions src/.gitignore
Expand Up @@ -4,4 +4,6 @@ wimboot
*.a
*.elf
*.map
*.efi
*.cab
efireloc
26 changes: 18 additions & 8 deletions src/Makefile
Expand Up @@ -17,6 +17,9 @@ ECHO := echo
OBJCOPY := objcopy
AR := ar
RANLIB := ranlib
CP := cp
RM := rm
LCAB := lcab
BINUTILS_DIR := /usr
BFD_DIR := $(BINUTILS_DIR)
ZLIB_DIR := /usr
Expand Down Expand Up @@ -66,11 +69,11 @@ CFLAGS += -include compiler.h
#
# Final targets

all : wimboot wimboot.i386 wimboot.x86_64
all : wimboot wimboot.i386 wimboot.x86_64 wimboot.cab

wimboot : wimboot.x86_64 Makefile
cp $< $@
cp $@ ../$@
$(CP) $< $@
$(CP) $@ ../$@

wimboot.% : wimboot.%.elf efireloc Makefile
$(OBJCOPY) -Obinary $< $@
Expand All @@ -80,6 +83,12 @@ wimboot.%.elf : prefix.%.o lib.%.a script.lds Makefile
$(LD) -m elf_$* -T script.lds -o $@ -q -Map wimboot.$*.map \
prefix.$*.o lib.$*.a

wimboot.%.efi : wimboot.% Makefile
$(CP) $< $@

wimboot.cab : wimboot.i386.efi wimboot.x86_64.efi Makefile
$(LCAB) -n -q wimboot.i386.efi wimboot.x86_64.efi $@

###############################################################################
#
# i386 objects
Expand All @@ -94,7 +103,7 @@ wimboot.%.elf : prefix.%.o lib.%.a script.lds Makefile
$(AS) --32 i386.i $< -o $@

lib.i386.a : $(OBJECTS_i386) Makefile
rm -f $@
$(RM) -f $@
$(AR) r $@ $(OBJECTS_i386)
$(RANLIB) $@

Expand Down Expand Up @@ -122,7 +131,7 @@ lib.i386.a : $(OBJECTS_i386) Makefile
$(AS) --64 x86_64.i $< -o $@

lib.x86_64.a : $(OBJECTS_x86_64) $(OBJECTS_i386_x86_64) Makefile
rm -f $@
$(RM) -f $@
$(AR) r $@ $(OBJECTS_x86_64) $(OBJECTS_i386_x86_64)
$(RANLIB) $@

Expand All @@ -143,6 +152,7 @@ efireloc : efireloc.c Makefile
# Cleanup

clean :
rm -f *.s *.o *.a *.elf
rm -f efireloc
rm -f wimboot wimboot.i386 wimboot.x86_64 ../wimboot
$(RM) -f *.s *.o *.a *.elf
$(RM) -f efireloc
$(RM) -f wimboot wimboot.i386 wimboot.x86_64 ../wimboot
$(RM) -f wimboot.i386.efi wimboot.x86_64.efi wimboot.cab

0 comments on commit 13308db

Please sign in to comment.