-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
33 lines (24 loc) · 923 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
CXXFLAGS := -Wall -Wextra -pedantic -std=c++14 \
-Wno-unused-result -Wno-unused-parameter \
-O3 -g \
-Ilibncgc/include -DNCGC_PLATFORM_TEST \
$(CXXFLAGS)
ifdef UBSAN
CXXFLAGS += -fsanitize=undefined
endif
LDFLAGS := -Llibncgc/out/test -lncgc
# https://stackoverflow.com/questions/3774568/makefile-issue-smart-way-to-scan-directory-tree-for-c-files
rwildcard = $(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
SRC_FILES := src/main.cpp src/platform.cpp src/emulator.cpp \
$(call rwildcard,src/emulators/,*.cpp) \
$(call rwildcard,src/flashcart_core/,*.cpp)
OBJ_FILES := $(patsubst %.cpp,%.o,$(SRC_FILES))
all: fcctester
fcctester: $(OBJ_FILES) libncgc/out/test/libncgc.a
$(CXX) $(CXXFLAGS) $(OBJ_FILES) $(LDFLAGS) -o $@
libncgc/out/test/libncgc.a:
@$(MAKE) -C libncgc PLATFORM=test
clean:
@rm -vf $(OBJ_FILES) fcctester
@$(MAKE) -C libncgc clean
.PHONY: all clean