build: Add make dist target

This commit is contained in:
mintsuki 2021-10-24 15:48:52 +02:00
parent 46149eaf8b
commit f939d7545a
5 changed files with 26 additions and 12 deletions

View File

@ -96,11 +96,8 @@ jobs:
- name: Cleanup source tree
run: git checkout $TAG_NAME && rm -rf * && git checkout .
- name: Burn version number
run: echo "$TAG_NAME" > version
- name: Package release tarball
run: cd .. && cp -r limine "limine-$TAG_NAME" && rm -rf "limine-$TAG_NAME/.git" && tar -Jcf "limine/limine-$TAG_NAME.tar.xz" "limine-$TAG_NAME"
run: make dist
- name: Create release notes
run: echo "Binary release can be found at https://github.com/limine-bootloader/limine/tree/$TAG_NAME-binary" > rel_notes.txt

1
.gitignore vendored
View File

@ -10,6 +10,7 @@
/**/*.EFI
/**/*.bin
/**/*.bin.gz
/**/*.tar.xz
/**/*.elf
/**/*.hdd
/**/*.iso

View File

@ -9,6 +9,10 @@ export PATH := $(shell pwd)/toolchain/bin:$(PATH)
NCPUS := $(shell nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 1)
export LIMINE_VERSION := $(shell cat ../version 2>/dev/null || ( git describe --exact-match --tags `git log -n1 --pretty='%h'` 2>/dev/null || git log -n1 --pretty='%h' ) )
export LIMINE_COPYRIGHT := $(shell grep Copyright LICENSE.md)
TOOLCHAIN ?= limine
TOOLCHAIN_CC ?= $(TOOLCHAIN)-gcc
@ -121,13 +125,27 @@ limine-uefi-clean: stage23-uefi-clean
.PHONY: limine-uefi32-clean
limine-uefi32-clean: stage23-uefi32-clean
.PHONY: distclean2
distclean2: clean test-clean
rm -rf toolchain ovmf* gnu-efi
.PHONY: dist
dist:
rm -rf "limine-$(LIMINE_VERSION)"
LIST="$$(ls -A)"; mkdir "limine-$(LIMINE_VERSION)" && cp -r $$LIST "limine-$(LIMINE_VERSION)/"
rm -rf "limine-$(LIMINE_VERSION)/"*.tar*
$(MAKE) -C "limine-$(LIMINE_VERSION)" repoclean
$(MAKE) -C "limine-$(LIMINE_VERSION)" gnu-efi stivale
rm -rf "limine-$(LIMINE_VERSION)/gnu-efi/.git"
rm -rf "limine-$(LIMINE_VERSION)/stivale/.git"
rm -rf "limine-$(LIMINE_VERSION)/.git"
echo "$(LIMINE_VERSION)" > "limine-$(LIMINE_VERSION)/version"
tar -Jcf "limine-$(LIMINE_VERSION).tar.xz" "limine-$(LIMINE_VERSION)"
rm -rf "limine-$(LIMINE_VERSION)"
.PHONY: distclean
distclean: distclean2
rm -rf stivale
distclean: clean test-clean
rm -rf toolchain ovmf*
.PHONY: repoclean
repoclean: distclean
rm -rf stivale gnu-efi *.tar.xz
stivale:
git clone https://github.com/stivale/stivale.git

View File

@ -86,7 +86,7 @@ make toolchain # (or gmake where applicable)
### Building Limine
In order to build Limine, the following packages have to be installed:
`GNU make`, `git`, `nasm`, `mtools` (optional, necessary to build
`GNU make`, `nasm`, `mtools` (optional, necessary to build
`limine-eltorito-efi.bin`).
Furthermore, either the toolchain must have been built in the previous
paragraph, or `gcc` or `llvm/clang` must also be installed.

View File

@ -51,8 +51,6 @@ COM_OUTPUT = false
E9_OUTPUT = false
BUILD_ID := $(shell dd if=/dev/urandom count=8 bs=1 2>/dev/null | od -An -t x4 | sed 's/^ /0x/g;s/ //g')
LIMINE_VERSION := $(shell cat ../version 2>/dev/null || ( git describe --exact-match --tags `git log -n1 --pretty='%h'` 2>/dev/null || ( git log -n1 --pretty='%h' && echo -n "(`git branch --show-current`)" ) ) )
LIMINE_COPYRIGHT := $(shell grep Copyright ../LICENSE.md)
WERROR = -Werror
CFLAGS ?= -O3 -g -pipe -Wall -Wextra $(WERROR)