| 1 | TOPDIR = $(shell echo $$PWD) |
| 2 | |
| 3 | include $(TOPDIR)/Make.version |
| 4 | include $(TOPDIR)/Make.rules |
| 5 | include $(TOPDIR)/Make.defaults |
| 6 | include $(TOPDIR)/Make.coverity |
| 7 | include $(TOPDIR)/Make.fanalyzer |
| 8 | include $(TOPDIR)/Make.scan-build |
| 9 | |
| 10 | SUBDIRS := src |
| 11 | |
| 12 | all install deps : | check_efidir_error Make.version |
| 13 | @set -e ; for x in $(SUBDIRS) ; do \ |
| 14 | $(MAKE) -C $$x $@ ; \ |
| 15 | done |
| 16 | |
| 17 | clean : | check_efidir_error Make.version |
| 18 | @set -e ; for x in $(SUBDIRS) ; do \ |
| 19 | $(MAKE) -C $$x $@ ; \ |
| 20 | done |
| 21 | |
| 22 | all : efibootmgr.spec |
| 23 | |
| 24 | efibootmgr efibootmgr-static : |
| 25 | $(MAKE) -C src $@ |
| 26 | |
| 27 | $(SUBDIRS) : |
| 28 | $(MAKE) -C $@ |
| 29 | |
| 30 | .PHONY: $(SUBDIRS) |
| 31 | |
| 32 | efibootmgr.spec : | Makefile Make.version |
| 33 | |
| 34 | distclean : |
| 35 | $(MAKE) clean |
| 36 | @rm -vf efibootmgr.spec |
| 37 | |
| 38 | GITTAG = $(shell bash -c "echo $$(($(VERSION) + 1))") |
| 39 | |
| 40 | test-archive: efibootmgr.spec |
| 41 | @rm -rf /tmp/efibootmgr-$(GITTAG) /tmp/efibootmgr-$(GITTAG)-tmp |
| 42 | @mkdir -p /tmp/efibootmgr-$(GITTAG)-tmp |
| 43 | @git archive --format=tar $(shell git branch | awk '/^*/ { print $$2 }') | ( cd /tmp/efibootmgr-$(GITTAG)-tmp/ ; tar x ) |
| 44 | @git diff | ( cd /tmp/efibootmgr-$(GITTAG)-tmp/ ; patch -s -p1 -b -z .gitdiff ) |
| 45 | @mv /tmp/efibootmgr-$(GITTAG)-tmp/ /tmp/efibootmgr-$(GITTAG)/ |
| 46 | @cp efibootmgr.spec /tmp/efibootmgr-$(GITTAG)/ |
| 47 | @dir=$$PWD; cd /tmp; tar -c --bzip2 -f $$dir/efibootmgr-$(GITTAG).tar.bz2 efibootmgr-$(GITTAG) |
| 48 | @rm -rf /tmp/efibootmgr-$(GITTAG) |
| 49 | @echo "The archive is in efibootmgr-$(GITTAG).tar.bz2" |
| 50 | |
| 51 | bumpver : |
| 52 | @echo VERSION=$(GITTAG) > Make.version |
| 53 | @git add Make.version |
| 54 | git commit -m "Bump version to $(GITTAG)" -s |
| 55 | |
| 56 | tag: |
| 57 | git tag -s $(GITTAG) refs/heads/main |
| 58 | |
| 59 | archive: bumpver tag efibootmgr.spec |
| 60 | @rm -rf /tmp/efibootmgr-$(GITTAG) /tmp/efibootmgr-$(GITTAG)-tmp |
| 61 | @mkdir -p /tmp/efibootmgr-$(GITTAG)-tmp |
| 62 | @git archive --format=tar $(GITTAG) | ( cd /tmp/efibootmgr-$(GITTAG)-tmp/ ; tar x ) |
| 63 | @mv /tmp/efibootmgr-$(GITTAG)-tmp/ /tmp/efibootmgr-$(GITTAG)/ |
| 64 | @cp efibootmgr.spec /tmp/efibootmgr-$(GITTAG)/ |
| 65 | @dir=$$PWD; cd /tmp; tar -c --bzip2 -f $$dir/efibootmgr-$(GITTAG).tar.bz2 efibootmgr-$(GITTAG) |
| 66 | @rm -rf /tmp/efibootmgr-$(GITTAG) |
| 67 | @echo "The archive is in efibootmgr-$(GITTAG).tar.bz2" |
| 68 |