annotate Makefile @ 14:8b2ce241f5f1 default tip

add files
author one
date Mon, 30 Jun 2014 00:38:55 +0900
parents 56e8a3d49069
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
8d0e5be5d742 test exit boot services
taiki
parents:
diff changeset
1 ARCH = $(shell uname -m | sed s,i[3456789]86,ia32,)
8d0e5be5d742 test exit boot services
taiki
parents:
diff changeset
2 EFI_INCLUDE = /usr/include/efi
8d0e5be5d742 test exit boot services
taiki
parents:
diff changeset
3 EFI_INCLUDES = -I$(EFI_INCLUDE) -I$(EFI_INCLUDE)/$(ARCH) -I$(EFI_INCLUDE)/protocol
8d0e5be5d742 test exit boot services
taiki
parents:
diff changeset
4 EFI_PATH = /usr/lib64/gnuefi
8d0e5be5d742 test exit boot services
taiki
parents:
diff changeset
5 EFI_LIB_PATH = /usr/lib64
8d0e5be5d742 test exit boot services
taiki
parents:
diff changeset
6 LIB_GCC = $(shell $(CC) -print-libgcc-file-name)
8d0e5be5d742 test exit boot services
taiki
parents:
diff changeset
7 EFI_LIBS = -lefi -lgnuefi $(LIB_GCC)
8d0e5be5d742 test exit boot services
taiki
parents:
diff changeset
8 EFI_CRT_OBJS = $(EFI_PATH)/crt0-efi-$(ARCH).o
8d0e5be5d742 test exit boot services
taiki
parents:
diff changeset
9 EFI_LDS = $(EFI_PATH)/elf_$(ARCH)_efi.lds
8d0e5be5d742 test exit boot services
taiki
parents:
diff changeset
10 CFLAGS = -O2 -g -mno-red-zone -fno-stack-protector -fno-strict-aliasing -fpic -fshort-wchar -fno-merge-constants -Wall -Werror $(EFI_INCLUDES)
8d0e5be5d742 test exit boot services
taiki
parents:
diff changeset
11
8d0e5be5d742 test exit boot services
taiki
parents:
diff changeset
12 ifeq ($(ARCH),x86_64)
8d0e5be5d742 test exit boot services
taiki
parents:
diff changeset
13 CFLAGS += -DEFI_FUNCTION_WRAPPER
8d0e5be5d742 test exit boot services
taiki
parents:
diff changeset
14 endif
8d0e5be5d742 test exit boot services
taiki
parents:
diff changeset
15
8d0e5be5d742 test exit boot services
taiki
parents:
diff changeset
16 LDFLAGS = -nostdlib -znocombreloc -T $(EFI_LDS) -shared -Bsymbolic -L$(EFI_LIB_PATH) $(EFI_CRT_OBJS)
8d0e5be5d742 test exit boot services
taiki
parents:
diff changeset
17 TARGET = bootx64.efi
8d0e5be5d742 test exit boot services
taiki
parents:
diff changeset
18 OBJS = bootx64.o
8d0e5be5d742 test exit boot services
taiki
parents:
diff changeset
19
8d0e5be5d742 test exit boot services
taiki
parents:
diff changeset
20 all: $(TARGET)
8d0e5be5d742 test exit boot services
taiki
parents:
diff changeset
21
8d0e5be5d742 test exit boot services
taiki
parents:
diff changeset
22 bootx64.efi: $(OBJS)
8d0e5be5d742 test exit boot services
taiki
parents:
diff changeset
23
2
08b78c2f55c6 add hgignore file. fix Makefile
taiki
parents: 0
diff changeset
24 exec:
08b78c2f55c6 add hgignore file. fix Makefile
taiki
parents: 0
diff changeset
25 qemu-kvm -s -L ovmf -bios ovmf/OVMF.fd -hdb disk/disk.qcow2
08b78c2f55c6 add hgignore file. fix Makefile
taiki
parents: 0
diff changeset
26
0
8d0e5be5d742 test exit boot services
taiki
parents:
diff changeset
27 %.efi: %.o
8d0e5be5d742 test exit boot services
taiki
parents:
diff changeset
28 $(LD) $(LDFLAGS) $^ -o $@ $(EFI_LIBS)
8d0e5be5d742 test exit boot services
taiki
parents:
diff changeset
29 objcopy -j .text -j .sdata -j .data \
8d0e5be5d742 test exit boot services
taiki
parents:
diff changeset
30 -j .dynamic -j .dynsym -j .rel \
8d0e5be5d742 test exit boot services
taiki
parents:
diff changeset
31 -j .rela -j .reloc \
8d0e5be5d742 test exit boot services
taiki
parents:
diff changeset
32 --target=efi-app-$(ARCH) $@
8d0e5be5d742 test exit boot services
taiki
parents:
diff changeset
33 strip $@
2
08b78c2f55c6 add hgignore file. fix Makefile
taiki
parents: 0
diff changeset
34 modprobe nbd
3
a2c1382b25ad fix Makefile, add make exec
taiki
parents: 2
diff changeset
35 qemu-nbd -c /dev/nbd0 disk/disk.qcow2
2
08b78c2f55c6 add hgignore file. fix Makefile
taiki
parents: 0
diff changeset
36 mount /dev/nbd0 /mnt/nbd
08b78c2f55c6 add hgignore file. fix Makefile
taiki
parents: 0
diff changeset
37 cp bootx64.efi /mnt/nbd/EFI/BOOT/
0
8d0e5be5d742 test exit boot services
taiki
parents:
diff changeset
38
8d0e5be5d742 test exit boot services
taiki
parents:
diff changeset
39 clean:
8d0e5be5d742 test exit boot services
taiki
parents:
diff changeset
40 rm -f $(TARGET) $(OBJS)
6
3b3650b792e3 add make clean
taiki
parents: 3
diff changeset
41 umount /mnt/nbd
3b3650b792e3 add make clean
taiki
parents: 3
diff changeset
42 qemu-nbd -d /dev/nbd0
3b3650b792e3 add make clean
taiki
parents: 3
diff changeset
43 rmmod nbd