Permalink
Browse files

Added data files to compilation.

  • Loading branch information...
Maciej Makowski
Maciej Makowski committed Feb 24, 2014
1 parent 746e8b2 commit e195be22bd185a50a877cdb5bf3fb3d141a53fa5
Showing with 17 additions and 57 deletions.
  1. +17 −57 Makefile.emscripten
View
@@ -29,11 +29,15 @@ DESIGNER=-DHAVE_DESIGNER
FONT_USE_SDL_TTF=-lSDL_ttf
# You won't need to alter these
TARGET=$(shell cat TARGET)
TARGET=gnurobbo.html
SOURCES=$(wildcard *.c)
OBJECTS=$(patsubst %.c, %.o, $(SOURCES))
VERSION=$(shell cat VERSION)
BYTECODE=gnurobbo.bc
OUT=out/gnurobbo.html
OUTDIR=$(shell dirname $(OUT))
# These should be ok for most
#SDL_CONFIG?=sdl-config
CFLAGS?=-O3 -pipe
@@ -48,10 +52,17 @@ LDFLAGS=
LINK=$(CC)
#LIBS=`$(SDL_CONFIG) --libs` -lSDL_image -lSDL_mixer $(FONT_USE_SDL_TTF)
EMCCFLAGS=-O2
# You won't need to alter anything below
all: $(SOURCES) $(TARGET)
all: $(SOURCES) $(OUT)
$(TARGET): $(OBJECTS)
$(OUT): $(BYTECODE)
mkdir $(OUTDIR)
emcc $(EMCCFLAGS) $(BYTECODE) -o $(OUT) --preload-file $(PACKAGE_DATA_DIR)
$(BYTECODE): $(OBJECTS)
$(LINK) $(LDFLAGS) $(OBJECTS) $(LIBS) -o $@
%.o: %.c
@@ -60,57 +71,6 @@ $(TARGET): $(OBJECTS)
.PHONY: all clean install
clean:
rm -f *.o gnurobbo.bc
install:
@if [ "$(PACKAGE_DATA_DIR)" = ./data ] ; then \
echo "Installing into the current folder is not allowed."; \
exit 2; \
fi
mkdir -p $(PACKAGE_DATA_DIR)/levels
mkdir -p $(PACKAGE_DATA_DIR)/sounds/default
mkdir -p $(PACKAGE_DATA_DIR)/sounds/free
mkdir -p $(PACKAGE_DATA_DIR)/sounds/oily
mkdir -p $(PACKAGE_DATA_DIR)/sounds/skins
mkdir -p $(PACKAGE_DATA_DIR)/rob
mkdir -p $(PACKAGE_DATA_DIR)/skins/original
mkdir -p $(PACKAGE_DATA_DIR)/skins/tronic
mkdir -p $(PACKAGE_DATA_DIR)/skins/oily
mkdir -p $(PACKAGE_DATA_DIR)/locales/cz_CZ
mkdir -p $(PACKAGE_DATA_DIR)/locales/de_DE
mkdir -p $(PACKAGE_DATA_DIR)/locales/en_GB
mkdir -p $(PACKAGE_DATA_DIR)/locales/id_ID
mkdir -p $(PACKAGE_DATA_DIR)/locales/pl_PL
mkdir -p $(PACKAGE_DATA_DIR)/locales/ru_RU
mkdir -p $(PACKAGE_DATA_DIR)/locales/sk_SK
mkdir -p $(PACKAGE_DATA_DIR)/locales/sv_SE
mkdir -p $(BINDIR)
mkdir -p $(DOCDIR)
cp data/levels/* $(PACKAGE_DATA_DIR)/levels/
cp data/sounds/default/* $(PACKAGE_DATA_DIR)/sounds/default/
cp data/sounds/free/* $(PACKAGE_DATA_DIR)/sounds/free/
cp data/sounds/oily/* $(PACKAGE_DATA_DIR)/sounds/oily/
cp data/sounds/skins/* $(PACKAGE_DATA_DIR)/sounds/skins/
cp data/rob/*.bmp $(PACKAGE_DATA_DIR)/rob/
cp data/skins/original/*.bmp data/skins/original/*.png data/skins/original/skinrc $(PACKAGE_DATA_DIR)/skins/original/
cp data/skins/tronic/*.bmp data/skins/tronic/*.png data/skins/tronic/skinrc $(PACKAGE_DATA_DIR)/skins/tronic/
cp data/skins/oily/*.bmp data/skins/oily/*.png data/skins/oily/skinrc $(PACKAGE_DATA_DIR)/skins/oily/
@if [ -n "$(FONT_USE_SDL_TTF)" ] ; then \
cp data/skins/original/robbo.ttf $(PACKAGE_DATA_DIR)/skins/original/; \
cp data/skins/tronic/robbo.ttf $(PACKAGE_DATA_DIR)/skins/tronic/; \
cp data/skins/oily/robbo.ttf $(PACKAGE_DATA_DIR)/skins/oily/; \
fi
cp data/locales/cz_CZ/* $(PACKAGE_DATA_DIR)/locales/cz_CZ/
cp data/locales/de_DE/* $(PACKAGE_DATA_DIR)/locales/de_DE/
cp data/locales/en_GB/* $(PACKAGE_DATA_DIR)/locales/en_GB/
cp data/locales/id_ID/* $(PACKAGE_DATA_DIR)/locales/id_ID/
cp data/locales/pl_PL/* $(PACKAGE_DATA_DIR)/locales/pl_PL/
cp data/locales/ru_RU/* $(PACKAGE_DATA_DIR)/locales/ru_RU/
cp data/locales/sk_SK/* $(PACKAGE_DATA_DIR)/locales/sk_SK/
cp data/locales/sv_SE/* $(PACKAGE_DATA_DIR)/locales/sv_SE/
cp $(TARGET) $(BINDIR)/
cp ChangeLog NEWS COPYING README LICENSE-sound $(DOCDIR)/
@if [ -n "$(FONT_USE_SDL_TTF)" ] ; then \
cp LICENSE-ttf $(DOCDIR)/; \
fi
rm -fr $(OUTDIR)
rm -f *.o $(BYTECODE)

0 comments on commit e195be2

Please sign in to comment.