diff -urN 01-STYMulator-0.21a-stdint_h/Makefile 02-STYMulator-0.21a-Makefiles/Makefile
--- 01-STYMulator-0.21a-stdint_h/Makefile	1970-01-01 01:00:00.000000000 +0100
+++ 02-STYMulator-0.21a-Makefiles/Makefile	2010-04-23 15:04:03.742724060 +0200
@@ -0,0 +1,11 @@
+TOPDIR=.
+include $(TOPDIR)/Rules.make
+
+all:
+	$(MAKE) -C src all
+
+install:
+	$(MAKE) -C src install
+
+clean:
+	$(MAKE) -C src clean
diff -urN 01-STYMulator-0.21a-stdint_h/Rules.make 02-STYMulator-0.21a-Makefiles/Rules.make
--- 01-STYMulator-0.21a-stdint_h/Rules.make	1970-01-01 01:00:00.000000000 +0100
+++ 02-STYMulator-0.21a-Makefiles/Rules.make	2010-04-23 15:04:10.531699704 +0200
@@ -0,0 +1,6 @@
+CC = gcc
+CXX = g++
+AR = ar cr
+RM = rm -f
+CXXFLAGS = -Wall -O2
+CFLAGS = -Wall -O2
diff -urN 01-STYMulator-0.21a-stdint_h/src/Makefile 02-STYMulator-0.21a-Makefiles/src/Makefile
--- 01-STYMulator-0.21a-stdint_h/src/Makefile	2010-04-21 18:02:59.162502394 +0200
+++ 02-STYMulator-0.21a-Makefiles/src/Makefile	2010-04-23 15:04:19.523698854 +0200
@@ -1,11 +1,12 @@
-RM = rm -f
-CC = g++
-CFLAGS = -Wall
+TOPDIR=..
+include $(TOPDIR)/Rules.make
 
 LZH = stsoundlib/lzh
 STLIB = stsoundlib
 
-INCLUDE = -L$(LZH) -L$(STLIB)
+override CFLAGS += -I$(LZH) -I$(STLIB)
+override CXXFLAGS += -I$(LZH) -I$(STLIB)
+override LDFLAGS += -L$(LZH) -L$(STLIB)
 
 INSTALL = /usr/bin/install -c
 
@@ -17,22 +18,22 @@
 	done
 
 ymplayer: ymplayer.o sound.o ui.o
-	$(CC) -o ymplayer $(INCLUDE) ymplayer.o sound.o ui.o -lasound -lym -llzh -lncurses
+	$(CXX) -o ymplayer $(LDFLAGS) ymplayer.o sound.o ui.o -lasound -lym -llzh -lncurses
 
 ym2wav: ym2wav.o
-	$(CC) -o ym2wav $(INCLUDE) ym2wav.o -lym -llzh	
+	$(CXX) -o ym2wav $(LDFLAGS) ym2wav.o -lym -llzh	
 
-ymplayer.o: ymplayer.cpp $(STLIB)/StSoundLibrary.h ui.h sound.h
-	$(CC) $(INLCUDE) -c ymplayer.cpp
+ymplayer.o: ymplayer.cpp
+	$(CXX) $(CXXFLAGS) -c ymplayer.cpp
 
 ym2wav.o: ym2wav.cpp $(STLIB)/StSoundLibrary.h
-	$(CC) $(INCLUDE) -c ym2wav.cpp
+	$(CXX) $(CXXFLAGS) $(INCLUDE) -c ym2wav.cpp
 
 sound.o: sound.cpp sound.h
-	$(CC) -c sound.cpp
+	$(CXX) $(CXXFLAGS) -c sound.cpp
 
-ui.o: ui.c ui.h $(STLIB)/StSoundLibrary.h
-	$(CC) -c ui.c
+ui.o: ui.cpp ui.h $(STLIB)/StSoundLibrary.h
+	$(CXX) $(CXXFLAGS) -c ui.cpp
 
 install: all
 	$(INSTALL) ymplayer /usr/bin
diff -urN 01-STYMulator-0.21a-stdint_h/src/stsoundlib/lzh/Makefile 02-STYMulator-0.21a-Makefiles/src/stsoundlib/lzh/Makefile
--- 01-STYMulator-0.21a-stdint_h/src/stsoundlib/lzh/Makefile	2010-04-21 18:02:59.114538194 +0200
+++ 02-STYMulator-0.21a-Makefiles/src/stsoundlib/lzh/Makefile	2010-04-23 15:04:37.138700081 +0200
@@ -1,14 +1,11 @@
-CC = gcc
-AR = ar cr
-RM = rm -f
-
-CFLAGS = -Wall
+TOPDIR=../../..
+include $(TOPDIR)/Rules.make
 
 liblzh.a: lzhlib.o
 	$(AR) liblzh.a lzhlib.o
 
 lzhlib.o: lzhlib.cpp lzh.h
-	$(CC) -c lzhlib.cpp
+	$(CXX) $(CXXFLAGS) -c lzhlib.cpp
 
 clean:
 	$(RM) *~ *.o *.a
diff -urN 01-STYMulator-0.21a-stdint_h/src/stsoundlib/Makefile 02-STYMulator-0.21a-Makefiles/src/stsoundlib/Makefile
--- 01-STYMulator-0.21a-stdint_h/src/stsoundlib/Makefile	2010-04-21 18:02:59.142538491 +0200
+++ 02-STYMulator-0.21a-Makefiles/src/stsoundlib/Makefile	2010-04-23 15:04:26.022706265 +0200
@@ -1,28 +1,25 @@
-CC = g++
-AR = ar cr
-RM = rm -f
+TOPDIR=../..
+include $(TOPDIR)/Rules.make
 
 LIB = digidrum.o Ymload.o Ym2149Ex.o YmMusic.o YmUserInterface.o
 
-CFLAGS = -Wall
-
 libym.a: $(LIB)
 	$(AR) libym.a $(LIB)
 
 digidrum.o: digidrum.cpp YmTypes.h
-	$(CC) -c digidrum.cpp
+	$(CXX) $(CXXFLAGS) -c digidrum.cpp
 
 Ym2149Ex.o: Ym2149Ex.cpp Ym2149Ex.h YmTypes.h
-	$(CC) -c Ym2149Ex.cpp
+	$(CXX) $(CXXFLAGS) -c Ym2149Ex.cpp
 
 Ymload.o: Ymload.cpp YmMusic.h lzh/lzh.h
-	$(CC) -c Ymload.cpp
+	$(CXX) $(CXXFLAGS) -c Ymload.cpp
 
 YmMusic.o: YmMusic.cpp YmMusic.h
-	$(CC) -c YmMusic.cpp
+	$(CXX) $(CXXFLAGS) -c YmMusic.cpp
 
 YmUserInterface.o: YmUserInterface.cpp StSoundLibrary.h YmMusic.h
-	$(CC) -c YmUserInterface.cpp
+	$(CXX) $(CXXFLAGS) -c YmUserInterface.cpp
 
 clean:
 	$(RM) *~ *.o *.a
diff -urN 01-STYMulator-0.21a-stdint_h/src/ui.c 02-STYMulator-0.21a-Makefiles/src/ui.c
--- 01-STYMulator-0.21a-stdint_h/src/ui.c	2010-04-21 18:02:59.017524424 +0200
+++ 02-STYMulator-0.21a-Makefiles/src/ui.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,146 +0,0 @@
-/*	file: ui.c 
-
-	This file is a part of STYMulator - GNU/Linux YM player
-
-	Player & ST-Sound GPL library GNU/Linux port by Grzegorz Tomasz Stanczyk
-	Project Page: http://atariarea.krap.pl/stymulator
-	
-	Original ST-Sound GPL library by Arnaud Carre (http://leonard.oxg.free.fr)
-	ALSA (Advanced Linux Sound Architecture) library (http://www.alsa-project.org/)
-
------------------------------------------------------------------------------
- *   STYMulator is free software; you can redistribute it and/or modify    *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   STYMulator is distributed in the hope that it will be useful,         *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with STYMulator; if not, write to the                           *
- *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
----------------------------------------------------------------------------*/
-
-#if defined(__x86_64__) || defined(__alpha__) || defined(__ia64__)\
-	|| defined(__ppc64__) || defined(__s390x__)
-#define PLATFORM 1
-#else
-#define PLATFORM 0
-#endif
-
-#include "stsoundlib/StSoundLibrary.h"
-#include "ui.h"
-#include <stdlib.h>
-
-extern bool digi;
-
-int pos_x = 0, pos_y = 0;
-static int height = 13;
-static int width = 80;
-
-void draw_frame(void)
-{
-	int y = pos_y;
-
-	move(pos_y, pos_x+1);
-	if (PLATFORM)
-		addstr("---- STYMulator v0.21a (64bit) - Atari ST (16-bit) YM music files player -----");
-	else
-		addstr("---- STYMulator v0.21a (32bit) - Atari ST (16-bit) YM music files player -----");
-	move(pos_y+8, pos_x+1);
-	addstr("------------------------------------------------------------------------------");
-	move(pos_y+12, pos_x+1);
-	addstr("----------------------- Copyright (C) 2005-2007 by Grzegorz Tomasz Stanczyk --");
-	for (y = pos_y; y < pos_y + 13; y++) {
-		mvaddch(y, pos_x, '|');
-		mvaddch(y, pos_x+79, '|');
-  	}
-	mvaddstr(pos_y+1, pos_x+5, "Filename.:");
-	mvaddstr(pos_y+2, pos_x+5, "Name.....:");
-	mvaddstr(pos_y+3, pos_x+5, "Author...:");
-	mvaddstr(pos_y+4, pos_x+5, "Comment..:");
-	mvaddstr(pos_y+5, pos_x+5, "Type.....:");
-	mvaddstr(pos_y+6, pos_x+5, "Player...:");
-	
-	if (digi) {
-		mvaddstr(pos_y+7, pos_x+5, "Duration.:");
-		mvaddstr(pos_y+5, pos_x+58, "Time...:");
-	}
-	mvaddstr(pos_y+6, pos_x+58, "Status.:");
-	mvaddstr(pos_y+7, pos_x+58, "Repeat.:");
-	mvaddstr(pos_y+9, pos_x+11, "| z - play | x - pause | c - stop | r - repeat | q - quit |");
-	if (digi)
-		mvaddstr(pos_y+10, pos_x+27, "|   n - <<   |   m - >>   | ");
-	move(0,0);
-	refresh();
-}
-
-static void clearscreen(void)
-{
-	wclear(stdscr);
-	move(0,0);
-	refresh();
-}
-
-int ui_init(void)
-{
-	initscr();
-	cbreak();
-	noecho();
-	curs_set(0);
-	keypad(stdscr, TRUE);
-	nodelay(stdscr, 1);
-
-	if (COLS < width || LINES < height) {
-		ui_end();
-		printf("COLS: %d, LINES: %d\n", COLS, LINES);
-		printf("Sorry, you need a terminal with at least 80 cols and 13 lines.\n");
-		exit(0);
-	}
-	pos_y=(LINES - height) / 2;
-	pos_x=(COLS - width) / 2;
-
-	return 0;
-}
-
-void ui_end(void)
-{
-	clearscreen();
-	move(LINES - 1, 0);
-	refresh();
-	nodelay(stdscr, 0);
-	echo();
-	nocbreak();
-	endwin();
-	putchar('\n');
-}
-
-void draw_info(ymMusicInfo_t &info, const char *filename)
-{
-	mvprintw(pos_y+1, pos_x+16, filename);
-	mvprintw(pos_y+2, pos_x+16, info.pSongName);
-	mvprintw(pos_y+3, pos_x+16, info.pSongAuthor);
-	mvprintw(pos_y+4, pos_x+16, info.pSongComment);
-	mvprintw(pos_y+5, pos_x+16, info.pSongType);
-	mvprintw(pos_y+6, pos_x+16, info.pSongPlayer);
-	if (digi)
-		mvprintw(pos_y+7, pos_x+16, "%2d:%02d", info.musicTimeInSec/60,info.musicTimeInSec%60);
-	move(0,0);
-	refresh();
-}		
-
-void draw_time(int sec)
-{
-	mvprintw(pos_y+5, pos_x+67, "%2d:%02d  ", sec / 60, sec % 60);
-	move(0,0);
-	refresh();
-}
-
-
-
-
-
diff -urN 01-STYMulator-0.21a-stdint_h/src/ui.cpp 02-STYMulator-0.21a-Makefiles/src/ui.cpp
--- 01-STYMulator-0.21a-stdint_h/src/ui.cpp	1970-01-01 01:00:00.000000000 +0100
+++ 02-STYMulator-0.21a-Makefiles/src/ui.cpp	2010-04-21 18:31:19.878472513 +0200
@@ -0,0 +1,146 @@
+/*	file: ui.c 
+
+	This file is a part of STYMulator - GNU/Linux YM player
+
+	Player & ST-Sound GPL library GNU/Linux port by Grzegorz Tomasz Stanczyk
+	Project Page: http://atariarea.krap.pl/stymulator
+	
+	Original ST-Sound GPL library by Arnaud Carre (http://leonard.oxg.free.fr)
+	ALSA (Advanced Linux Sound Architecture) library (http://www.alsa-project.org/)
+
+-----------------------------------------------------------------------------
+ *   STYMulator is free software; you can redistribute it and/or modify    *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   STYMulator is distributed in the hope that it will be useful,         *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with STYMulator; if not, write to the                           *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+---------------------------------------------------------------------------*/
+
+#if defined(__x86_64__) || defined(__alpha__) || defined(__ia64__)\
+	|| defined(__ppc64__) || defined(__s390x__)
+#define PLATFORM 1
+#else
+#define PLATFORM 0
+#endif
+
+#include "stsoundlib/StSoundLibrary.h"
+#include "ui.h"
+#include <stdlib.h>
+
+extern bool digi;
+
+int pos_x = 0, pos_y = 0;
+static int height = 13;
+static int width = 80;
+
+void draw_frame(void)
+{
+	int y = pos_y;
+
+	move(pos_y, pos_x+1);
+	if (PLATFORM)
+		addstr("---- STYMulator v0.21a (64bit) - Atari ST (16-bit) YM music files player -----");
+	else
+		addstr("---- STYMulator v0.21a (32bit) - Atari ST (16-bit) YM music files player -----");
+	move(pos_y+8, pos_x+1);
+	addstr("------------------------------------------------------------------------------");
+	move(pos_y+12, pos_x+1);
+	addstr("----------------------- Copyright (C) 2005-2007 by Grzegorz Tomasz Stanczyk --");
+	for (y = pos_y; y < pos_y + 13; y++) {
+		mvaddch(y, pos_x, '|');
+		mvaddch(y, pos_x+79, '|');
+  	}
+	mvaddstr(pos_y+1, pos_x+5, "Filename.:");
+	mvaddstr(pos_y+2, pos_x+5, "Name.....:");
+	mvaddstr(pos_y+3, pos_x+5, "Author...:");
+	mvaddstr(pos_y+4, pos_x+5, "Comment..:");
+	mvaddstr(pos_y+5, pos_x+5, "Type.....:");
+	mvaddstr(pos_y+6, pos_x+5, "Player...:");
+	
+	if (digi) {
+		mvaddstr(pos_y+7, pos_x+5, "Duration.:");
+		mvaddstr(pos_y+5, pos_x+58, "Time...:");
+	}
+	mvaddstr(pos_y+6, pos_x+58, "Status.:");
+	mvaddstr(pos_y+7, pos_x+58, "Repeat.:");
+	mvaddstr(pos_y+9, pos_x+11, "| z - play | x - pause | c - stop | r - repeat | q - quit |");
+	if (digi)
+		mvaddstr(pos_y+10, pos_x+27, "|   n - <<   |   m - >>   | ");
+	move(0,0);
+	refresh();
+}
+
+static void clearscreen(void)
+{
+	wclear(stdscr);
+	move(0,0);
+	refresh();
+}
+
+int ui_init(void)
+{
+	initscr();
+	cbreak();
+	noecho();
+	curs_set(0);
+	keypad(stdscr, TRUE);
+	nodelay(stdscr, 1);
+
+	if (COLS < width || LINES < height) {
+		ui_end();
+		printf("COLS: %d, LINES: %d\n", COLS, LINES);
+		printf("Sorry, you need a terminal with at least 80 cols and 13 lines.\n");
+		exit(0);
+	}
+	pos_y=(LINES - height) / 2;
+	pos_x=(COLS - width) / 2;
+
+	return 0;
+}
+
+void ui_end(void)
+{
+	clearscreen();
+	move(LINES - 1, 0);
+	refresh();
+	nodelay(stdscr, 0);
+	echo();
+	nocbreak();
+	endwin();
+	putchar('\n');
+}
+
+void draw_info(ymMusicInfo_t &info, const char *filename)
+{
+	mvprintw(pos_y+1, pos_x+16, filename);
+	mvprintw(pos_y+2, pos_x+16, info.pSongName);
+	mvprintw(pos_y+3, pos_x+16, info.pSongAuthor);
+	mvprintw(pos_y+4, pos_x+16, info.pSongComment);
+	mvprintw(pos_y+5, pos_x+16, info.pSongType);
+	mvprintw(pos_y+6, pos_x+16, info.pSongPlayer);
+	if (digi)
+		mvprintw(pos_y+7, pos_x+16, "%2d:%02d", info.musicTimeInSec/60,info.musicTimeInSec%60);
+	move(0,0);
+	refresh();
+}		
+
+void draw_time(int sec)
+{
+	mvprintw(pos_y+5, pos_x+67, "%2d:%02d  ", sec / 60, sec % 60);
+	move(0,0);
+	refresh();
+}
+
+
+
+
+
