-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (39 loc) · 781 Bytes
/
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
# For 6502
ifeq ($(TARGET_6502), 1)
CXX=../llvm-mos/bin/mos-hm6502-clang++
else
CXX=clang++
endif
CFLAGS=-I.
LDFLAGS=
ifeq ($(TARGET_6502), 1)
CFLAGS+= -DTARGET_6502=1 -DLISP_HEAP_SIZE=16384
endif
ifeq ($(TARGET_6502), 1)
STANDARD=-std=c++20
OPTIMIZATION=-Oz
SANITIZE=
else
STANDARD=-std=c++20
OPTIMIZATION=-O3
SANITIZE= -fsanitize=address
endif
CPPFLAGS=$(STANDARD) $(CFLAGS)
ifeq ($(DEBUG), 1)
CFLAGS+=-g -DDEBUG $(SANITIZE)
else
CFLAGS+=$(OPTIMIZATION) -flto
LDFLAGS+=-flto
endif
PROGRAMS=lispirito
DEPENDENCIES=main.o LispNode.o extra.o
ifeq ($(SIMPLE_ALLOCATOR), 1)
DEPENDENCIES+=SimpleAllocator.o
endif
all: $(PROGRAMS)
lispirito: $(DEPENDENCIES)
$(CXX) $(CPPFLAGS) -o $@ $^ $(LDFLAGS)
%.o: %.cpp
$(CXX) -c $(CPPFLAGS) $< -o $@
clean:
rm -f *.o $(PROGRAMS)