Rev 3593 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3593 | Rev 3742 | ||
---|---|---|---|
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 $(shell $(CC) -print-libgcc-file-name) |
31 | #LOADLIBES = -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name) |
- | 32 | LOADLIBES = -lefi -lgnuefi |
|
32 | FORMAT = efi-app-$(ARCH) |
33 | FORMAT = efi-app-$(ARCH) |
33 | 34 | ||
34 | 35 | ||
35 | all: gefi hello.efi |
36 | all: gefi hello.efi |
36 | 37 | ||
Line 44... | Line 45... | ||
44 | $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel \ |
45 | $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel \ |
45 | -j .rela -j .reloc --target=$(FORMAT) hello.so hello.efi |
46 | -j .rela -j .reloc --target=$(FORMAT) hello.so hello.efi |
46 | $(OBJDUMP) -d hello.efi > hello.disass |
47 | $(OBJDUMP) -d hello.efi > hello.disass |
47 | 48 | ||
48 | #When selected first lines or second lines, select if image is linked into hello or not - usefull for network boot |
49 | #When selected first lines or second lines, select if image is linked into hello or not - usefull for network boot |
49 | #hello.so: hello.o image.o |
50 | #hello.so: hello.o image.o division.o |
50 | hello.so: hello.o image.bin |
51 | hello.so: hello.o image.bin division.o |
51 | # $(LD) $(LDFLAGS) -Map hello.map hello.o image.o -o hello.so $(LOADLIBES) #link image inside hello |
52 | # $(LD) $(LDFLAGS) -Map hello.map hello.o division.o image.o -o hello.so $(LOADLIBES) #link image inside hello |
52 | $(LD) $(LDFLAGS) -Map hello.map hello.o -o hello.so $(LOADLIBES) #dont link image inside hello |
53 | $(LD) $(LDFLAGS) -Map hello.map hello.o division.o -o hello.so $(LOADLIBES) #dont link image inside hello |
53 | 54 | ||
54 | hello.o: hello.c |
55 | hello.o: hello.c |
55 | $(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -c hello.c -o hello.o |
56 | $(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -c hello.c -o hello.o |
56 | 57 | ||
- | 58 | division.o: division.c |
|
- | 59 | $(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -c division.c -o division.o |
|
- | 60 | ||
57 | 61 | ||
58 | image.bin: ../../image.boot |
62 | image.bin: ../../image.boot |
59 | $(OBJCOPY) -O binary ../../image.boot image.bin |
63 | $(OBJCOPY) -O binary ../../image.boot image.bin |
60 | 64 | ||
61 | 65 |