/
Makefile
98 lines (72 loc) · 2.26 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
TARGET_NAME := chailove
ifeq ($(VERBOSE),)
Q=@
endif
include Makefile.libretro
ifeq ($(STATIC_LINKING),1)
FLAGS += -DSTATIC_LINKING
endif
FLAGS += -D__LIBRETRO__ $(COREDEFINES) $(ENDIANNESS_DEFINES) $(PLATFORM_DEFINES) $(WARNINGS) $(fpic)
CXXFLAGS += $(FLAGS) -std=c++14
CFLAGS += $(FLAGS) -std=gnu99
# Ignore first attempt builds, and re-try for a cleaner dependency chain.
all: $(TARGET)
$(MAKE) $(TARGET)
$(TARGET): $(OBJECTS)
ifeq ($(STATIC_LINKING), 1)
$(AR) rcs $@ $(OBJECTS)
else
$(CXX) -o $@ $^ $(LDFLAGS)
endif
%.o: %.cpp
@echo CXX $<
$(Q)$(CXX) -c -o $@ $< $(CXXFLAGS) -include retro_endianness.h
%.o: %.c
@echo CXX $<
$(Q)$(CC) -c -o $@ $< $(CFLAGS) -include retro_endianness.h
%.o: %.m
$(CC) -c -o $@ $< $(CFLAGS) -include retro_endianness.h
%.o: %.S
$(CC) -c -o $@ $< $(CFLAGS)
clean:
rm -f $(TARGET) $(OBJECTS)
test: unittest unittest-chailove
@echo "Run the testing suite by using:\n\n retroarch -L $(TARGET) test/main.chai\n\n"
vendor/noarch/noarch:
cd vendor/noarch && cmake .
@$(MAKE) -C vendor/noarch
unittest: vendor/noarch/noarch all
vendor/noarch/noarch $(CORE_DIR)/$(TARGET) test/unittests/main.chai
unittest-chailove: vendor/noarch/noarch all
vendor/noarch/noarch $(CORE_DIR)/$(TARGET) test/test.chailove
examples: all
@retroarch -L $(TARGET) examples/benchmark/main.chai
test-script: all
@retroarch -L $(TARGET) test/main.chai
docs: docs/html
docs/html: docs-clean
doxygen docs/Doxyfile
docs-start: docs/html
php -S localhost:8080 -t docs/html
docs-clean:
rm -rf docs/html
docs-deploy: docs
npm init --force -y
npm install push-dir
node_modules/.bin/push-dir --dir=docs/html --branch=docs
cpplint:
@vendor/styleguide/cpplint/cpplint.py \
--linelength=120 \
--quiet \
--counting=detailed \
--filter=-build/include,-legal/copyright,-runtime/int,-runtime-readability/braces,\
-runtime/threadsafe_fn,-build/namespaces,-runtime/explicit,-whitespace/tab,\
-readability/casting,-whitespace/line_length,-runtime/references \
src/ChaiLove.cpp src/ChaiLove.h src/libretro.cpp src/love/*.h src/love/*.cpp src/love/Types/*/*.h src/love/Types/*/*.cpp
tests:
$(MAKE) HAVE_CHAISCRIPT=0 HAVE_TESTS=1
PREFIX := /usr
INSTALLDIR := $(PREFIX)/lib/libretro
install: all
mkdir -p $(DESTDIR)$(INSTALLDIR)
cp $(TARGET) $(DESTDIR)$(INSTALLDIR)