annotate Makefile @ 5:4b51f0c01fa7

improve
author taiki
date Tue, 18 Dec 2012 17:01:31 +0900
parents 10316df81650
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
10316df81650 start to write efi source of "bootx64.c".
one
parents: 0
diff changeset
1 ARCH =$(shell uname -m |sed s,i[3456789]86,ia32,)
10316df81650 start to write efi source of "bootx64.c".
one
parents: 0
diff changeset
2 LIB_PATH = /usr/lib64
10316df81650 start to write efi source of "bootx64.c".
one
parents: 0
diff changeset
3 EFI_INCLUDE = /usr/include/efi
10316df81650 start to write efi source of "bootx64.c".
one
parents: 0
diff changeset
4 EFI_INCLUDES = -nostdinc -I$(EFI_INCLUDE) -I$(EFI_INCLUDE)/$(ARCH) -I$(EFI_INCLUDE)/protocol
10316df81650 start to write efi source of "bootx64.c".
one
parents: 0
diff changeset
5
10316df81650 start to write efi source of "bootx64.c".
one
parents: 0
diff changeset
6 EFI_PATH = /usr/lib64/gnuefi
10316df81650 start to write efi source of "bootx64.c".
one
parents: 0
diff changeset
7 EFI_CRT_OBJS = $(EFI_PATH)/crt0-efi-$(ARCH).o
10316df81650 start to write efi source of "bootx64.c".
one
parents: 0
diff changeset
8 EFI_LDS = $(EFI_PATH)/elf_$(ARCH)_efi.lds
10316df81650 start to write efi source of "bootx64.c".
one
parents: 0
diff changeset
9
10316df81650 start to write efi source of "bootx64.c".
one
parents: 0
diff changeset
10 CFLAGS = -fno-stack-protector -fpic -fshort-wchar -mno-red-zone $(EFI_INCLUDES)
10316df81650 start to write efi source of "bootx64.c".
one
parents: 0
diff changeset
11 ifeq ($(ARCH),x86_64)
10316df81650 start to write efi source of "bootx64.c".
one
parents: 0
diff changeset
12 CFLAGS += -DEFI_FUNCTION_WRAPPER
10316df81650 start to write efi source of "bootx64.c".
one
parents: 0
diff changeset
13 endif
10316df81650 start to write efi source of "bootx64.c".
one
parents: 0
diff changeset
14
10316df81650 start to write efi source of "bootx64.c".
one
parents: 0
diff changeset
15 LDFLAGS = -nostdlib -znocombreloc -T $(EFI_LDS) -shared -Bsymbolic -L$(EFI_PATH) -L$(LIB_PATH) \
10316df81650 start to write efi source of "bootx64.c".
one
parents: 0
diff changeset
16 $(EFI_CRT_OBJS) -lefi -lgnuefi
0
e091e06fdd2d start to develop efi kernel. add Makefile and Makefile.def
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17
1
10316df81650 start to write efi source of "bootx64.c".
one
parents: 0
diff changeset
18 TARGET = bootx64.efi
10316df81650 start to write efi source of "bootx64.c".
one
parents: 0
diff changeset
19 OBJS = bootx64.o
10316df81650 start to write efi source of "bootx64.c".
one
parents: 0
diff changeset
20 SOURCES = bootx64.c
10316df81650 start to write efi source of "bootx64.c".
one
parents: 0
diff changeset
21
10316df81650 start to write efi source of "bootx64.c".
one
parents: 0
diff changeset
22 all: $(TARGET)
10316df81650 start to write efi source of "bootx64.c".
one
parents: 0
diff changeset
23
10316df81650 start to write efi source of "bootx64.c".
one
parents: 0
diff changeset
24 bootx64.so: $(OBJS)
10316df81650 start to write efi source of "bootx64.c".
one
parents: 0
diff changeset
25 $(LD) -o $@ $(LDFLAGS) $^ $(EFI_LIBS)
0
e091e06fdd2d start to develop efi kernel. add Makefile and Makefile.def
Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
parents:
diff changeset
26
1
10316df81650 start to write efi source of "bootx64.c".
one
parents: 0
diff changeset
27 %.efi: %.so
10316df81650 start to write efi source of "bootx64.c".
one
parents: 0
diff changeset
28 objcopy -j .text -j .sdata -j .data \
10316df81650 start to write efi source of "bootx64.c".
one
parents: 0
diff changeset
29 -j .dynamic -j .dynsym -j .rel \
10316df81650 start to write efi source of "bootx64.c".
one
parents: 0
diff changeset
30 -j .rela -j .reloc -j .eh_frame \
10316df81650 start to write efi source of "bootx64.c".
one
parents: 0
diff changeset
31 --target=efi-app-$(ARCH) $^ $@
10316df81650 start to write efi source of "bootx64.c".
one
parents: 0
diff changeset
32
10316df81650 start to write efi source of "bootx64.c".
one
parents: 0
diff changeset
33 clean:
10316df81650 start to write efi source of "bootx64.c".
one
parents: 0
diff changeset
34 rm -rf $(TARGET) *.o *.so