jw-pkg/make/backup.mk

16 lines
514 B
Makefile
Raw Normal View History

BACKUP_SOURCE ?= .
BACKUP_TARGET ?= ..
BACKUP_DATE ?= $(shell date +'%y%m%d-%H%M%S')
2008-10-10 20:12:44 +00:00
_BACKUP_SOURCE = $(notdir $(shell cd $(BACKUP_SOURCE); $(PWD)))
2008-10-10 20:12:44 +00:00
ifndef BACKUP_MK_INCLUDED
BACKUP_MK_INCLUDED = true
2008-10-10 20:12:44 +00:00
backup: distclean
tar -C .. $(_BACKUP_SOURCE) -cjf $(BACKUP_TARGET)/$(_BACKUP_SOURCE)-$(BACKUP_DATE).tar.bz2
purge-last-backup:
$(RM) -f $(shell ls $(BACKUP_TARGET)/$(_BACKUP_SOURCE)-*.tar.bz2 | tail -1)
2008-10-10 20:12:44 +00:00
endif # ifndef BACKUP_MK_INCLUDED