forked from mattn/mruby-curl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (39 loc) · 1.31 KB
/
Copy pathMakefile
File metadata and controls
48 lines (39 loc) · 1.31 KB
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
# Makefile for mruby-curl
#
# Prerequisites:
# ../mruby # mruby checkout (sibling directory)
#
# Quick start:
# make # build toolchain and run tests
# make test # run tests
# make clean # clean local build artifacts
MRUBY_DIR ?= ../mruby
RUBY ?= ruby
BUILD_CONFIG = build.rb
BUILD_NAME = mruby-curl
BUILD_DIR = $(MRUBY_DIR)/build/$(BUILD_NAME)
BUILD_PROFILE ?= test
TOOLCHAIN_BIN = bin/mruby bin/mrbc bin/mruby-config
TOOLCHAIN_STAMP = tmp/toolchain.$(BUILD_PROFILE).stamp
SPEC_FILES != find spec -type f -name '*_spec.rb' 2>/dev/null | sort
RUBY_SOURCES != find mrblib spec -type f -name '*.rb' 2>/dev/null | sort
RAKE = $(RUBY) -rrubygems -e 'load Gem.bin_path("rake", "rake")' --
.PHONY: all test toolchain clean distclean
all: toolchain test
test: toolchain
@set -e; \
for spec in $(SPEC_FILES); do \
ENV=TEST bin/mruby $$spec; \
done
toolchain: $(TOOLCHAIN_STAMP)
$(TOOLCHAIN_STAMP): $(BUILD_CONFIG) mrbgem.rake $(RUBY_SOURCES)
mkdir -p tmp bin
$(RAKE) -C $(MRUBY_DIR) -f Rakefile clean 2>/dev/null || true
BUILD_PROFILE=$(BUILD_PROFILE) $(RAKE) -C $(MRUBY_DIR) -f Rakefile MRUBY_CONFIG=$$(pwd)/$(BUILD_CONFIG)
cp -r $(BUILD_DIR)/bin/* bin/
touch $(TOOLCHAIN_STAMP)
clean:
rm -f $(TOOLCHAIN_BIN)
rm -f tmp/toolchain.*.stamp
distclean: clean
rm -rf $(BUILD_DIR)