2021-03-18 07:24:40 +03:00
|
|
|
PREFIX = /usr/local
|
|
|
|
DESTDIR =
|
|
|
|
|
2021-03-17 20:38:47 +03:00
|
|
|
OBJCOPY = objcopy
|
|
|
|
OBJCOPY_ARCH = default
|
|
|
|
LIMINE_HDD_BIN = limine-hdd.bin
|
|
|
|
BUILD_DIR = $(shell realpath .)
|
|
|
|
|
|
|
|
CFLAGS = -O2 -pipe -Wall -Wextra
|
|
|
|
|
|
|
|
.PHONY: all clean
|
|
|
|
|
|
|
|
all: limine-install
|
|
|
|
|
2021-03-18 07:24:40 +03:00
|
|
|
install: all
|
|
|
|
install -d $(DESTDIR)$(PREFIX)/bin
|
|
|
|
install -s limine-install $(DESTDIR)$(PREFIX)/bin/
|
|
|
|
install -d $(DESTDIR)$(PREFIX)/share
|
2021-03-21 12:59:32 +03:00
|
|
|
install -d $(DESTDIR)$(PREFIX)/share/limine
|
|
|
|
install -m 644 limine.sys $(DESTDIR)$(PREFIX)/share/limine/
|
|
|
|
install -m 644 limine-cd.bin $(DESTDIR)$(PREFIX)/share/limine/
|
|
|
|
install -m 644 limine-eltorito-efi.bin $(DESTDIR)$(PREFIX)/share/limine/
|
|
|
|
install -m 644 limine-pxe.bin $(DESTDIR)$(PREFIX)/share/limine/
|
|
|
|
install -m 644 BOOTX64.EFI $(DESTDIR)$(PREFIX)/share/limine/
|
2021-03-18 07:24:40 +03:00
|
|
|
|
2021-03-17 20:38:47 +03:00
|
|
|
clean:
|
2021-03-18 10:13:27 +03:00
|
|
|
rm -f limine-hdd.o limine-install limine-install.exe
|
2021-03-17 20:38:47 +03:00
|
|
|
|
|
|
|
limine-install: limine-install.c limine-hdd.o
|
|
|
|
$(CC) $(CFLAGS) -std=c11 $^ -o $@
|
|
|
|
|
|
|
|
limine-hdd.o: $(LIMINE_HDD_BIN)
|
|
|
|
cd `dirname $^` && \
|
|
|
|
$(OBJCOPY) -B i8086 -I binary -O $(OBJCOPY_ARCH) `basename $^` $(BUILD_DIR)/$@
|