]> code.delx.au - refind/blob - refind/Makefile
2098554725148f6f66c10a1c07ba3b423628c0b4
[refind] / refind / Makefile
1 #
2 # refind/Makefile
3 # Build control file for the rEFInd boot menu
4 #
5
6 SRCDIR = .
7
8 VPATH = $(SRCDIR)
9
10 ARCH = $(shell uname -m | sed s,i[3456789]86,ia32,)
11
12 TARGET = refind.efi
13
14 ifeq ($(ARCH),ia32)
15 LIBEG = build32
16 TARGET = refind_ia32.efi
17 endif
18
19 ifeq ($(ARCH),x86_64)
20 LIBEG = build64
21 TARGET = refind_x64.efi
22 endif
23
24 ifeq ($(ARCH),aarch64)
25 LIBEG = build
26 TARGET = refind_aa64.efi
27 endif
28
29 LOCAL_CPPFLAGS = -I$(SRCDIR) -I$(SRCDIR)/../include -I$(SRCDIR)/../libeg -I$(SRCDIR)/../mok
30 LOCAL_LDFLAGS = -L$(SRCDIR)/../libeg/ -L$(SRCDIR)/../mok/ -L$(SRCDIR)/../EfiLib/
31 LOCAL_LIBS = -leg -lmok -lEfiLib
32
33 OBJS = main.o mystrings.o apple.o line_edit.o config.o menu.o screen.o icns.o gpt.o crc32.o lib.o driver_support.o legacy.o
34
35 all: $(TARGET)
36
37 include $(SRCDIR)/../Make.common
38
39 $(SHLIB_TARGET): $(OBJS)
40 $(LD) $(LOCAL_LDFLAGS) $(LDFLAGS) $(OBJS) -o $@ $(LOCAL_LIBS) $(LIBS)
41
42 $(TARGET): $(SHLIB_TARGET)
43 $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel \
44 -j .rela -j .rel.* -j .rela.* -j .rel* -j .rela* \
45 -j .reloc $(FORMAT) $< $@
46 chmod a-x $(TARGET)
47
48 # EOF
49 # DO NOT DELETE