Add Makefile setup for building libimagruby + thermite bundling

This commit is contained in:
Matthias Beyer 2017-02-04 12:31:48 +01:00
parent 980d5222be
commit 77566bc7a5
2 changed files with 16 additions and 14 deletions

View file

@ -68,9 +68,9 @@ lib: $(LIB_TARGETS)
lib-test: $(LIB_TARGETS_TEST) lib-test: $(LIB_TARGETS_TEST)
lib-imag-ruby-test: lib-imag-ruby-test:
@$(MAKE) -C libimagruby @$(MAKE) -C libimagruby test
test: bin-test lib-test test: bin-test lib-test lib-imag-ruby-test
install: $(INSTALL_TARGETS) imag-bin-install install: $(INSTALL_TARGETS) imag-bin-install
@$(ECHO) "\t[INSTALL]" @$(ECHO) "\t[INSTALL]"

View file

@ -1,20 +1,22 @@
ECHO=$(shell which echo) -e ECHO=$(shell which echo) -e
RUBY=$(shell which ruby) RUBY=$(shell which ruby)
RUBY_TESTS=$(shell find ./test -maxdepth 1 -name "*.rb" -type f) BUNDLE=$(shell which bundle)
RUBY_TEST_TARGETS=$(foreach x,$(subst ,,$(RUBY_TESTS)),$(x))
all: lib all:
@$(ECHO) "There is no default target here"
lib: bundle:
$(MAKE) -C .. libimagruby @$(ECHO) "[BUNDLE]"
@$(BUNDLE) install --path vendor/bundle
lib-release: bundle-rake-thermite-test:
$(MAKE) -C .. libimagruby-release @$(ECHO) "[RAKE ][thermite]"
@CARGO_TARGET=debug $(BUNDLE) exec rake thermite:tarball
test: lib $(RUBY_TEST_TARGETS) test: lib bundle-rake-thermite-test
@$(ECHO) "[TEST ]"
$(RUBY_TEST_TARGETS): %: lib .FORCE
@$(ECHO) "\t[TEST ]:\t$@"
@$(RUBY) $(subst -test,,$@)
.FORCE: .FORCE:
.PHONY: all