-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
70 lines (52 loc) · 1.14 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
64
65
66
67
68
69
70
# SPDX-License-Identifier: MIT
# Copyright (c) 2018-2022 Iruatã Martins dos Santos Souza
SYS=$(shell uname -s)
ARCH=$(shell uname -m)
ASFLAGS += -Isrc
SRC=\
src/comments.ns\
src/dictionary.ns\
src/file.ns\
src/flowcontrol.ns\
src/go.ns\
src/interactive.ns\
src/interpreter.ns\
src/loadpaths.ns\
src/memory.ns\
src/pictured.ns\
src/shell.ns\
src/string.ns\
src/dicts.s\
src/${ARCH}/arch.ns\
src/${ARCH}/boot.s\
src/${ARCH}/${SYS}.s\
all: ${SYS} test_bootstrap
Linux:
LDFLAGS=-ldl make bin/nop
OpenBSD:
LDFLAGS=-Wl,-z,wxneeded make bin/nop
NetBSD: bin/nop
paxctl +m bin/nop
FreeBSD: bin/nop
Darwin: bin/nop
bin/nop: bin/nop.o
${CC} -ggdb -o bin/nop bin/nop.o ${LDFLAGS}
test_bootstrap:
@echo | bin/nop # test the bootstrap
bin/nop.o: ${SRC}
mkdir -p bin
${CC} -ggdb ${ASFLAGS} -c -o $@ src/${ARCH}/${SYS}.s
d: debug-${ARCH}
debug-x86_64: ${SYS}
gdb -x cmd.gdb bin/nop
debug-arm64: ${SYS}
lldb --local-lldbinit
NOPLIBS?=$(shell pwd)/lib
test: all
bin/nop test/logic.ns
bin/nop test/fileio.ns && rm -f test.out
NOPLIBS=${NOPLIBS} bin/nop test/clib.ns
bin/nop test/endian.ns
.PHONY: test
clean:
rm -f bin/*.o bin/nop