This repository has been archived by the owner on Nov 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
57 lines (45 loc) · 1.52 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
PROJECT := objectlua
VERSION := $(shell sed -n "/What's new in version/s/[^0-9.]//gp" 'WhatsNew.txt')
SUMMARY := $(shell sed -n '1,1 p' 'Readme.txt')
DETAILED := $(shell sed -n '3 p' 'Readme.txt')
MD5 = $(shell md5sum $(DISTFILE) | cut -d\ -f1)
DISTDIR = $(PROJECT)-$(VERSION)
DISTFILE = $(DISTDIR).tar.gz
FILES = $(shell find ./* -maxdepth 0 '(' -path '*.svn*' -o -path './$(PROJECT)*' ')' -prune -o -print)
all: dist distcheck rockspec
test: test-clean
cp -r src/$(PROJECT) test/$(PROJECT)
cd test && lua TestObjectLua.lua
make test-clean
test-clean:
rm -rf test/$(PROJECT)
dist: dist-clean test
@echo "Distribution temp directory: $(DISTDIR)"
@echo "Distribution file: $(DISTFILE)"
@echo "Version: $(VERSION)"
mkdir $(DISTDIR)
cp -r $(FILES) $(DISTDIR)
tar --exclude '.svn*' --exclude '*Trait*' --exclude '*Mixin*' -cvzf $(DISTFILE) $(DISTDIR)/*
rm -rf $(DISTDIR)
dist-clean:
rm -rf $(PROJECT)-*.tar.gz
distcheck: $(DISTFILE) distcheck-clean
mkdir -p tmp
cd tmp && tar -xzf ../$(DISTFILE)
cd tmp/$(DISTDIR) && make test
make distcheck-clean
distcheck-clean:
rm -rf tmp
.PHONY: rockspec
rockspec:
sed "s/VERSION/$(VERSION)/g;\
s/SUMMARY/$(SUMMARY)/;\
s/DETAILED/$(DETAILED)/;\
s/MD5/$(MD5)/"\
template.rockspec > $(PROJECT)-$(VERSION)-1.rockspec
cat $(PROJECT)-$(VERSION)-1.rockspec
rockspec-clean:
rm -f objectlua-*.rockspec
clean: test-clean dist-clean distcheck-clean rockspec-clean
tag:
svn copy . https://objectlua.googlecode.com/svn/tags/$(VERSION) -m '$(VERSION) version tag'