]> code.delx.au - refind/blob - refind/Makefile
Significant reworking of Makefile structure. Added Apple Core Storage
[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 -I$(SRCDIR)/../libeg -I$(SRCDIR)/../mok
34 LOCAL_LDFLAGS = -L$(SRCDIR)/../libeg/ -L$(SRCDIR)/../mok/ -L$(SRCDIR)/../EfiLib/
35 LOCAL_LIBS = -leg -lmok -lEfiLib
36
37 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
38
39 include $(SRCDIR)/../Make.common
40
41 all: $(TARGET)
42
43 $(SHLIB_TARGET): $(OBJS)
44 $(LD) $(LOCAL_LDFLAGS) $(GNUEFI_LDFLAGS) $(SUBSYSTEM_LDFLAG) $(OBJS) -o $@ $(LOCAL_LIBS) $(GNUEFI_LIBS)
45
46 $(TARGET): $(SHLIB_TARGET)
47 $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel \
48 -j .rela -j .rel.* -j .rela.* -j .rel* -j .rela* \
49 -j .reloc $(FORMAT) $< $@
50 chmod a-x $(TARGET)
51
52 clean:
53 rm -f $(TARGET) *~ *.so $(OBJS) *.efi *.obj refind_*.txt refind_*.dll *.lib
54
55 # EOF
56 # DO NOT DELETE