make: require clean git for make make
Unexpected results otherwise.
This commit is contained in:
parent
6066407a89
commit
1a4d80447c
1 changed files with 7 additions and 2 deletions
9
Makefile
9
Makefile
|
|
@ -262,6 +262,11 @@ test-all:
|
|||
# ./rpmbuild, using rpmbuild's usual directory structure.
|
||||
#
|
||||
|
||||
.PHONY: git-diff-check
|
||||
git-diff-check:
|
||||
@git diff --exit-code
|
||||
@git diff --cached --exit-code
|
||||
|
||||
RPM_SPECFILE=rpmbuild/SPECS/osbuild-$(COMMIT).spec
|
||||
RPM_TARBALL=rpmbuild/SOURCES/osbuild-$(COMMIT).tar.gz
|
||||
|
||||
|
|
@ -274,13 +279,13 @@ $(RPM_TARBALL):
|
|||
git archive --prefix=osbuild-$(COMMIT)/ --format=tar.gz HEAD > $(RPM_TARBALL)
|
||||
|
||||
.PHONY: srpm
|
||||
srpm: $(RPM_SPECFILE) $(RPM_TARBALL)
|
||||
srpm: git-diff-check $(RPM_SPECFILE) $(RPM_TARBALL)
|
||||
rpmbuild -bs \
|
||||
--define "_topdir $(CURDIR)/rpmbuild" \
|
||||
$(RPM_SPECFILE)
|
||||
|
||||
.PHONY: rpm
|
||||
rpm: $(RPM_SPECFILE) $(RPM_TARBALL)
|
||||
rpm: git-diff-check $(RPM_SPECFILE) $(RPM_TARBALL)
|
||||
rpmbuild -bb \
|
||||
--define "_topdir $(CURDIR)/rpmbuild" \
|
||||
$(RPM_SPECFILE)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue