2017-10-28 22:00:32 +00:00
|
|
|
TARGET_NAME := chailove
|
2017-06-19 19:30:00 +00:00
|
|
|
|
2017-10-19 23:22:40 +00:00
|
|
|
include Makefile.libretro
|
2017-09-08 16:43:05 +00:00
|
|
|
|
2017-10-19 23:22:40 +00:00
|
|
|
ifeq ($(STATIC_LINKING),1)
|
|
|
|
FLAGS += -DSTATIC_LINKING
|
2017-07-06 01:43:05 +00:00
|
|
|
endif
|
|
|
|
|
2017-10-19 23:22:40 +00:00
|
|
|
FLAGS += -D__LIBRETRO__ $(COREDEFINES) $(ENDIANNESS_DEFINES) $(PLATFORM_DEFINES) $(WARNINGS) $(fpic)
|
2017-06-19 19:30:00 +00:00
|
|
|
|
2017-12-21 09:16:43 +00:00
|
|
|
CXXFLAGS += $(FLAGS) -std=c++14
|
2017-06-19 19:30:00 +00:00
|
|
|
CFLAGS += $(FLAGS) -std=gnu99
|
|
|
|
|
2018-03-16 14:06:29 +00:00
|
|
|
# Ignore first attempt builds, and re-try for a cleaner dependency chain.
|
|
|
|
all: $(TARGET)
|
|
|
|
$(MAKE) $(TARGET)
|
|
|
|
|
2018-03-16 13:39:15 +00:00
|
|
|
$(TARGET): $(OBJECTS) | vendor/libretro-common/include/libretro.h
|
2018-10-08 22:01:02 +00:00
|
|
|
$(CXX) -o $@ $^ $(LDFLAGS)
|
2017-06-19 19:30:00 +00:00
|
|
|
|
2018-03-16 13:39:15 +00:00
|
|
|
%.o: %.cpp | vendor/libretro-common/include/libretro.h
|
2018-10-08 22:01:02 +00:00
|
|
|
$(CXX) -c -o $@ $< $(CXXFLAGS)
|
2017-06-19 19:30:00 +00:00
|
|
|
|
2018-03-16 13:39:15 +00:00
|
|
|
%.o: %.c | vendor/libretro-common/include/libretro.h
|
2018-10-08 22:01:02 +00:00
|
|
|
$(CC) -c -o $@ $< $(CFLAGS)
|
2017-06-19 19:30:00 +00:00
|
|
|
|
2018-08-27 04:16:48 +00:00
|
|
|
%.o: %.m | vendor/libretro-common/include/libretro.h
|
2018-10-08 22:01:02 +00:00
|
|
|
$(CC) -c -o $@ $< $(CFLAGS)
|
2018-08-27 04:16:48 +00:00
|
|
|
|
2017-06-19 19:30:00 +00:00
|
|
|
clean:
|
|
|
|
rm -f $(TARGET) $(OBJECTS)
|
2017-12-22 10:42:41 +00:00
|
|
|
git clean -xdf
|
2017-12-22 10:55:16 +00:00
|
|
|
rm -rf vendor
|
2018-08-27 05:12:44 +00:00
|
|
|
git reset --hard HEAD
|
|
|
|
git submodule update -f --init --recursive
|
2017-12-22 10:44:18 +00:00
|
|
|
git submodule foreach --recursive git clean -xfd
|
2017-12-22 10:55:16 +00:00
|
|
|
git submodule foreach --recursive git reset --hard HEAD
|
2017-06-19 19:30:00 +00:00
|
|
|
|
2018-03-16 13:28:19 +00:00
|
|
|
vendor/libretro-common/include/libretro.h:
|
2017-11-30 06:22:43 +00:00
|
|
|
@git submodule update --init --recursive
|
2017-06-21 04:43:30 +00:00
|
|
|
|
2018-08-27 04:16:48 +00:00
|
|
|
submodules-update:
|
|
|
|
@git submodule update --remote
|
|
|
|
|
2018-04-24 14:46:41 +00:00
|
|
|
test: unittest unittest-chailove cpplint
|
2017-11-30 06:22:43 +00:00
|
|
|
@echo "Run the testing suite by using:\n\n retroarch -L $(TARGET) test/main.chai\n\n"
|
2017-11-29 07:31:31 +00:00
|
|
|
|
2018-03-16 13:39:15 +00:00
|
|
|
vendor/noarch/noarch: vendor/libretro-common/include/libretro.h
|
2017-11-30 06:22:43 +00:00
|
|
|
@$(MAKE) -C vendor/noarch
|
2017-11-29 07:31:31 +00:00
|
|
|
|
2018-03-16 14:19:49 +00:00
|
|
|
unittest: vendor/noarch/noarch all
|
2018-03-16 13:24:10 +00:00
|
|
|
vendor/noarch/noarch $(CORE_DIR)/$(TARGET) test/unittests/main.chai
|
2017-06-24 19:14:28 +00:00
|
|
|
|
2018-04-24 14:46:41 +00:00
|
|
|
unittest-chailove: vendor/noarch/noarch all
|
|
|
|
vendor/noarch/noarch $(CORE_DIR)/$(TARGET) test/test.chailove
|
|
|
|
|
2018-03-16 14:19:49 +00:00
|
|
|
examples: all
|
2017-11-30 06:22:43 +00:00
|
|
|
@retroarch -L $(TARGET) examples/benchmark/main.chai
|
2017-07-13 04:36:36 +00:00
|
|
|
|
2018-03-16 14:19:49 +00:00
|
|
|
test-script: all
|
2017-11-30 06:22:43 +00:00
|
|
|
@retroarch -L $(TARGET) test/main.chai
|
2017-07-15 15:11:53 +00:00
|
|
|
|
2018-04-03 04:33:19 +00:00
|
|
|
docs: vendor/libretro-common/include/libretro.h docs/html
|
|
|
|
|
|
|
|
docs/html: docs-clean
|
2017-11-19 00:28:23 +00:00
|
|
|
doxygen docs/Doxyfile
|
|
|
|
|
2018-04-03 04:33:19 +00:00
|
|
|
docs-start: docs/html
|
2018-09-03 13:56:40 +00:00
|
|
|
php -S localhost:8080 -t docs/html
|
2017-12-13 16:21:13 +00:00
|
|
|
|
2018-04-03 04:33:19 +00:00
|
|
|
docs-clean:
|
|
|
|
rm -rf docs/html
|
|
|
|
|
2017-11-19 00:31:44 +00:00
|
|
|
docs-deploy: docs
|
2018-09-03 20:26:20 +00:00
|
|
|
npm init --force -y
|
|
|
|
npm install push-dir
|
|
|
|
node_modules/.bin/push-dir --dir=docs/html --branch=docs
|
2017-11-19 00:31:44 +00:00
|
|
|
|
2018-03-18 13:50:32 +00:00
|
|
|
cpplint: vendor/libretro-common/include/libretro.h
|
2017-11-30 06:22:43 +00:00
|
|
|
@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 \
|
2017-12-18 16:10:33 +00:00
|
|
|
src/*.h src/*.cpp src/love/*.h src/love/*.cpp src/love/Types/*/*.h src/love/Types/*/*.cpp
|
2017-11-30 01:36:09 +00:00
|
|
|
|
2018-03-18 13:50:32 +00:00
|
|
|
tests: vendor/libretro-common/include/libretro.h
|
2017-07-15 15:11:53 +00:00
|
|
|
$(MAKE) HAVE_CHAISCRIPT=0 HAVE_TESTS=1
|
2017-07-15 14:35:01 +00:00
|
|
|
|
2017-08-31 03:11:10 +00:00
|
|
|
PREFIX := /usr
|
|
|
|
INSTALLDIR := $(PREFIX)/lib/libretro
|
2018-03-16 14:19:49 +00:00
|
|
|
install: all
|
2017-08-31 03:11:10 +00:00
|
|
|
mkdir -p $(DESTDIR)$(INSTALLDIR)
|
|
|
|
cp $(TARGET) $(DESTDIR)$(INSTALLDIR)
|