-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (50 loc) · 1.4 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
LIBRARY_SOURCES := \
runtime/interpreter.cpp \
runtime/memory.cpp \
runtime/util.cpp \
runtime/vm.cpp \
runtime/system.cpp \
types/bool.cpp \
types/char.cpp \
types/cons.cpp \
types/environment.cpp \
types/eof_object.cpp \
types/number.cpp \
types/procedure.cpp \
types/string.cpp \
types/symbol.cpp \
types/vector.cpp \
types/port.cpp
LIBRARY_OBJECTS := \
$(LIBRARY_SOURCES:.cpp=.o)
LIBRARY_HEADERS := \
include/noldor.h \
include/noldor_impl.h
NOLDOR_SOURCES := noldor.cpp
NOLDOR_OBJECTS := $(NOLDOR_SOURCES:.cpp=.o)
NOLDOR_TEST_SOURCES := noldor_tests.cpp
NOLDOR_TEST_OBJECTS := $(NOLDOR_TEST_SOURCES:.cpp=.o)
DEPS := $(LIBRARY_SOURCES:.cpp=.d) $(NOLDOR_SOURCES:.cpp=.d) $(NOLDOR_TEST_SOURCES:.cpp=.d)
CXXFLAGS += -std=c++14 -Wall -Wextra -pedantic -Werror -Iinclude -MMD -MP -g
INSTALL_PREFIX ?= /usr/local
bindir ?= $(INSTALL_PREFIX)/bin
noldor: $(LIBRARY_OBJECTS) $(NOLDOR_OBJECTS)
$(CXX) -o $@ $(LIBRARY_OBJECTS) $(NOLDOR_OBJECTS) $(LDFLAGS)
noldor_test: $(LIBRARY_OBJECTS) $(NOLDOR_TEST_OBJECTS)
$(CXX) -o $@ $(LIBRARY_OBJECTS) $(NOLDOR_TEST_OBJECTS) $(LDFLAGS)
all: check noldor
install: noldor
install -d $(bindir)
install -s noldor $(bindir)
check: noldor_test
./noldor_test
.cpp.o:
$(CXX) $(CXXFLAGS) -c $< -o $@
clean:
rm -f noldor
rm -f noldor_test
rm -f $(LIBRARY_OBJECTS)
rm -f $(NOLDOR_OBJECTS)
rm -f $(NOLDOR_TEST_OBJECTS)
rm -f $(DEPS)
-include $(DEPS)