summaryrefslogtreecommitdiff
path: root/libstd/Makefile
blob: 3482cab21c5874af54100ae88485904fd7709eb5 (plain)
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
MYRLIB=std
MYRSRC= \
    alloc.myr \
    chartype.myr \
    die.myr \
    extremum.myr \
    fmt.myr \
    optparse.myr \
    rand.myr \
    slappend.myr \
    slurp.myr \
    sys.myr \
    types.myr \
    utf.myr \
    varargs.myr \

# TEMPORARILY DISABLED: Broken.
    # maybe.myr \

ASMSRC= \
    start.s \
    syscall.s \
    util.s

include ../config.mk

all: $(MYRLIB) $(MYRBIN) test

sys.myr: sys-$(SYS).myr
	cp sys-$(SYS).myr sys.myr

syscall.s: syscall-$(SYS).s
	cp syscall-$(SYS).s syscall.s

start.s: start-$(SYS).s
	cp start-$(SYS).s start.s

test: libstd.a test.myr ../6/6m
	../myrbuild/myrbuild -C../6/6m -M../muse/muse -b test -I. test.myr


$(MYRLIB): $(MYRSRC) $(ASMSRC) ../6/6m
	../myrbuild/myrbuild -C../6/6m -M../muse/muse -l $(MYRLIB) $(MYRSRC) $(ASMSRC)

OBJ=$(MYRSRC:.myr=.o) $(ASMSRC:.s=.o)
JUNKASM=$(MYRSRC:.myr=.s)
USE=$(MYRSRC:.myr=.use) $(MYRLIB)
.PHONY: clean
clean:
	rm -f $(OBJ) test.o
	rm -f $(USE) test.use
	rm -f $(JUNKASM) test.s
	rm -f lib$(MYRLIB).a

install:
	mkdir -p  $(INST_ROOT)/lib/myr
	install libstd.a $(INST_ROOT)/lib/myr
	install std $(INST_ROOT)/lib/myr

../6/6m:
	cd ..; make