mirror of
https://github.com/gnustep/tools-make.git
synced 2025-05-30 00:41:14 +00:00
Rewritten. many bug fixes; new features; all packages built using
gnustep-make should now be able to take full advantage of it. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@11458 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
0705d424d3
commit
675b5403b8
1 changed files with 113 additions and 28 deletions
|
@ -1,9 +1,9 @@
|
|||
#
|
||||
# source-distribution.make
|
||||
#
|
||||
# Makefile rules to build snapshots, source tgz etc
|
||||
# Makefile rules to build snapshots from cvs, source .tar.gz etc
|
||||
#
|
||||
# Copyright (C) 2000 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2000, 2001 Free Software Foundation, Inc.
|
||||
#
|
||||
# Author: Adam Fedor <fedor@gnu.org>
|
||||
# Author: Nicola Pero <n.pero@mi.flashnet.it>
|
||||
|
@ -21,52 +21,137 @@
|
|||
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#
|
||||
# Interesting variables to define:
|
||||
# Interesting variables to define in your GNUmakefile:
|
||||
#
|
||||
# PACKAGE_NAME = gnustep-base
|
||||
# VERSION = 1.0.0
|
||||
#
|
||||
# For CVS exports, you may want to define something like:
|
||||
#
|
||||
# CVS_MODULE_NAME = base
|
||||
# CVS_FLAGS = -d :pserver:anoncvs@subversions.gnu.org:/cvsroot/gnustep
|
||||
#
|
||||
# You can also pass/override them on the command line if you want,
|
||||
# make cvs-snapshot CVS_FLAGS="-d :pserver:anoncvs@subversions.gnu.org:/cvsroot/gnustep -z9"
|
||||
#
|
||||
# If you set the RELEASE_DIR variable, all generated .tar.gz files will
|
||||
# be automatically moved to that directory after having being created.
|
||||
# RELEASE_DIR is either an absolute path, or a relative path to the
|
||||
# current directory.
|
||||
#
|
||||
|
||||
# prevent multiple inclusions
|
||||
ifeq ($(TGZ_MAKE_LOADED),)
|
||||
TGZ_MAKE_LOADED=yes
|
||||
|
||||
# Striped package name, probably only useful for GNUstep libraries
|
||||
PDIR_NAME = $(subst gnustep-,,$(PACKAGE_NAME))
|
||||
ifeq ($(CVS_MODULE_NAME),)
|
||||
CVS_MODULE_NAME = $(PACKAGE_NAME)
|
||||
endif
|
||||
|
||||
ifeq ($(CVS_FLAGS),)
|
||||
CVS_FLAGS = -z3
|
||||
endif
|
||||
|
||||
VERSION_NAME = $(PACKAGE_NAME)-$(VERSION)
|
||||
|
||||
VERTAG = `echo $(VERSION) | tr '.' '_'`
|
||||
|
||||
.PHONY: tgz cvs-tag cvs-dist cvs-snapshot
|
||||
.PHONY: tgz cvs-tag cvs-dist cvs-snapshot internal-cvs-export
|
||||
|
||||
#
|
||||
# Build a .tgz with the whole directory tree
|
||||
#
|
||||
tgz: distclean
|
||||
@echo "Generating $(PACKAGE_NAME)-$(VERSION).tar.gz"; \
|
||||
echo "in the parent directory..."; \
|
||||
SNAPSHOT_DIR=`basename $$(pwd)`; \
|
||||
cd ..; \
|
||||
if [ "$$SNAPSHOT_DIR" != "$(PACKAGE_NAME)-$(VERSION)" ]; then \
|
||||
mv $$SNAPSHOT_DIR $(PACKAGE_NAME)-$(VERSION); \
|
||||
fi; \
|
||||
tar cfz $(PACKAGE_NAME)-$(VERSION).tar.gz $(PACKAGE_NAME)-$(VERSION); \
|
||||
if [ "$$SNAPSHOT_DIR" != "$(PACKAGE_NAME)-$(VERSION)" ]; then \
|
||||
mv $(PACKAGE_NAME)-$(VERSION) $$SNAPSHOT_DIR; \
|
||||
fi;
|
||||
@echo "Generating $(VERSION_NAME).tar.gz in the parent directory..."; \
|
||||
SNAPSHOT_DIR=`basename $$(pwd)`; \
|
||||
cd ..; \
|
||||
if [ "$$SNAPSHOT_DIR" != "$(VERSION_NAME)" ]; then \
|
||||
if [ -d "$(VERSION_NAME)" ]; then \
|
||||
echo "$(VERSION_NAME) already exists in parent directory (?):"; \
|
||||
echo "Saving old version in $(VERSION_NAME)~"; \
|
||||
mv $(VERSION_NAME) $(VERSION_NAME)~; \
|
||||
fi; \
|
||||
mv $$SNAPSHOT_DIR $(VERSION_NAME);\
|
||||
fi; \
|
||||
if [ -f ${VERSION_NAME}.tar.gz ]; then \
|
||||
echo "${VERSION_NAME}.tar.gz already exists:"; \
|
||||
echo "Saving old version in ${VERSION_NAME}.tar.gz~"; \
|
||||
mv ${VERSION_NAME}.tar.gz ${VERSION_NAME}.tar.gz~; \
|
||||
fi; \
|
||||
tar cfz $(VERSION_NAME).tar.gz $(VERSION_NAME); \
|
||||
if [ "$$SNAPSHOT_DIR" != "$(VERSION_NAME)" ]; then \
|
||||
mv $(VERSION_NAME) $$SNAPSHOT_DIR; \
|
||||
fi; \
|
||||
if [ ! -f $(VERSION_NAME).tar.gz ]; then \
|
||||
echo "*Error* creating .tar.gz"; \
|
||||
exit 1; \
|
||||
fi;
|
||||
ifneq ($(RELEASE_DIR),)
|
||||
@echo "Moving $(VERSION_NAME).tar.gz to $(RELEASE_DIR)..."; \
|
||||
if [ ! -d $(RELEASE_DIR) ]; then \
|
||||
$(MKDIRS) $(RELEASE_DIR); \
|
||||
fi; \
|
||||
if [ -f $(RELEASE_DIR)/$(VERSION_NAME).tar.gz ]; then \
|
||||
echo "$(RELEASE_DIR)/${VERSION_NAME}.tar.gz already exists:"; \
|
||||
echo "Saving old version in $(RELEASE_DIR)/${VERSION_NAME}.tar.gz~";\
|
||||
mv $(RELEASE_DIR)/${VERSION_NAME}.tar.gz \
|
||||
$(RELEASE_DIR)/${VERSION_NAME}.tar.gz~;\
|
||||
fi; \
|
||||
mv ../$(VERSION_NAME).tar.gz $(RELEASE_DIR)
|
||||
endif
|
||||
|
||||
#
|
||||
# Tag the CVS source with the $(CVS_MODULE_NAME)-$(VERTAG) tag
|
||||
#
|
||||
cvs-tag:
|
||||
cvs -z3 rtag $(PDIR_NAME)-$(VERTAG) $(PDIR_NAME)
|
||||
cvs $(CVS_FLAGS) rtag $(CVS_MODULE_NAME)-$(VERTAG) $(CVS_MODULE_NAME)
|
||||
|
||||
cvs-dist:
|
||||
cvs -z3 export -r $(PDIR_NAME)-$(VERTAG) $(PDIR_NAME)
|
||||
mv $(PDIR_NAME) $(PACKAGE_NAME)-$(VERSION)
|
||||
tar --gzip -cf $(PACKAGE_NAME)-$(VERSION).tar.gz $(PACKAGE_NAME)-$(VERSION)
|
||||
rm -rf $(PACKAGE_NAME)-$(VERSION)
|
||||
#
|
||||
# Build a .tar.gz from the CVS sources using revision/tag
|
||||
# $(CVS_MODULE_NAME)-$(VERTAG)
|
||||
#
|
||||
cvs-dist: EXPORT_CVS_FLAGS = -r $(CVS_MODULE_NAME)-$(VERTAG)
|
||||
cvs-dist: internal-cvs-export
|
||||
|
||||
cvs-snapshot:
|
||||
cvs -z3 export -D now $(PDIR_NAME)
|
||||
mv $(PDIR_NAME) $(PACKAGE_NAME)-$(VERSION)
|
||||
tar --gzip -cf $(PACKAGE_NAME)-$(VERSION).tar.gz $(PACKAGE_NAME)-$(VERSION)
|
||||
rm -rf $(PACKAGE_NAME)-$(VERSION)
|
||||
#
|
||||
# Build a .tar.gz from the CVS source as they are now
|
||||
#
|
||||
cvs-snapshot: EXPORT_CVS_FLAGS = -D now
|
||||
cvs-snapshot: internal-cvs-export
|
||||
|
||||
internal-cvs-export:
|
||||
@echo "Exporting from module $(CVS_MODULE_NAME) on CVS..."; \
|
||||
if [ -e $(CVS_MODULE_NAME) ]; then \
|
||||
echo "*Error* cannot export: $(CVS_MODULE_NAME) already exists"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
cvs $(CVS_FLAGS) export $(EXPORT_CVS_FLAGS) $(CVS_MODULE_NAME); \
|
||||
echo "Generating $(VERSION_NAME).tar.gz"; \
|
||||
mv $(CVS_MODULE_NAME) $(VERSION_NAME); \
|
||||
if [ -f ${VERSION_NAME}.tar.gz ]; then \
|
||||
echo "${VERSION_NAME}.tar.gz already exists:"; \
|
||||
echo "Saving old version in ${VERSION_NAME}.tar.gz~"; \
|
||||
mv ${VERSION_NAME}.tar.gz ${VERSION_NAME}.tar.gz~; \
|
||||
fi; \
|
||||
tar cfz $(VERSION_NAME).tar.gz $(VERSION_NAME); \
|
||||
rm -rf $(VERSION_NAME); \
|
||||
if [ ! -f $(VERSION_NAME).tar.gz ]; then \
|
||||
echo "*Error* creating .tar.gz"; \
|
||||
exit 1; \
|
||||
fi;
|
||||
ifneq ($(RELEASE_DIR),)
|
||||
@echo "Moving $(VERSION_NAME).tar.gz to $(RELEASE_DIR)..."; \
|
||||
if [ ! -d $(RELEASE_DIR) ]; then \
|
||||
$(MKDIRS) $(RELEASE_DIR); \
|
||||
fi; \
|
||||
if [ -f $(RELEASE_DIR)/$(VERSION_NAME).tar.gz ]; then \
|
||||
echo "$(RELEASE_DIR)/${VERSION_NAME}.tar.gz already exists:"; \
|
||||
echo "Saving old version in $(RELEASE_DIR)/${VERSION_NAME}.tar.gz~";\
|
||||
mv $(RELEASE_DIR)/${VERSION_NAME}.tar.gz \
|
||||
$(RELEASE_DIR)/${VERSION_NAME}.tar.gz~;\
|
||||
fi; \
|
||||
mv $(VERSION_NAME).tar.gz $(RELEASE_DIR)
|
||||
endif
|
||||
|
||||
endif
|
||||
# source-distribution.make loaded
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue