summaryrefslogtreecommitdiffstats
path: root/bootloader/Makefile
blob: bd8f7b02c0a5ecdf4abac3c86a2a668b2ccaced7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
MY_TARGETS = images kbd-names.txt lang-kbds.txt maggy unicode.pf2

ARCH = $(shell uname -m)

GRUB2_MODULES = iso9660 ext2 fat f2fs jfs reiserfs xfs \
                part_apple part_bsd part_gpt part_msdos \
                all_video font gfxterm gfxmenu png \
                boot chain configfile echo gettext \
                linux linux32 ls search test videoinfo

GRUB_IMAGES = images/boot_hybrid.img images/eltorito.img

ifeq ($(ARCH),x86_64)
    GRUB_IMAGES += images/bootx64.efi
else
    GRUB_IMAGES += images/bootia32.efi
endif

INSTALL_DIR = $(PREFIX)/usr/share/drakiso/bootloader

all: $(MY_TARGETS) po

images: $(GRUB_IMAGES)

images/boot_hybrid.img: /usr/lib/grub/i386-pc/boot_hybrid.img
	@mkdir -p images
	cp $< $@

images/eltorito.img:
	@mkdir -p images
	grub2-mkimage --output $@ --prefix /boot/grub2 --format i386-pc-eltorito biosdisk $(GRUB2_MODULES)

images/bootia32.efi:
	@mkdir -p images
	grub2-mkimage --output $@ --prefix /EFI/BOOT --format i386-efi $(GRUB2_MODULES)

images/bootx64.efi:
	@mkdir -p images
	grub2-mkimage --output $@ --prefix /EFI/BOOT --format x86_64-efi $(GRUB2_MODULES)

kbd-names%txt lang-kbds%txt:
	./make-kbd-info

maggy: /boot/grub2/themes/maggy
	cp -rL $< $@

.PHONY: po
po: make-grub-po make-kbd-po kbd-names.txt
	make -C po

unicode.pf2: /usr/share/grub/unicode.pf2
	cp $< $@

install: all
	mkdir -p $(INSTALL_DIR)/images
	mkdir -p $(INSTALL_DIR)/messages
	mkdir -p $(INSTALL_DIR)/maggy
	install -m 0644 *.txt *.pf2 $(INSTALL_DIR)
	install -m 0644 images/* $(INSTALL_DIR)/images
	install -m 0644 maggy/* $(INSTALL_DIR)/maggy
	install -m 0644 po/*.mo $(INSTALL_DIR)/messages

uninstall:
	rm -rf $(INSTALL_DIR)

clean:
	rm -rf $(MY_TARGETS)
	make -C po clean