aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 6355a86d2184761527359ad80f78bf95a894c3d5 (plain)
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
58
59
60
PARROT_VER = 2.6.0
RAKUDO_TAG = master

DISTDIR = rakudo-star-$(VERSION)

PARROT     = parrot-$(PARROT_VER)
PARROT_TGZ = $(PARROT).tar.gz
PARROT_DIR = $(DISTDIR)/$(PARROT)

RAKUDO_DIR = $(DISTDIR)/rakudo
BUILD_DIR  = $(DISTDIR)/build

BUILD_FILES = \
  build/gen_parrot.pl \
  build/Makefile.in \

DISTTARGETS = \
  $(PARROT_DIR) \
  $(RAKUDO_DIR) \
  $(BUILD_DIR) \
  $(BUILD_DIR)/PARROT_REVISION \
  $(DISTDIR)/Configure.pl \
  $(DISTDIR)/MANIFEST \

$(DISTDIR): version_check $(DISTTARGETS)

$(PARROT_DIR): $(PARROT_TGZ)
	mkdir -p $(DISTDIR)
	tar -C $(DISTDIR) -xvzf $(PARROT_TGZ)
$(PARROT).tar.gz:
	wget http://ftp.parrot.org/releases/supported/$(PARROT_VER)/$(PARROT_TGZ)

$(RAKUDO_DIR):
	git clone git@github.com:rakudo/rakudo.git $(RAKUDO_DIR)
	cd $(RAKUDO_DIR); git checkout $(RAKUDO_VER)

$(BUILD_DIR): $(BUILD_FILES)
	mkdir -p $(BUILD_DIR)
	cp $(BUILD_FILES) $(BUILD_DIR)

$(BUILD_DIR)/PARROT_REVISION: $(RAKUDO_DIR) $(RAKUDO_DIR)/build/PARROT_REVISION
	cp $(RAKUDO_DIR)/build/PARROT_REVISION $(BUILD_DIR)

$(DISTDIR)/Configure.pl: build/Configure.pl
	cp build/Configure.pl $(DISTDIR)

$(DISTDIR)/MANIFEST:
	touch $(DISTDIR)/MANIFEST
	find $(DISTDIR) -name '.*' -prune -o -type f -printf '%P\n' >$(DISTDIR)/MANIFEST
	## add the two dot-files from Parrot MANIFEST
	echo "$(PARROT)/.gitignore" >>$(DISTDIR)/MANIFEST
	echo "$(PARROT)/tools/dev/.gdbinit" >>$(DISTDIR)/MANIFEST

version_check:
	@[ -n "$(VERSION)" ] || ( echo "\nTry 'make VERSION=yyyy.mm'\n\n"; exit 1)

release: $(DISTDIR)
	perl -ne 'print "$(DISTDIR)/$$_"' $(DISTDIR)/MANIFEST |\
	    tar -zcv -T - -f $(DISTDIR).tar.gz