]> code.delx.au - refind/blob - refind/Makefile
Fixed uninitialized-pointer bug that manifested as a crash with
[refind] / refind / Makefile
1 #
2 # refind/Makefile
3 # Build control file for the rEFInd boot menu
4 #
5 # This program is licensed under the terms of the GNU GPL, version 3,
6 # or (at your option) any later version.
7 # You should have received a copy of the GNU General Public License
8 # along with this program. If not, see <http://www.gnu.org/licenses/>.
9
10 SRCDIR = .
11
12 VPATH = $(SRCDIR)
13
14 ARCH = $(shell uname -m | sed s,i[3456789]86,ia32,)
15
16 TARGET = refind.efi
17
18 ifeq ($(ARCH),ia32)
19 LIBEG = build32
20 TARGET = refind_ia32.efi
21 endif
22
23 ifeq ($(ARCH),x86_64)
24 LIBEG = build64
25 TARGET = refind_x64.efi
26 endif
27
28 ifeq ($(ARCH),aarch64)
29 LIBEG = build
30 TARGET = refind_aa64.efi
31 endif
32
33 LOCAL_GNUEFI_CFLAGS = -I$(SRCDIR) -I$(SRCDIR)/../include \
34 -I$(SRCDIR)/../libeg -I$(SRCDIR)/../mok
35 LOCAL_LDFLAGS = -L$(SRCDIR)/../libeg/ -L$(SRCDIR)/../mok/ \
36 -L$(SRCDIR)/../EfiLib/
37 LOCAL_LIBS = -leg -lmok -lEfiLib
38
39 OBJS = main.o mystrings.o apple.o line_edit.o config.o menu.o \
40 screen.o icns.o gpt.o crc32.o lib.o driver_support.o \
41 legacy.o
42
43 include $(SRCDIR)/../Make.common
44
45 all: $(TARGET)
46
47 $(SHLIB_TARGET): $(OBJS)
48 $(LD) $(LOCAL_LDFLAGS) $(GNUEFI_LDFLAGS) $(SUBSYSTEM_LDFLAG) $(OBJS) \
49 -o $@ $(LOCAL_LIBS) $(GNUEFI_LIBS)
50
51 $(TARGET): $(SHLIB_TARGET)
52 $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel \
53 -j .rela -j .rel.* -j .rela.* -j .rel* -j .rela* \
54 -j .reloc $(FORMAT) $< $@
55 chmod a-x $(TARGET)
56
57 clean:
58 rm -f $(TARGET) *~ *.so $(OBJS) *.efi *.obj refind_*.txt \
59 refind_*.dll *.lib
60