# Auto-generated by gamma256/gameSource/configure for the GNU/Linux platform.  Do not edit manually.
PLATFORM_PATH = linux
PLATFORM_NAME = Linux
TIME_PLATFORM_PATH = unix
TIME_PLATFORM_NAME = Unix

PLATFORM_COMPILE_FLAGS =

PLATFORM_LINK_FLAGS = -lSDL



ROOT_PATH = ../..

COMPILE = emcc ${PLATFORM_COMPILE_FLAGS} -Wall -Wwrite-strings \
  -Wchar-subscripts -Wparentheses -g -I${ROOT_PATH} ${EMCC_FLAGS} -c
LINK = emcc ${EMCC_FLAGS} -I${ROOT_PATH}






MG_PATH = ${ROOT_PATH}/minorGems

MINOR_GEMS_SOURCES = \
${MG_PATH}/io/file/${PLATFORM_PATH}/Path${PLATFORM_NAME}.cpp \
${MG_PATH}/util/stringUtils.cpp \
${MG_PATH}/util/StringBufferOutputStream.cpp \
${MG_PATH}/util/SettingsManager.cpp \
${MG_PATH}/system/${TIME_PLATFORM_PATH}/Time${TIME_PLATFORM_NAME}.cpp \
${MG_PATH}/crypto/hashes/sha1.cpp \
${MG_PATH}/formats/encodingUtils.cpp \


MINOR_GEMS_OBJECTS = ${MINOR_GEMS_SOURCES:.cpp=.o}



GAME_SOURCES = \
game.cpp \
landscape.cpp \
blowUp.cpp \
World.cpp \
map.cpp \
common.cpp \
score.cpp \
musicPlayer.cpp \
Timbre.cpp \
Envelope.cpp \

GAME_GRAPHICS = \
graphics/tileSet.tga \
graphics/characterSprite.tga \
graphics/characterSpriteSad.tga \
graphics/spouseSprite.tga \
graphics/numerals.tga \
graphics/chest.tga \
graphics/chestPrize.tga \
graphics/chestDust.tga \
graphics/heart.tga \
graphics/title.tga \
music/music.tga \



GAME_OBJECTS = ${GAME_SOURCES:.cpp=.o}


all: Passage ${GAME_GRAPHICS}

clean:  
	rm *.o *.tga Passage testMusicPlayer

Passage: ${GAME_OBJECTS} ${MINOR_GEMS_OBJECTS}
	${LINK} -o Passage.html ${GAME_OBJECTS} ${MINOR_GEMS_OBJECTS} \
          ${PLATFORM_LINK_FLAGS} --preload-file graphics \
          --preload-file music -s ALLOW_MEMORY_GROWTH=1 \
          -s DEMANGLE_SUPPORT=1 -s EMTERPRETIFY=1 -s EMTERPRETIFY_ASYNC=1 \
          -s EMTERPRETIFY_WHITELIST='["_main", "_mainFunction", "_playGame", "_waitForKeyOrButton", "_audioCallback", "__ZN12SimpleVectorIP4NoteE9push_backES1_", "__ZN12SimpleVectorIP4NoteE4sizeEv", "__ZN12SimpleVectorIP4NoteE10getElementEi", "__ZN8Envelope11getEnvelopeEi", "__ZN12SimpleVectorIP4NoteE13deleteElementEi"]'

testMusicPlayer: ${GAME_OBJECTS} testMusicPlayer.o common.o Timbre.o Envelope.o ${MINOR_GEMS_OBJECTS}
	${LINK} -o testMusicPlayer musicPlayer.o testMusicPlayer.o common.o Timbre.o Envelope.o ${MINOR_GEMS_OBJECTS} ${PLATFORM_LINK_FLAGS}


game.o: game.cpp World.h blowUp.h common.h map.h

landscape.o: landscape.cpp landscape.h
blowUp.o: blowUp.cpp blowUp.h
World.o: World.cpp World.h common.h map.h
common.o: common.cpp common.h 
map.o: map.cpp map.h landscape.h HashTable.h



# 
# Generic:
#
# Map all .cpp C++ and C files into .o object files
#
# $@   represents the name.o file
# $<   represents the name.cpp file
#
.cpp.o:
	${COMPILE} -o $@ $<
.c.o:
	${COMPILE} -o $@ $<
graphics/%.tga: %.png
	convert $< $@
music/%.tga: %.png
	convert $< $@
