-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
56 lines (35 loc) · 1.34 KB
/
Makefile
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
.PHONY: all test clean server
SWIPL ?= swipl
version = $(shell swipl -q -s pack -g 'version(V),writeln(V)' -t 'halt(1)')
packfile = plammar-$(version).tgz
pwd := $(shell pwd)
CLI := ./cli.exe
all: install
version:
@echo $(version)
install: install.packs cli
install.packs: install.packs.dcg4pt install.packs.cli_table
install.packs.dcg4pt:
@$(SWIPL) -g 'pack_install(dcg4pt,[interactive(false)]),halt(0)' -t 'halt(1)'
install.packs.cli_table:
@$(SWIPL) -g 'pack_install(cli_table,[interactive(false)]),halt(0)' -t 'halt(1)'
upgrade: upgrade.packs
upgrade.packs: upgrade.packs.dcg4pt upgrade.packs.cli_table
upgrade.packs.dcg4pt:
@$(SWIPL) -g 'pack_install(dcg4pt,[interactive(false),upgrade(true)]),halt(0)' -t 'halt(1)'
upgrade.packs.cli_table:
@$(SWIPL) -g 'pack_install(cli_table,[interactive(false),upgrade(true)]),halt(0)' -t 'halt(1)'
check: test
test: cli test.cli test.parser
test.parser:
$(SWIPL) -q -p library=$(pwd)/prolog -g 'main,halt(0)' -t 'halt(1)' -s test/test.pl
test.cli:
echo 'Var' | $(CLI) --dcg=named_variable
cli:
$(SWIPL) -p library=$(pwd)/prolog -g main -o $(CLI) -c cli.pl && chmod +x $(CLI)
server:
$(SWIPL) -p library=$(pwd)/prolog server/server.pl --port=8081
package: test
tar cvzf $(packfile) prolog test pack.pl cli.pl server README.md LICENSE Makefile
release: test
hub release create -m v$(version) v$(version)