diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c107e1d --- /dev/null +++ b/Makefile @@ -0,0 +1,83 @@ +#the things that tells about the system +PREF=/usr/local +EXECUTEPATH=/usr/local/bin +INST=/games/blockattack + +standard: + @echo "Removing old files (if they exists)" + @rm -f *.o + @rm -f ./Game/blockattack + @rm -f ./Game/starter + @rm -f ./Game/runme.sh + @echo "Done deleting files" + @echo "Now compiling..." + @make -f block.make + @rm -f *.o + @echo "Everything has been compiled!" + +#makeinstall and install doesn't work, gfx dictory doesn't get copied! +#makeinstall: +# @echo "Removing old files (if they exists)" +# @rm -f *.o +# @rm -f ./Game/blockattack +# @rm -f ./Game/starter +# @rm -f ./Game/runme.sh +# @echo "Done deleting files" +# @echo "Now compiling..." +# @make -f block.make +# @g++ starter2.cpp -o ./Game/starter +# @echo "Everything has been compiled!" +# @echo "Creating installation dirs..." +# @mkdir -p $(PREF)$(INST) +# @echo "Dir has been created" +# @echo "Now copying files" +# @cp -P -f -r ./Game/* $(PREF)$(INST) +# @echo "Files have been copied" +# @chmod +r $(PREF)$(INST) -R +# @echo "Now creating a runable sh file called runme.sh" +# @touch $(PREF)$(INST)/runme.sh +# @echo "pushd $(PREF)$(INST)" >> $(PREF)$(INST)/runme.sh +# @echo "./blockattack" >> $(PREF)$(INST)/runme.sh +# @echo "popd" >> $(PREF)$(INST)/runme.sh +# @echo "File created, now setting +x permission to it" +# @chmod +x $(PREF)$(INST)/runme.sh +# @echo "Mow creating static links to runme.sh" +# @ln -fs $(PREF)$(INST)/runme.sh $(PREF)/bin/blockattack +# @echo "Links have been created" +# @echo "Block Attack - Rise of the Blocks have been installed!" +# @echo "Type 'blockattack' to run the game" + +#install: +# @echo "Everything must have been compiled" +# @echo "Creating installation dirs..." +# @mkdir -p $(PREF)$(INST) +# @echo "Dir has been created" +# @echo "Now copying files" +# @cp -P -f -r ./Game/* $(PREF)$(INST) +# @cp -P -f ./blockattack.xpm /usr/share/pixmaps +# @cp -P -f ./blockattack.desktop /usr/share/applications +# @echo "Files have been copied, giving all users read permission" +# @chmod +r $(PREF)$(INST) -R +# @echo "Now creating a runable sh file called runme.sh" +# @rm -f $(PREF)$(INST)/runme.sh +# @touch $(PREF)$(INST)/runme.sh +# @echo "pushd $(PREF)$(INST)" >> $(PREF)$(INST)/runme.sh +# @echo "./blockattack" >> $(PREF)$(INST)/runme.sh +# @echo "popd" >> $(PREF)$(INST)/runme.sh +# @echo "File created, now setting +x permission to it" +# @chmod +x $(PREF)$(INST)/runme.sh +# @echo "Mow creating static links to runme.sh" +# @ln -fs $(PREF)$(INST)/runme.sh $(PREF)/bin/blockattack +# @echo "Links have been created" +# @echo "Block Attack - Rise of the Blocks have been installed!" +# @echo "Type 'blockattack' to run the game" + +#remove: +# @echo "Removing: Block Attack - Rise of the Blocks" +# @rm $(PREF)$(INST) -R +# @echo "Data files has been removed!" +# @echo "Removing links..." +# @rm $(PREF)/bin/blockattack +# @rm /usr/share/pixmaps/blockattack.xpm +# @rm /usr/share/applications/blockattack.desktop +# @echo "All installed files has been removed" diff --git a/SConstruct b/SConstruct new file mode 100644 index 0000000..401a6a3 --- /dev/null +++ b/SConstruct @@ -0,0 +1,48 @@ +# Option # +opts = Options(args = ARGUMENTS) +opts.Add('destdir', 'Staging area to install BlockAttack to. Useful for packagers.', '') +opts.Add('prefix', 'Destination directory', '/usr/local') +opts.Add('sharedir', 'Directory to use to store data file', '$prefix/share/blockattack') +opts.Add('bindir', 'Directory to use to store data file', '$prefix/bin') +opts.Add('mandir', 'Directory to use to store data file', '$prefix/share/man') + +# Sources # +src = Split("""main.cpp +highscore.cpp +SFont.c +ReadKeyboard.cpp +joypad.cpp +listFiles.cpp +replay.cpp""") + +# Copy Build Environment # +env = Environment(options = opts) +Export("env") +SConsignFile() + +# Modify Build Environment # +env.ParseConfig('sdl-config --cflags --libs') +env.Append(CPPDEFINES = [('SHAREDIR', '\\"$sharedir\\"')]) +env.Append(LIBS = ['SDL', 'enet','SDL_image','SDL_mixer']) +env.Append(LIBPATH = ['/usr/lib']) + + +# Compile Executable # +blockattack = env.Program('blockattack', src) +Default(blockattack) + +# game materials (sharefiles) +SConscript('Game/SConscript') + +# manpage +SConscript('man/SConscript') +# icons menu +env.Install ('$destdir/$prefix/share/pixmaps/',['blockattack32.xpm','blockattack64.xpm']) +env.Alias('install', ['$destdir/$prefix/share/pixmaps/']) + +env.Install ('$destdir/$prefix/share/applications/',['blockattack.desktop']) +env.Alias('install', ['$destdir/$prefix/share/applications']) + +# Install blockattack itself +env.Install('$destdir/$bindir/', blockattack) +env.Alias('install', ['$destdir/$bindir/']) diff --git a/source/code/block.make b/source/code/block.make new file mode 100644 index 0000000..2246210 --- /dev/null +++ b/source/code/block.make @@ -0,0 +1,37 @@ +Game/bloackattack: main.o highscore.o SFont.o ReadKeyboard.o joypad.o listFiles.o replay.o common.o stats.o uploadReplay.o + g++ -O -o Game/blockattack main.o highscore.o SFont.o ReadKeyboard.o joypad.o listFiles.o replay.o common.o stats.o `sdl-config --cflags --libs` -lSDL_image -lSDL_mixer -lenet + +main.o: main.cpp BlockGame.hpp mainVars.hpp common.h + g++ -g -c main.cpp `sdl-config --cflags` + +highscore.o: highscore.h highscore.cpp + g++ -g -c highscore.cpp + +SFont.o: SFont.h SFont.c + g++ -g -c SFont.c `sdl-config --cflags` + +ReadKeyboard.o: ReadKeyboard.h ReadKeyboard.cpp + g++ -g -c ReadKeyboard.cpp `sdl-config --cflags` + +joypad.o: joypad.h joypad.cpp + g++ -g -c joypad.cpp `sdl-config --cflags` + +listFiles.o: listFiles.h listFiles.cpp + g++ -g -c listFiles.cpp + +replay.o: replay.h replay.cpp + g++ -g -c replay.cpp `sdl-config --cflags` + +stats.o: stats.h stats.cc + g++ -g -c stats.cc + +common.o: common.h common.cc + g++ -g -c common.cc + +uploadReplay.o: uploadReplay.cc uploadReplay.h + g++ -g -c uploadReplay.cc `sdl-config --cflags` + +run: Game/bloackattack + +clean: + rm *o