Skip to content

Commit

Permalink
Add make targets to build src and bin distribution archives.
Browse files Browse the repository at this point in the history
  • Loading branch information
christianhujer committed May 2, 2024
1 parent dacb95c commit ac30450
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
*.bc
*.swp
*~
dist-*/
27 changes: 27 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,33 @@ $(DESTDIR)$(PREFIX)/include/aceunit.mk: include/aceunit.mk
uninstall:
$(RM) $(FILES_TO_INSTALL)

.PHONY: dist
## dist: Creates source and binary distribution archives.
dist: dist-src dist-bin

.PHONY: dist-src
## dist-src: Creates source distribution archives.
dist-src: archive:=aceunit-3.0.0-src
dist-src:
mkdir -p dist-src/
git archive -o dist-src/$(archive).tar --prefix $(archive)/ HEAD .
<dist-src/$(archive).tar gzip -9 >dist-src/$(archive).tar.gz
<dist-src/$(archive).tar bzip2 -9 >dist-src/$(archive).tar.bz2
<dist-src/$(archive).tar xz -9 >dist-src/$(archive).tar.xz

.PHONY: dist-bin
## dist-bin: Creates a binary distribution archive.
dist-bin: os:=$(shell uname -s)
dist-bin: hw:=$(shell uname -m)
dist-bin: archive:=aceunit-3.0.0-bin-$(os)-$(hw)
dist-bin:
mkdir -p dist-bin/$(archive)/
$(MAKE) DESTDIR=dist-bin/$(archive)/ PREFIX=/usr/ install
tar cfC dist-bin/$(archive).tar dist-bin/ $(archive)/
<dist-bin/$(archive).tar gzip -9 >dist-bin/$(archive).tar.gz
<dist-bin/$(archive).tar bzip2 -9 >dist-bin/$(archive).tar.bz2
<dist-bin/$(archive).tar xz -9 >dist-bin/$(archive).tar.xz

.PHONY: help
## help: Print this help text.
help:
Expand Down

0 comments on commit ac30450

Please sign in to comment.