Skip to content

Instantly share code, notes, and snippets.

@shakesoda
Last active December 26, 2015 16:18
Show Gist options
  • Save shakesoda/7178522 to your computer and use it in GitHub Desktop.
Save shakesoda/7178522 to your computer and use it in GitHub Desktop.
simple gcw zero makefile + package script
CC=mipsel-gcw0-linux-uclibc-gcc
CXX=mipsel-gcw0-linux-uclibc-g++
LIBS=-lGLESv2 -lEGL -Iglm
FLAGS=-Wall -Wextra -fno-strict-aliasing -Og -ggdb -std=c++11 -Wno-missing-field-initializers
OUT=bin/game.bin
FILES=src/*.cpp src/stb_image.c
PACKAGE=gcw-test.opk
all:
@if ! test -d bin; then mkdir bin; fi;
$(CXX) $(FILES) -o $(OUT) $(LIBS) $(FLAGS)
clean:
if test -f $(PACKAGE); then rm $(PACKAGE); fi;
if test -f $(OUT); then rm $(OUT); fi;
install-only:
bash mkpackage.sh $(PACKAGE)
@rsync -avP $(PACKAGE) [email protected]:/media/data/apps
rm -rf tmp
install: all install-only
.PHONY: all clean install-only install
#!/usr/bin/env bash
PACKAGE=$1
# make sure we get a clean dist every time
if ! test -d tmp; then rm -rf tmp && mkdir tmp; fi;
cp -R bin/* tmp
cp -R data/* tmp
# make sure the package is clean too!
if test -f "$PACKAGE"; then
rm "$PACKAGE"
fi;
mksquashfs tmp/ "$PACKAGE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment