@@ -2,14 +2,15 @@ VERSION = 1
22ARCH = $(shell uname -m | sed s,i[3456789]86,ia32,)
33DATADIR := /usr/share
44LIBDIR := /usr/lib64
5- GNUEFIDIR ?= $( LIBDIR ) /gnuefi /
5+ GNUEFIDIR ?= gnu-efi /
66CC = gcc
77CFLAGS ?= -O0 -g3
88BUILDFLAGS := $(CFLAGS ) -fPIC -Werror -Wall -Wextra -fshort-wchar \
99 -fno-merge-constants -ffreestanding \
1010 -fno-stack-protector -fno-stack-check --std=gnu11 -DCONFIG_$(ARCH ) \
11- -I/usr/include/efi/ -I/usr/include/efi/$(ARCH ) / \
12- -I/usr/include/efi/protocol
11+ -I$(GNUEFIDIR ) /inc \
12+ -I$(GNUEFIDIR ) /inc/$(ARCH ) \
13+ -I$(GNUEFIDIR ) /inc/protocol
1314CCLDFLAGS ?= -nostdlib -fPIC -Wl,--warn-common \
1415 -Wl,--no-undefined -Wl,--fatal-warnings \
1516 -Wl,-shared -Wl,-Bsymbolic -L$(LIBDIR ) -L$(GNUEFIDIR ) \
@@ -83,36 +84,29 @@ endif
8384% .so : % .o
8485 $(CC ) $(CCLDFLAGS ) $(SOFLAGS ) -o $@ $^ $(SOLIBS ) \
8586 $(shell $(CC ) -print-libgcc-file-name) \
86- -T $(GNUEFIDIR ) /elf_$(ARCH ) _efi.lds
87+ -T $(GNUEFIDIR ) /gnuefi/ elf_$(ARCH ) _efi.lds
8788
8889% .o : % .c
8990 $(CC ) $(BUILDFLAGS ) -c -o $@ $^
9091
9192clean :
9293 @rm -vf * .o * .so * .efi
9394
95+ update :
96+ git submodule update --init --recursive
97+
9498install :
9599 install -D -d -m 0755 $(INSTALLROOT ) /$(DATADIR ) /certmule-$(VERSION )
96100 install -m 0644 certmule.efi $(INSTALLROOT ) /$(DATADIR ) /certmule-$(VERSION ) /certmule.efi
97101
98102GITTAG = $(VERSION )
99103
100104test-archive :
101- @rm -rf /tmp/certmule-$(VERSION ) /tmp/certmule-$(VERSION ) -tmp
102- @mkdir -p /tmp/certmule-$(VERSION ) -tmp
103- @git archive --format=tar $(shell git branch | awk '/^* / { print $$2 }') | ( cd /tmp/certmule-$( VERSION) -tmp/ ; tar x )
104- @git diff | ( cd /tmp/certmule-$( VERSION) -tmp/ ; patch -s -p1 -b -z .gitdiff )
105- @mv /tmp/certmule-$(VERSION ) -tmp/ /tmp/certmule-$(VERSION ) /
106- @dir=$$ PWD; cd /tmp; tar -c --bzip2 -f $$ dir/certmule-$(VERSION ) .tar.bz2 certmule-$(VERSION )
107- @rm -rf /tmp/certmule-$(VERSION )
108- @echo " The archive is in certmule-$( VERSION) .tar.bz2"
109-
110- archive :
111- git tag $(GITTAG ) refs/heads/master
112- @rm -rf /tmp/certmule-$(VERSION ) /tmp/certmule-$(VERSION ) -tmp
113- @mkdir -p /tmp/certmule-$(VERSION ) -tmp
114- @git archive --format=tar $(GITTAG ) | ( cd /tmp/certmule-$( VERSION) -tmp/ ; tar x )
115- @mv /tmp/certmule-$(VERSION ) -tmp/ /tmp/certmule-$(VERSION ) /
116- @dir=$$ PWD; cd /tmp; tar -c --bzip2 -f $$ dir/certmule-$(VERSION ) .tar.bz2 certmule-$(VERSION )
117- @rm -rf /tmp/certmule-$(VERSION )
118- @echo " The archive is in certmule-$( VERSION) .tar.bz2"
105+ @./make-archive $(if $(call get-config,certmule.origin) ,--origin "$(call get-config,certmule.origin) ") --test " $( VERSION) "
106+
107+ tag :
108+ git tag --sign $(GITTAG ) refs/heads/main
109+ git tag -f latest-release $(GITTAG )
110+
111+ archive : tag
112+ @./make-archive $(if $(call get-config,certmule.origin) ,--origin "$(call get-config,certmule.origin) ") --release " $( VERSION) " " $( GITTAG) " " certmule-$( GITTAG) "
0 commit comments