File: Makefile

package info (click to toggle)
mruby 3.4.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,584 kB
  • sloc: ansic: 51,933; ruby: 29,510; yacc: 7,077; cpp: 517; makefile: 51; sh: 42
file content (56 lines) | stat: -rw-r--r-- 1,130 bytes parent folder | download
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
# mruby is using Rake (https://ruby.github.io/rake/) as a build tool.

RAKE = rake
DOCKER_COMPOSE = docker-compose
PRE_COMMIT = pre-commit

define check_command
	@command -v $(1) >/dev/null 2>&1 || { \
		echo "Error: $(1) is not installed or not in PATH."; \
		exit 1; \
	}
endef

all : check_rake
	$(RAKE)
.PHONY : all

test : check_rake all
	$(RAKE) test
.PHONY : test

clean : check_rake
	$(RAKE) clean
.PHONY : clean

check : check_pre_commit
	$(PRE_COMMIT) run --all-files
.PHONY : check

checkinstall : check_pre_commit
	$(PRE_COMMIT) install
.PHONY : checkinstall

checkupdate : check_pre_commit
	$(PRE_COMMIT) autoupdate
.PHONY : checkupdate

composecheck : check_docker_compose check_pre_commit
	$(DOCKER_COMPOSE) -p mruby run test $(PRE_COMMIT) run --all-files
.PHONY : composecheck

composetest : check_docker_compose
	$(DOCKER_COMPOSE) -p mruby run test
.PHONY : composetest

check_rake:
	$(call check_command, $(RAKE))
.PHONY : check_rake

check_docker_compose:
	$(call check_command, $(DOCKER_COMPOSE))
.PHONY : check_docker_compose

check_pre_commit:
	$(call check_command, $(PRE_COMMIT))
.PHONY : check_pre_commit