nostalgia/Makefile

71 lines
2.0 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=wombatant/nostalgia-devenv
ifeq ($(shell docker inspect --format="{{.State.Status}}" ${DEVENV} 2>&1),running)
ENV_RUN=docker exec --user $(shell id -u ${USER}) ${DEVENV}
endif
2016-12-18 15:54:13 -06:00
2016-03-26 15:49:05 -05:00
make:
2016-12-23 18:06:27 -06:00
${ENV_RUN} make -j -C build HOST_ENV=${HOST_ENV}
2016-03-26 15:49:05 -05:00
preinstall:
2016-12-23 18:06:27 -06:00
${ENV_RUN} make -j -C build ARGS="preinstall" HOST_ENV=${HOST_ENV}
2016-03-26 15:49:05 -05:00
install:
2016-12-23 18:06:27 -06:00
${ENV_RUN} make -j -C build ARGS="install" HOST_ENV=${HOST_ENV}
2016-03-26 15:49:05 -05:00
clean:
2016-12-23 18:06:27 -06:00
${ENV_RUN} make -j -C build ARGS="clean" HOST_ENV=${HOST_ENV}
2016-12-23 17:29:19 -06:00
purge:
${ENV_RUN} rm -rf $(shell find build -mindepth 1 -maxdepth 1 -type d)
2016-03-26 15:49:05 -05:00
test:
2016-12-23 18:06:27 -06:00
${ENV_RUN} make -j -C build ARGS="test" HOST_ENV=${HOST_ENV}
2016-03-26 15:49:05 -05:00
run: make
./build/current/src/wombat/wombat -debug
2016-12-23 17:29:19 -06:00
gdb: make
2016-03-26 15:49:05 -05:00
gdb ./build/current/src/wombat/wombat
2016-12-23 18:06:27 -06:00
2016-12-18 15:54:13 -06:00
devenv:
2016-12-24 00:41:57 -06:00
docker pull ${DEVENV_IMAGE}
docker run -d -v $(shell pwd):/usr/src/project \
-e LOCAL_USER_ID=$(shell id -u ${USER}) \
2016-12-24 00:41:57 -06:00
--restart=always --name ${DEVENV} \
-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
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}
2016-12-23 17:29:19 -06:00
${ENV_RUN} rm -f build/current
2016-12-23 18:06:27 -06:00
${ENV_RUN} ln -s ${HOST_ENV}-release 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
2016-12-23 18:06:27 -06:00
${ENV_RUN} ln -s ${HOST_ENV}-debug build/current
2016-12-23 17:29:19 -06:00
windows:
${ENV_RUN} rm -rf build/windows
${ENV_RUN} ./scripts/setup_build windows
${ENV_RUN} rm -f build/current
${ENV_RUN} ln -s windows build/current
windows-debug:
${ENV_RUN} rm -rf build/windows
${ENV_RUN} ./scripts/setup_build windows debug
${ENV_RUN} rm -f build/current
${ENV_RUN} ln -s windows 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
${ENV_RUN} ./scripts/setup_build gba
${ENV_RUN} rm -f build/current
${ENV_RUN} ln -s gba-release 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
${ENV_RUN} ln -s gba-debug build/current