Skip to content

Commit

Permalink
Turn contrib/git-tarballs.sh into makefile command ("gitdist")
Browse files Browse the repository at this point in the history
  • Loading branch information
dkl committed Sep 8, 2014
1 parent ebdbe7e commit 39e7aa4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
21 changes: 0 additions & 21 deletions contrib/git-tarballs.sh

This file was deleted.

22 changes: 22 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
# uninstall[-component] remove from $(prefix)
# install-includes (additional commands for just the FB includes,
# uninstall-includes which don't need to be built)
# gitdist Create source code packages using "git archive"
#
# makefile configuration:
# FB[C|L]FLAGS to set -g -exx etc. for the compiler build and/or link
Expand Down Expand Up @@ -112,6 +113,8 @@ AR = $(TARGET_PREFIX)ar
CC = $(TARGET_PREFIX)gcc
prefix := /usr/local

FBVERSION := 0.91.0

# Determine the makefile's directory, this may be a relative path when
# building in a separate build directory via e.g. "make -f ../fbc/makefile".
rootdir := $(dir $(MAKEFILE_LIST))
Expand Down Expand Up @@ -642,3 +645,22 @@ clean-gfxlib2:
.PHONY: help
help:
@echo "Take a look at the top of this makefile!"

################################################################################

FBSOURCETITLE = FreeBASIC-$(FBVERSION)-source

.PHONY: gitdist
gitdist:
# (using git archive --prefix ... to avoid tarbombs)
# .tar.gz and .tar.xz, with LF line endings
git -c core.autocrlf=false archive --format tar --prefix "$(FBSOURCETITLE)/" HEAD | tar xf -
tar -czf "$(FBSOURCETITLE).tar.gz" "$(FBSOURCETITLE)"
tar -cJf "$(FBSOURCETITLE).tar.xz" "$(FBSOURCETITLE)"
rm -rf "$(FBSOURCETITLE)"

# .zip with low word size/fast bytes setting (for DOS), and .7z, with CRLF line endings
git -c core.autocrlf=true archive --format tar --prefix "$(FBSOURCETITLE)/" HEAD | tar xf -
7z a -tzip -mfb=8 "$(FBSOURCETITLE).zip" "$(FBSOURCETITLE)" > /dev/null
7z a "$(FBSOURCETITLE).7z" "$(FBSOURCETITLE)" > /dev/null
rm -rf "$(FBSOURCETITLE)"

0 comments on commit 39e7aa4

Please sign in to comment.