-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (28 loc) · 773 Bytes
/
Makefile
File metadata and controls
40 lines (28 loc) · 773 Bytes
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
ifndef GEM_HOME
$(error GEM_HOME not set.)
endif
PACKAGES := disc
VERSION_FILE := lib/disc/version.rb
DEPS := ${GEM_HOME}/installed
VERSION := $(shell sed -ne '/.*VERSION *= *"\(.*\)".*/s//\1/p' <$(VERSION_FILE))
GEMS := $(addprefix pkg/, $(addsuffix -$(VERSION).gem, $(PACKAGES)))
export RUBYLIB := lib:test:$(RUBYLIB)
all: test $(GEMS)
console: $(DEPS)
irb -r disc
test: $(DEPS)
cutest ./test/**/*_test.rb
clean:
rm pkg/*.gem
release: $(GEMS)
git tag v$(VERSION)
git push --tags
for gem in $^; do gem push $$gem; done
pkg/%-$(VERSION).gem: %.gemspec $(VERSION_FILE) | pkg
gem build $<
mv $(@F) pkg/
$(DEPS): $(GEM_HOME) .gems
cat .gems | xargs gem install && touch $(GEM_HOME)/installed
pkg $(GEM_HOME):
mkdir -p $@
.PHONY: all test release clean