-
Notifications
You must be signed in to change notification settings - Fork 40
/
Makefile
64 lines (44 loc) · 1.66 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
61
62
63
.PHONY: clean cleanconfig uninstall
-include make.in
fcs = full-chez.boot
pcs = petite-chez.boot
incdir ?= $(bootpath)
libdir ?= $(bootpath)
psboot = $(bootpath)/petite.boot
csboot = $(bootpath)/scheme.boot
custom_boot = custom-boot.ss
kernel = $(libdir)/kernel.o
scheme ?= scheme
runscheme = "$(scheme)" -b "$(bootpath)/petite.boot" -b "$(bootpath)/scheme.boot"
compile-chez-program: compile-chez-program.ss full-chez.a petite-chez.a $(wildcard config.ss)
$(runscheme) --compile-imported-libraries --program $< --full-chez --chez-lib-dir . $<
%.a: embed_target.o setup.o stubs.o %_boot.o $(kernel)
ar rcs $@ $^
stubs.o: stubs.c
$(CC) -c -o $@ $<
%.o: %.c
$(CC) -c -o $@ $< -I$(incdir) -Wall -Wextra -pedantic $(CFLAGS)
%_boot.o: %_boot.c
$(CC) -o $@ -c $(CFLAGS) $<
%_boot.c: %.boot
$(runscheme) --script build-included-binary-file.ss "$@" chezschemebootfile $^
$(fcs): $(psboot) $(csboot) $(custom_boot)
$(runscheme) --script make-boot-file.ss $@ $^
$(pcs): $(psboot) $(custom_boot)
$(runscheme) --script make-boot-file.ss $@ $^
$(psboot) $(csboot) $(kernel):
@echo Unable to find "$@". Try running gen-config.ss to set dependency paths
@false
install: compile-chez-program
install -d $(DESTDIR)$(installbindir)/
install -m 755 compile-chez-program $(DESTDIR)$(installbindir)/
install -d $(DESTDIR)$(installlibdir)/
install -m 644 full-chez.a petite-chez.a $(DESTDIR)$(installlibdir)/
clean:
rm -f compile-chez-program *.a *.generated.* *.s *.o *.chez *.so *.wpo *.boot
cleanconfig:
rm -f config.ss make.in
uninstall:
rm $(DESTDIR)$(installbindir)/compile-chez-program
rm $(DESTDIR)$(installlibdir)/full-chez.a
rm $(DESTDIR)$(installlibdir)/petite-chez.a