~sircmpwn/hare unlisted

hare/Makefile -rw-r--r-- 2.0 KiB
d0da2862Alexey Yerin format::ini: new module a day ago
                                                                                
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
.POSIX:
.SUFFIXES:
include config.mk
TESTCACHE=$(HARECACHE)/+test
TESTHAREFLAGS=$(HAREFLAGS) -T
STDLIB=.

all:

.SUFFIXES: .ha .ssa .s .o .scd .1
.ssa.s:
	@printf 'QBE\t$@\n'
	@$(QBE) -o $@ $<

.s.o:
	@printf 'AS\t$@\n'
	@$(AS) -g -o $@ $<

.scd.1:
	@printf 'SCDOC\t$@\n'
	@$(SCDOC) < $< > $@

include stdlib.mk

hare_srcs=\
	./cmd/hare/plan.ha \
	./cmd/hare/subcmds.ha \
	./cmd/hare/schedule.ha \
	./cmd/hare/main.ha

harec_srcs=\
	./cmd/harec/main.ha \
	./cmd/harec/errors.ha

haredoc_srcs=\
	./cmd/haredoc/main.ha \
	./cmd/haredoc/errors.ha \
	./cmd/haredoc/env.ha \
	./cmd/haredoc/hare.ha \
	./cmd/haredoc/html.ha \
	./cmd/haredoc/sort.ha \
	./cmd/haredoc/resolver.ha

$(HARECACHE)/hare.ssa: $(hare_srcs) $(hare_stdlib_deps)
	@printf 'HAREC\t$@\n'
	@HARECACHE=$(HARECACHE) $(HAREC) $(HAREFLAGS) \
		-D PLATFORM:str='"'"$$(./scripts/platform)"'"' \
		-D VERSION:str='"'"$$(./scripts/version)"'"' \
		-D HAREPATH:str='"'"$(HAREPATH)"'"' \
		-o $@ $(hare_srcs)

$(TESTCACHE)/hare.ssa: $(hare_srcs) $(hare_testlib_deps)
	@printf 'HAREC\t$@\n'
	@HARECACHE=$(TESTCACHE) $(HAREC) $(TESTHAREFLAGS) \
		-D PLATFORM:str='"'"$$(./scripts/platform)"'"' \
		-D VERSION:str='"'"$$(./scripts/version)"'"' \
		-D HAREPATH:str='"'"$(HAREPATH)"'"' \
		-o $@ $(hare_srcs)

.bin/hare: $(HARECACHE)/hare.o
	@mkdir -p .bin
	@printf 'LD\t$@\n'
	@$(LD) -T $(rtscript) --gc-sections -o $@ \
		$(HARECACHE)/hare.o $(hare_stdlib_deps)

.bin/hare-tests: $(TESTCACHE)/hare.o
	@mkdir -p .bin
	@printf 'LD\t$@\n'
	@$(LD) -T $(rtscript) -o $@ \
		$(TESTCACHE)/hare.o $(hare_testlib_deps)

.bin/harec: .bin/hare $(harec_srcs)
	@mkdir -p .bin
	@printf 'HARE\t$@\n'
	@env HAREPATH=. ./.bin/hare build -o .bin/harec ./cmd/harec

.bin/haredoc: .bin/hare $(haredoc_srcs)
	@mkdir -p .bin
	@printf 'HARE\t$@\n'
	@env HAREPATH=. ./.bin/hare build -o .bin/haredoc ./cmd/haredoc

docs/hare.1: docs/hare.scd
docs/haredoc.1: docs/haredoc.scd

docs: docs/hare.1 docs/haredoc.1

clean:
	@rm -rf .cache .bin

check: .bin/hare-tests
	@./.bin/hare-tests

all: .bin/hare .bin/harec .bin/haredoc

.PHONY: all clean check .bin/harec .bin/haredoc