2016-12-23 17:29:19 -06:00
|
|
|
OS=$(shell uname | tr [:upper:] [:lower:])
|
2016-12-23 18:06:27 -06:00
|
|
|
HOST_ENV=${OS}-$(shell uname -m)
|
2016-12-22 13:16:05 -06:00
|
|
|
DEVENV=devenv$(shell pwd | sed 's/\//-/g')
|
2017-04-14 04:08:13 -05:00
|
|
|
DEVENV_IMAGE=nostalgia-devenv
|
2018-03-05 23:09:50 -06:00
|
|
|
ifneq ($(shell which gmake 2> /dev/null),)
|
2017-05-19 20:52:27 -05:00
|
|
|
MAKE=gmake -s
|
2017-05-18 16:39:33 -05:00
|
|
|
else
|
2017-05-19 20:52:27 -05:00
|
|
|
MAKE=make -s
|
2017-05-18 16:39:33 -05:00
|
|
|
endif
|
2018-03-05 23:09:50 -06:00
|
|
|
ifneq ($(shell which docker 2> /dev/null),)
|
2017-04-09 03:16:20 -05:00
|
|
|
ifeq ($(shell docker inspect --format="{{.State.Status}}" ${DEVENV} 2>&1),running)
|
2017-04-10 17:45:32 -05:00
|
|
|
ENV_RUN=docker exec -i -t --user $(shell id -u ${USER}) ${DEVENV}
|
2017-04-09 03:16:20 -05:00
|
|
|
endif
|
2016-12-22 20:28:48 -06:00
|
|
|
endif
|
2016-12-18 15:54:13 -06:00
|
|
|
|
2019-02-27 23:23:10 -06:00
|
|
|
all:
|
2017-12-23 23:38:21 -06:00
|
|
|
${ENV_RUN} ./scripts/run-make build
|
2019-02-27 23:23:10 -06:00
|
|
|
pkg-gba:
|
2017-12-23 23:38:21 -06:00
|
|
|
${ENV_RUN} ./scripts/run-make build install
|
|
|
|
${ENV_RUN} ./scripts/run-make build
|
2017-10-14 19:38:10 -05:00
|
|
|
${ENV_RUN} ./scripts/gba-pkg
|
2016-03-26 15:49:05 -05:00
|
|
|
preinstall:
|
2017-12-23 23:38:21 -06:00
|
|
|
${ENV_RUN} ./scripts/run-make build preinstall
|
2016-03-26 15:49:05 -05:00
|
|
|
install:
|
2017-12-23 23:38:21 -06:00
|
|
|
${ENV_RUN} ./scripts/run-make build install
|
2016-03-26 15:49:05 -05:00
|
|
|
clean:
|
2017-12-23 23:38:21 -06:00
|
|
|
${ENV_RUN} ./scripts/run-make build clean
|
2016-12-23 17:29:19 -06:00
|
|
|
purge:
|
2018-04-14 11:03:00 -05:00
|
|
|
${ENV_RUN} rm -rf build
|
2016-03-26 15:49:05 -05:00
|
|
|
test:
|
2017-12-23 23:38:21 -06:00
|
|
|
${ENV_RUN} ./scripts/run-make build test
|
2016-12-23 18:06:27 -06:00
|
|
|
|
2017-05-16 13:53:57 -05:00
|
|
|
run: install
|
2019-01-15 22:33:13 -06:00
|
|
|
${ENV_RUN} ./dist/current/bin/nostalgia -debug
|
2017-05-16 13:53:57 -05:00
|
|
|
run-studio: install
|
2019-01-15 22:33:13 -06:00
|
|
|
${ENV_RUN} ./dist/current/bin/nostalgia-studio -profile dist/current/share/nostalgia-studio.json
|
2019-02-27 23:23:10 -06:00
|
|
|
gba-run: pkg-gba
|
2017-10-14 03:13:26 -05:00
|
|
|
mgba-qt nostalgia.gba
|
2016-12-23 17:29:19 -06:00
|
|
|
gdb: make
|
2019-01-15 22:33:13 -06:00
|
|
|
${ENV_RUN} gdb ./build/current/src/wombat/wombat
|
2018-01-28 00:26:50 -06:00
|
|
|
gdb-studio: install
|
2019-01-15 22:33:13 -06:00
|
|
|
${ENV_RUN} gdb --args ./dist/current/bin/nostalgia-studio -profile dist/current/share/nostalgia-studio.json
|
2016-12-23 18:06:27 -06:00
|
|
|
|
2017-10-14 19:38:10 -05:00
|
|
|
devenv-image:
|
2017-04-21 06:12:17 -05:00
|
|
|
docker build . -t ${DEVENV_IMAGE}
|
2018-04-13 19:24:45 -05:00
|
|
|
devenv-create:
|
2017-04-18 17:49:35 -05:00
|
|
|
docker run -d \
|
2016-12-22 20:28:48 -06:00
|
|
|
-e LOCAL_USER_ID=$(shell id -u ${USER}) \
|
2017-04-04 19:21:29 -05:00
|
|
|
-e DISPLAY=$(DISPLAY) \
|
|
|
|
-e QT_AUTO_SCREEN_SCALE_FACTOR=1 \
|
|
|
|
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
|
|
|
-v /run/dbus/:/run/dbus/ \
|
2017-04-18 17:49:35 -05:00
|
|
|
-v $(shell pwd):/usr/src/project \
|
2017-04-04 19:21:29 -05:00
|
|
|
-v /dev/shm:/dev/shm \
|
|
|
|
--restart=always \
|
|
|
|
--name ${DEVENV} \
|
2016-12-24 00:41:57 -06:00
|
|
|
-t ${DEVENV_IMAGE} bash
|
2016-12-18 15:54:13 -06:00
|
|
|
devenv-destroy:
|
|
|
|
docker rm -f ${DEVENV}
|
2019-02-27 23:23:10 -06:00
|
|
|
devenv-shell:
|
2017-04-10 17:45:32 -05:00
|
|
|
${ENV_RUN} bash
|
|
|
|
|
2019-03-07 18:04:25 -06:00
|
|
|
configure-release:
|
2016-12-23 18:06:27 -06:00
|
|
|
${ENV_RUN} rm -rf build/${HOST_ENV}-release
|
2019-02-02 13:08:22 -06:00
|
|
|
${ENV_RUN} ./scripts/setup-build ${HOST_ENV} release
|
2016-03-26 15:49:05 -05:00
|
|
|
|
2019-03-07 18:04:25 -06:00
|
|
|
configure-debug:
|
2016-12-23 18:06:27 -06:00
|
|
|
${ENV_RUN} rm -rf build/${HOST_ENV}-debug
|
2019-02-02 13:08:22 -06:00
|
|
|
${ENV_RUN} ./scripts/setup-build ${HOST_ENV} debug
|
2016-12-23 17:29:19 -06:00
|
|
|
|
2019-03-07 18:04:25 -06:00
|
|
|
configure-asan:
|
2017-12-20 22:41:14 -06:00
|
|
|
${ENV_RUN} rm -rf build/${HOST_ENV}-asan
|
2019-02-02 13:08:22 -06:00
|
|
|
${ENV_RUN} ./scripts/setup-build ${HOST_ENV} asan
|
2017-12-20 22:41:14 -06:00
|
|
|
|
2019-03-07 18:04:25 -06:00
|
|
|
configure-windows:
|
2016-12-23 17:29:19 -06:00
|
|
|
${ENV_RUN} rm -rf build/windows
|
2019-02-02 13:08:22 -06:00
|
|
|
${ENV_RUN} ./scripts/setup-build windows
|
2016-12-23 17:29:19 -06:00
|
|
|
|
2019-03-07 18:04:25 -06:00
|
|
|
configure-windows-debug:
|
2016-12-23 17:29:19 -06:00
|
|
|
${ENV_RUN} rm -rf build/windows
|
2019-02-02 13:08:22 -06:00
|
|
|
${ENV_RUN} ./scripts/setup-build windows debug
|
2016-03-26 15:49:05 -05:00
|
|
|
|
2019-03-07 18:04:25 -06:00
|
|
|
configure-gba:
|
2016-12-23 17:29:19 -06:00
|
|
|
${ENV_RUN} rm -rf build/gba-release
|
2019-02-02 13:08:22 -06:00
|
|
|
${ENV_RUN} ./scripts/setup-build gba release
|
2016-12-24 13:06:44 -06:00
|
|
|
|
2019-03-07 18:04:25 -06:00
|
|
|
configure-gba-debug:
|
2016-12-24 13:06:44 -06:00
|
|
|
${ENV_RUN} rm -rf build/gba-debug
|
2019-02-02 13:08:22 -06:00
|
|
|
${ENV_RUN} ./scripts/setup-build gba debug
|