-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (46 loc) · 1.55 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
57
58
59
60
PROJECT = guile-srfi-151
TOPDIR = .
LOAD_PATH = $(TOPDIR)/scheme
TEST_PATH = $(TOPDIR)/test
GUILE_BINARY ?= guile
GUILE_CALL = $(GUILE_BINARY) -L $(LOAD_PATH) -C $(LOAD_PATH) --no-auto-compile
GUILD_BINARY ?= guild
CFLAGS = -O3 -Wunsupported-warning -Wunused-variable -Wunused-toplevel
CFLAGS += -Wunbound-variable -Warity-mismatch -Wduplicate-case-datum
CFLAGS += -Wbad-case-datum -Wformat -L$(LOAD_PATH)
COMPILE = $(GUILD_BINARY) compile $(CFLAGS)
MODULES = $(TOPDIR)/scheme/srfi/srfi-151.scm
OBJECTS = ${MODULES:.scm=.go}
TESTS = $(TOPDIR)/test/*.t
RUNTESTS = $(TOPDIR)/tools/run-single-test
PROVE = tap-harness -e '$(RUNTESTS)'
INSTALL = $(GUILE_CALL) --no-auto-compile $(TOPDIR)/tools/install
DESTDIR =
PREFIX = /usr/local
DOCDIR = $(PREFIX)/share/doc/$(PROJECT)
.SUFFIXES: .scm .go
all:
@echo
@echo " Available targets:"
@echo
@echo " all: This help text"
@echo " install: Install scheme modules to system paths"
@echo " compile: Byte-compile the client library"
@echo " clean: Remove byte-compiled scheme code"
@echo " test: Run test suite"
@echo " test-verbose: Run test suite (with verbose test harness)"
@echo " test-debug: Run test suite (With all debugging enabled)"
@echo
.scm.go:
$(COMPILE) -o $@ $<
compile: $(OBJECTS)
clean:
find . -name "*.go" -exec rm -f '{}' +
find . -name "*~" -exec rm -f '{}' +
install:
$(INSTALL) DESTDIR="$(DESTDIR)" DOCDIR="$(DOCDIR)" PREFIX="$(PREFIX)"
test:
$(PROVE) $(TESTS)
test-verbose:
$(PROVE) --verbose $(TESTS)
.PHONY: all compile clean install test test-verbose