Rev 2726 | Rev 3106 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2726 | Rev 2738 | ||
---|---|---|---|
Line 18... | Line 18... | ||
18 | # You should have received a copy of the GNU General Public License |
18 | # You should have received a copy of the GNU General Public License |
19 | # along with GNU-EFI; see the file COPYING. If not, write to the Free |
19 | # along with GNU-EFI; see the file COPYING. If not, write to the Free |
20 | # Software Foundation, 59 Temple Place - Suite 330, Boston, MA |
20 | # Software Foundation, 59 Temple Place - Suite 330, Boston, MA |
21 | # 02111-1307, USA. |
21 | # 02111-1307, USA. |
22 | # |
22 | # |
23 | - | ||
- | 23 | prefix=$(PREFIX) |
|
24 | include ../Make.defaults |
24 | include ../Make.defaults |
25 | CDIR=$(TOPDIR)/.. |
25 | CDIR=$(TOPDIR)/.. |
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 |
Line 30... | Line 30... | ||
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 $(shell $(CC) -print-libgcc-file-name) |
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: hello.efi |
35 | all: gefi hello.efi |
36 | 36 | ||
37 | 37 | ||
38 | clean: |
38 | clean: |
39 | rm -f *.efi *~ *.o *.so |
39 | rm -f *.efi *~ *.o *.so |
40 | 40 | ||
41 | .PHONY: install |
41 | .PHONY: install |
42 | 42 | ||
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 | hello.so: hello.o image.o |
48 | hello.so: hello.o image.o |
49 | $(LD) $(LDFLAGS) -Map hello.map hello.o -o hello.so $(LOADLIBES) |
49 | $(LD) $(LDFLAGS) -Map hello.map hello.o -o hello.so $(LOADLIBES) |
50 | 50 | ||
51 | hello.o: hello.c |
51 | hello.o: hello.c |
52 | $(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -c hello.c -o hello.o |
52 | $(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -c hello.c -o hello.o |
53 | 53 | ||
54 | image.o: ../../image.boot |
54 | image.o: ../../image.boot |
55 | objcopy -O binary ../../image.boot image.bin |
55 | $(OBJCOPY) -O binary ../../image.boot image.bin |
56 | objcopy -I binary -O elf64-ia64-little -B ia64 image.bin image.o |
56 | $(OBJCOPY) -I binary -O elf64-ia64-little -B ia64 image.bin image.o |
57 | - | ||
58 | 57 | ||
59 | 58 | ||
- | 59 | gefi: |
|
- | 60 | make -C .. prefix=$(PREFIX) |