nostalgia/Makefile

93 lines
2.5 KiB
Makefile
Raw Normal View History

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)
DEVENV=devenv$(shell pwd | sed 's/\//-/g')
DEVENV_IMAGE=nostalgia-devenv
2017-05-18 16:39:33 -05:00
ifneq ($(shell which gmake),)
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
ifneq ($(shell which docker),)
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}
endif
endif
2016-12-18 15:54:13 -06:00
2016-03-26 15:49:05 -05:00
make:
2017-05-18 16:39:33 -05:00
${ENV_RUN} ${MAKE} -j -C build HOST_ENV=${HOST_ENV}
2017-10-14 19:38:10 -05:00
gba-pkg:
2017-05-18 16:39:33 -05:00
${ENV_RUN} ${MAKE} -j -C build ARGS="install" HOST_ENV=${HOST_ENV}
${ENV_RUN} ${MAKE} -j -C build HOST_ENV=${HOST_ENV}
2017-10-14 19:38:10 -05:00
${ENV_RUN} ./scripts/gba-pkg
2016-03-26 15:49:05 -05:00
preinstall:
2017-05-18 16:39:33 -05:00
${ENV_RUN} ${MAKE} -j -C build ARGS="preinstall" HOST_ENV=${HOST_ENV}
2016-03-26 15:49:05 -05:00
install:
2017-05-18 16:39:33 -05:00
${ENV_RUN} ${MAKE} -j -C build ARGS="install" HOST_ENV=${HOST_ENV}
2016-03-26 15:49:05 -05:00
clean:
2017-05-18 16:39:33 -05:00
${ENV_RUN} ${MAKE} -j -C build ARGS="clean" HOST_ENV=${HOST_ENV}
2016-12-23 17:29:19 -06:00
purge:
2017-05-16 01:35:32 -05:00
${ENV_RUN} rm -rf $$(find build -mindepth 1 -maxdepth 1 -type d) dist
2016-03-26 15:49:05 -05:00
test:
2017-05-18 16:39:33 -05:00
${ENV_RUN} ${MAKE} -j -C build ARGS="test" HOST_ENV=${HOST_ENV}
2016-12-23 18:06:27 -06:00
2017-05-16 13:53:57 -05:00
run: install
./dist/current/bin/nostalgia -debug
run-studio: install
./dist/current/bin/nostalgia-studio -profile dist/current/share/nostalgia-studio.json
2017-10-14 19:38:10 -05:00
gba-run: gba-pkg
mgba-qt nostalgia.gba
2016-12-23 17:29:19 -06:00
gdb: make
2016-03-26 15:49:05 -05:00
gdb ./build/current/src/wombat/wombat
2017-09-10 04:09:39 -05:00
gdb-studio: make
gdb "./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}
2016-12-18 15:54:13 -06:00
devenv:
docker run -d \
-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/ \
-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}
2016-03-26 15:49:05 -05:00
2017-04-10 17:45:32 -05:00
shell:
${ENV_RUN} bash
2016-12-23 17:29:19 -06:00
release:
2016-12-23 18:06:27 -06:00
${ENV_RUN} rm -rf build/${HOST_ENV}-release
${ENV_RUN} ./scripts/setup_build ${HOST_ENV} release
2016-12-23 17:29:19 -06:00
${ENV_RUN} rm -f build/current
2016-03-26 15:49:05 -05:00
2016-12-23 17:29:19 -06:00
debug:
2016-12-23 18:06:27 -06:00
${ENV_RUN} rm -rf build/${HOST_ENV}-debug
${ENV_RUN} ./scripts/setup_build ${HOST_ENV} debug
2016-12-23 17:29:19 -06:00
${ENV_RUN} rm -f build/current
windows:
${ENV_RUN} rm -rf build/windows
${ENV_RUN} ./scripts/setup_build windows
${ENV_RUN} rm -f build/current
windows-debug:
${ENV_RUN} rm -rf build/windows
${ENV_RUN} ./scripts/setup_build windows debug
${ENV_RUN} rm -f build/current
2016-03-26 15:49:05 -05:00
gba:
2016-12-23 17:29:19 -06:00
${ENV_RUN} rm -rf build/gba-release
2017-05-16 01:35:32 -05:00
${ENV_RUN} ./scripts/setup_build gba release
2016-12-23 17:29:19 -06:00
${ENV_RUN} rm -f build/current
2016-12-24 13:06:44 -06:00
gba-debug:
${ENV_RUN} rm -rf build/gba-debug
${ENV_RUN} ./scripts/setup_build gba debug
${ENV_RUN} rm -f build/current