summaryrefslogtreecommitdiffstats
path: root/bootloader/Makefile
blob: e72fe747ff454be0db69ec5b61c3360591771ede (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
MY_TARGETS = images kbd-names.txt lang-kbds.txt layouts maggy unicode.pf2

ARCH = $(shell uname -m)

GRUB2_MODULES = iso9660 fat part_msdos all_video font png gfxterm gfxmenu \
                keylayouts at_keyboard usb_keyboard configfile echo gettext \
                linux linux16 ls search test

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

ifeq ($(ARCH),x86_64)
    GRUB_IMAGES += images/boot_x64.img
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/boot_x64.img:
	@mkdir -p images
	grub2-mkimage --output $@ --prefix /EFI/BOOT --format x86_64-efi $(GRUB2_MODULES)

kbd-names%txt lang-kbds%txt: layouts
	make-kbd-info

layouts:

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)/layouts
	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 layouts/* $(INSTALL_DIR)/layouts
	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