Subversion Repositories HelenOS

Rev

Rev 3178 | Rev 3579 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3178 Rev 3578
Line 26... Line 26...
26
LINUX_HEADERS	= /usr/src/sys/build
26
LINUX_HEADERS	= /usr/src/sys/build
27
CPPFLAGS	+= -D__KERNEL__ -I$(LINUX_HEADERS)/include
27
CPPFLAGS	+= -D__KERNEL__ -I$(LINUX_HEADERS)/include
28
CRTOBJS		= ../gnuefi/crt0-efi-$(ARCH).o
28
CRTOBJS		= ../gnuefi/crt0-efi-$(ARCH).o
29
LDSCRIPT	= ../gnuefi/elf_$(ARCH)_efi.lds
29
LDSCRIPT	= ../gnuefi/elf_$(ARCH)_efi.lds
30
LDFLAGS		+= -T $(LDSCRIPT) -shared -Bsymbolic -L../lib -L../gnuefi $(CRTOBJS)
30
LDFLAGS		+= -T $(LDSCRIPT) -shared -Bsymbolic -L../lib -L../gnuefi $(CRTOBJS)
31
LOADLIBES	= -lefi -lgnuefi
31
LOADLIBES	= -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name)
32
FORMAT		= efi-app-$(ARCH)
32
FORMAT		= efi-app-$(ARCH)
33
 
33
 
34
 
34
 
35
all:	gefi hello.efi
35
all:	gefi hello.efi
36
 
36
 
Line 43... Line 43...
43
hello.efi: hello.so
43
hello.efi: hello.so
44
	$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel \
44
	$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel \
45
		   -j .rela -j .reloc --target=$(FORMAT) hello.so hello.efi
45
		   -j .rela -j .reloc --target=$(FORMAT) hello.so hello.efi
46
	$(OBJDUMP) -d hello.efi > hello.disass  
46
	$(OBJDUMP) -d hello.efi > hello.disass  
47
 
47
 
-
 
48
#When selected first lines or second lines, select if image is linked into hello or not - usefull for network boot
48
hello.so: hello.o image.o
49
#hello.so: hello.o image.o 
-
 
50
hello.so: hello.o
-
 
51
#	$(LD) $(LDFLAGS) -Map hello.map hello.o image.o -o hello.so $(LOADLIBES) #link image inside hello
49
	$(LD) $(LDFLAGS) -Map hello.map hello.o -o hello.so $(LOADLIBES)
52
	$(LD) $(LDFLAGS) -Map hello.map hello.o -o hello.so $(LOADLIBES) #dont link image inside hello
50
 
53
 
51
hello.o: hello.c
54
hello.o: hello.c
52
	$(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -c hello.c -o hello.o
55
	$(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -c hello.c -o hello.o
53
 
56
 
54
image.o: ../../image.boot
57
image.o: ../../image.boot mkimage
55
	$(OBJCOPY) -O binary ../../image.boot image.bin
58
	$(OBJCOPY) -O binary ../../image.boot image.bin
-
 
59
	./mkimage
-
 
60
	$(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -c image.c -o image.o
56
	$(OBJCOPY) -I binary -O elf64-ia64-little -B ia64 image.bin image.o
61
#	$(OBJCOPY) -I binary -O elf64-ia64-little -B ia64  image.bin image.o
-
 
62
 
-
 
63
mkimage: mkimage.c
-
 
64
	gcc -o mkimage mkimage.c
57
 
65
 
58
 
66
 
59
gefi:
67
gefi:
60
	make -C .. prefix=$(PREFIX)
68
	make -C .. prefix=$(PREFIX)