From 42f5cf229efa2b20c642c7c0d7a2f3cd98b9a890 Mon Sep 17 00:00:00 2001 From: oroborus Date: Mon, 17 Mar 2008 22:19:43 +0000 Subject: - dopisane scripty git-svn-id: http://opensvn.csie.org/tuxanci_ng@25 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e --- Makefile | 11 ++++++++--- build.sh | 27 +++++++++++++++++++++++++++ current_config.h | 1 + deb-build.sh | 4 ++-- include/bool.h | 2 ++ include/buffer.h | 2 ++ include/client.h | 2 ++ include/configFile.h | 1 + include/director.h | 1 + include/dynamicInt.h | 2 ++ include/gun.h | 2 ++ include/homeDirector.h | 2 ++ include/interface.h | 2 +- include/list.h | 2 ++ include/logFile.h | 2 ++ include/main.h | 1 + include/net_multiplayer.h | 1 + include/network.h | 2 ++ include/path.h | 15 +++++++++++++++ include/proto.h | 1 + include/screen_choiceArena.h | 2 ++ include/string_length.h | 2 ++ include/udp.h | 2 ++ include/wall.h | 2 ++ include/widget_button.h | 2 ++ include/widget_buttonimage.h | 2 ++ include/widget_image.h | 1 + path_config.h | 2 ++ src/Makefile | 3 ++- src/arena.c | 1 + src/buffer.c | 1 + src/client.c | 1 + src/director.c | 2 +- src/dynamicInt.c | 1 + src/gun.c | 2 +- src/list.c | 1 + src/logFile.c | 1 + src/net_multiplayer.c | 1 + src/screen_credits.c | 2 +- src/sdl_udp.c | 2 ++ src/server.c | 1 + src/tcp.c | 1 + src/textFile.c | 1 + tarball-build.sh | 30 ++++++++++++++++++++++++++++++ tarballbin-build.sh | 25 +++++++++++++++++++++++++ 45 files changed, 164 insertions(+), 10 deletions(-) create mode 100755 build.sh create mode 100644 current_config.h create mode 100644 path_config.h create mode 100755 tarball-build.sh create mode 100755 tarballbin-build.sh diff --git a/Makefile b/Makefile index d65b6ba..30a480d 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,11 @@ #DISTDIR=/usr/local -DISTDIR:=/usr/ all: - make -C ./src DISTDIR=$(DISTDIR) + make -C ./src clean: - make -C ./src DISTDIR=$(DISTDIR) clean + make -C ./src clean make -C ./src -f Makefile-publicServer clean run: @@ -18,6 +17,12 @@ srun: package: ./deb-build.sh +tarball: + ./tarball-build.sh + +tarballbin: + ./tarballbin-build.sh + kill: kill -9 `pidof publicserver` diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..645729d --- /dev/null +++ b/build.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +rm -rf deb myusr tuxanci-ng_svn*_i386.deb +rm -rf tuxanci_ng-i386-bin tuxanci_ng-i386-bin tuxanci_ng-i386-bin.tar.bz2 +rm -rf tuxanci_ng tuxanci_ng.tar tuxanci_ng.tar.bz2 + +make clean +mv current_config.h config.h +make +mv config.h current_config.h +./tarballbin-build.sh + +make clean +./tarball-build.sh + +make clean +mv path_config.h config.h +make + +rm -rf myusr +mkdir myusr +mkdir myusr/bin +mkdir myusr/share + +make install DISTDIR=./myusr/ +mv config.h path_config.h +./deb-build.sh diff --git a/current_config.h b/current_config.h new file mode 100644 index 0000000..e8a73bd --- /dev/null +++ b/current_config.h @@ -0,0 +1 @@ +#define SUPPORT_NET_SDL_UDP diff --git a/deb-build.sh b/deb-build.sh index e81dca3..f87c7ed 100755 --- a/deb-build.sh +++ b/deb-build.sh @@ -16,8 +16,8 @@ cd deb echo -e "2.0\n" > DEBIAN/debian-binary -cp /usr/bin/tuxanci-ng usr/bin/ -cp -rf /usr/share/tuxanci-ng usr/share/ +cp ../myusr/bin/tuxanci-ng usr/bin/ +cp -rf ../myusr/share/tuxanci-ng usr/share/ md5sum `find ./ -type f | awk '/.\// { print substr($0, 3) }'` > DEBIAN/md5sums diff --git a/include/bool.h b/include/bool.h index ea32909..d122b85 100644 --- a/include/bool.h +++ b/include/bool.h @@ -3,6 +3,8 @@ #define BOOL_H +#include "main.h" + #define bool_t int #define TRUE 1 diff --git a/include/buffer.h b/include/buffer.h index 1b338df..b547e2b 100755 --- a/include/buffer.h +++ b/include/buffer.h @@ -3,6 +3,8 @@ #define BUFFER_H +#include "main.h" + #define BUFFER_LIMIT_ALLOC 1024 typedef struct str_buffer diff --git a/include/client.h b/include/client.h index 6c827f7..aee5e81 100644 --- a/include/client.h +++ b/include/client.h @@ -3,6 +3,8 @@ #define MY_CLIENT +#include "main.h" + #if defined SUPPORT_NET_UNIX_UDP || defined SUPPORT_NET_SDL_UDP #define CLIENT_TIMEOUT 2500 diff --git a/include/configFile.h b/include/configFile.h index a57fb16..f68a381 100644 --- a/include/configFile.h +++ b/include/configFile.h @@ -3,6 +3,7 @@ #define CONFIGFILE_H +#include "main.h" #include "textFile.h" extern int isYesOrNO(char *s); diff --git a/include/director.h b/include/director.h index aa2b2fd..8a07ed0 100644 --- a/include/director.h +++ b/include/director.h @@ -3,6 +3,7 @@ #define DIRECTOR_H +#include "main.h" #include "list.h" typedef struct director_struct diff --git a/include/dynamicInt.h b/include/dynamicInt.h index fbc54a7..266ff86 100644 --- a/include/dynamicInt.h +++ b/include/dynamicInt.h @@ -3,6 +3,8 @@ #define DYNAMIC_INT_H +#include "main.h" + extern int* newInt(int x); #endif diff --git a/include/gun.h b/include/gun.h index 57c2378..5f443e6 100644 --- a/include/gun.h +++ b/include/gun.h @@ -3,6 +3,8 @@ #define GUN_H +#include "main.h" + #define GUN_SHOT_WIDTH 5 #define GUN_SHOT_HEIGHT 5 diff --git a/include/homeDirector.h b/include/homeDirector.h index 6dbf5a2..85f8172 100755 --- a/include/homeDirector.h +++ b/include/homeDirector.h @@ -3,6 +3,8 @@ #define HOMEDIRECTOR_H +#include "main.h" + #define HOMEDIRECTOR_NAME ".tuxanci-ng" extern void createHomeDirector(); diff --git a/include/interface.h b/include/interface.h index a65ffa4..77f515b 100755 --- a/include/interface.h +++ b/include/interface.h @@ -19,7 +19,7 @@ #define SDL_SUBSYSTEMS SDL_INIT_VIDEO|SDL_INIT_TIMER|SDL_DOUBLEBUF //napis na okne -#define WINDOW_TITLE "Tuxanci next generation SVN revision 23" +#define WINDOW_TITLE "Tuxanci next generation SVN revision 24" #define WIN_BPP 0 #define USR_EVT_TIMER 0 diff --git a/include/list.h b/include/list.h index 0e122c6..8722baa 100755 --- a/include/list.h +++ b/include/list.h @@ -3,6 +3,8 @@ #define LIST_H +#include "main.h" + #define LIST_ALLOC_LIMIT 16 typedef struct list_str diff --git a/include/logFile.h b/include/logFile.h index 639069d..12f5606 100644 --- a/include/logFile.h +++ b/include/logFile.h @@ -3,6 +3,8 @@ #define LOGFILE_H +#include "main.h" + typedef struct logFile_struct { char *name; diff --git a/include/main.h b/include/main.h index a51fd1e..da5b7ca 100644 --- a/include/main.h +++ b/include/main.h @@ -3,6 +3,7 @@ #define MAIN_H +#include "../config.h" #include "bool.h" #include "string_length.h" #include "path.h" diff --git a/include/net_multiplayer.h b/include/net_multiplayer.h index 723545f..0127de8 100644 --- a/include/net_multiplayer.h +++ b/include/net_multiplayer.h @@ -3,6 +3,7 @@ #define NET_MULTIPLAYER_H +#include "main.h" #include "tux.h" #include "item.h" #include "buffer.h" diff --git a/include/network.h b/include/network.h index dde6d25..a7934eb 100755 --- a/include/network.h +++ b/include/network.h @@ -1,6 +1,8 @@ #ifndef NETWORK_H +#include "main.h" + #define NETWORK_H extern int newSocket(int port,const char *ip); diff --git a/include/path.h b/include/path.h index ab1ae61..a51baa0 100644 --- a/include/path.h +++ b/include/path.h @@ -3,8 +3,23 @@ #define PATH_H +#include "main.h" + +#ifdef DISTDIR + #define PATH_DIR "share/tuxanci-ng/" +#endif + +#ifndef DISTDIR + +#define PATH_DIR "./" + +#undef DISTDIR +#define DISTDIR "" + +#endif + #define PATH_IMAGE DISTDIR PATH_DIR "image/" #define PATH_FONT DISTDIR PATH_DIR "font/" #define PATH_ARENA DISTDIR PATH_DIR "arena/" diff --git a/include/proto.h b/include/proto.h index 5e50965..e94c086 100644 --- a/include/proto.h +++ b/include/proto.h @@ -3,6 +3,7 @@ #define MY_PROTO +#include "main.h" #include "tux.h" #include "server.h" #include "item.h" diff --git a/include/screen_choiceArena.h b/include/screen_choiceArena.h index 0b10006..e6eebc4 100644 --- a/include/screen_choiceArena.h +++ b/include/screen_choiceArena.h @@ -3,6 +3,8 @@ #define SCREEN_GAME_TYPE +#include "main.h" + #define SCREENSHOT_ARENA_WIDTH 160 #define SCREENSHOT_ARENA_HEIGHT 107 diff --git a/include/string_length.h b/include/string_length.h index 693af5b..7f1c8a7 100644 --- a/include/string_length.h +++ b/include/string_length.h @@ -3,6 +3,8 @@ #define STR_LENGTH_H +#include "main.h" + #define STR_SIZE 128 #define STR_NUM_SIZE 8 #define STR_NAME_SIZE 32 diff --git a/include/udp.h b/include/udp.h index 8c63e10..9d7be85 100644 --- a/include/udp.h +++ b/include/udp.h @@ -5,6 +5,8 @@ #define MY_UDP +#include "main.h" + typedef struct struct_sock_udp_t { int sock; diff --git a/include/wall.h b/include/wall.h index c9b74f0..329063d 100644 --- a/include/wall.h +++ b/include/wall.h @@ -3,6 +3,8 @@ #define WALL_H +#include "main.h" + #ifndef BUBLIC_SERVER #include "interface.h" #endif diff --git a/include/widget_button.h b/include/widget_button.h index 0787878..5090e55 100644 --- a/include/widget_button.h +++ b/include/widget_button.h @@ -3,6 +3,8 @@ #define WIDGET_BUTTON_H +#include "main.h" + #define WIDGET_BUTTON_TIME 10 #define WIDGET_BUTTON_WIDTH 125 diff --git a/include/widget_buttonimage.h b/include/widget_buttonimage.h index 8b279ce..d03423e 100644 --- a/include/widget_buttonimage.h +++ b/include/widget_buttonimage.h @@ -1,6 +1,8 @@ #ifndef WIDGET_BUTTONIMAGE_H +#include "main.h" + #define WIDGET_BUTTONIMAGE_H #define WIDGET_BUTTONIMAGE_TIME 10 diff --git a/include/widget_image.h b/include/widget_image.h index 30516f2..6bb316c 100644 --- a/include/widget_image.h +++ b/include/widget_image.h @@ -3,6 +3,7 @@ #define WIDGET_IMAGE_H +#include "main.h" #include "interface.h" typedef struct widget_image diff --git a/path_config.h b/path_config.h new file mode 100644 index 0000000..d4a9c3d --- /dev/null +++ b/path_config.h @@ -0,0 +1,2 @@ +#define DISTDIR "/usr/" +#define SUPPORT_NET_SDL_UDP diff --git a/src/Makefile b/src/Makefile index 67e442b..b740d40 100755 --- a/src/Makefile +++ b/src/Makefile @@ -2,7 +2,8 @@ #CC = /usr/local/gcc/bin/gcc CC = gcc -CFLAGS = -g -O0 -DSUPPORT_NET_SDL_UDP -DDISTDIR=\"$(DISTDIR)\" -I../include -Wall `sdl-config --cflags` +#CFLAGS = -O2 -DSUPPORT_NET_SDL_UDP -I../include -Wall `sdl-config --cflags` +CFLAGS = -O2 -I../include -Wall `sdl-config --cflags` #CFLAGS = -O2 -DDISTDIR=\"$(DISTDIR)\" `sdl-config --cflags` -I../include -Wall LIBS = `sdl-config --libs` -lSDL_image -lSDL_ttf -lSDL_mixer -lSDL_net diff --git a/src/arena.c b/src/arena.c index 52044d1..c2080f9 100644 --- a/src/arena.c +++ b/src/arena.c @@ -3,6 +3,7 @@ #include #include +#include "main.h" #include "arena.h" #include "list.h" #include "tux.h" diff --git a/src/buffer.c b/src/buffer.c index 95fef9d..37cbdfc 100755 --- a/src/buffer.c +++ b/src/buffer.c @@ -4,6 +4,7 @@ #include #include +#include "main.h" #include "buffer.h" buffer_t * newBuffer(int n) diff --git a/src/client.c b/src/client.c index 9dfeda5..12c9c0f 100644 --- a/src/client.c +++ b/src/client.c @@ -3,6 +3,7 @@ #include #include +#include "main.h" #include "list.h" #include "tux.h" #include "network.h" diff --git a/src/director.c b/src/director.c index e0b16b9..6d2fe8c 100755 --- a/src/director.c +++ b/src/director.c @@ -7,6 +7,7 @@ #include #include +#include "main.h" #include "list.h" #include "string_length.h" @@ -42,7 +43,6 @@ director_t* loadDirector(char *s) } new->path = strdup(path); - printf("new->path = %s\n", new->path); dir = opendir(new->path); diff --git a/src/dynamicInt.c b/src/dynamicInt.c index 3845d2f..4dd32ce 100644 --- a/src/dynamicInt.c +++ b/src/dynamicInt.c @@ -1,5 +1,6 @@ #include +#include "main.h" #include "dynamicInt.h" int* newInt(int x) diff --git a/src/gun.c b/src/gun.c index 08c3285..61ece2b 100644 --- a/src/gun.c +++ b/src/gun.c @@ -3,12 +3,12 @@ #include #include +#include "main.h" #include "arena.h" #include "tux.h" #include "shot.h" #include "dynamicInt.h" #include "myTimer.h" -#include "main.h" #include "item.h" #include "gun.h" diff --git a/src/list.c b/src/list.c index 64dae27..56f7e17 100755 --- a/src/list.c +++ b/src/list.c @@ -1,4 +1,5 @@ +#include "main.h" #include "list.h" #include diff --git a/src/logFile.c b/src/logFile.c index 12a4df8..7ff58c7 100644 --- a/src/logFile.c +++ b/src/logFile.c @@ -4,6 +4,7 @@ #include #include #include +#include "main.h" typedef struct logFile_struct { diff --git a/src/net_multiplayer.c b/src/net_multiplayer.c index 5a99bfe..9daf943 100644 --- a/src/net_multiplayer.c +++ b/src/net_multiplayer.c @@ -5,6 +5,7 @@ #include #include +#include "main.h" #include "list.h" #include "tux.h" #include "item.h" diff --git a/src/screen_credits.c b/src/screen_credits.c index 17c1bfe..7cd44ea 100644 --- a/src/screen_credits.c +++ b/src/screen_credits.c @@ -93,7 +93,7 @@ void initScreenCredits() image = getImage(IMAGE_GROUP_BASE, "screen_main"); image_backgorund = newWidgetImage(0, 0, image); - button_back = newWidgetButton("Back", WINDOW_SIZE_X/2 -WIDGET_BUTTON_WIDTH/2, WINDOW_SIZE_Y-100, eventWidget); + button_back = newWidgetButton("Back", WINDOW_SIZE_X/2 -WIDGET_BUTTON_WIDTH/2, WINDOW_SIZE_Y-80, eventWidget); listWidgetLabel = newList(); textFile = loadTextFile(PATH_DATA SCREEN_CREDITS_FILE); diff --git a/src/sdl_udp.c b/src/sdl_udp.c index a8eae7a..e6b669a 100644 --- a/src/sdl_udp.c +++ b/src/sdl_udp.c @@ -5,6 +5,8 @@ #include #include #include + +#include "main.h" #include "sdl_udp.h" #define BUFSIZE 1000 diff --git a/src/server.c b/src/server.c index 2a259c5..d55a6c0 100644 --- a/src/server.c +++ b/src/server.c @@ -9,6 +9,7 @@ #include #include +#include "main.h" #include "list.h" #include "tux.h" #include "network.h" diff --git a/src/tcp.c b/src/tcp.c index 87b548b..a80eca8 100755 --- a/src/tcp.c +++ b/src/tcp.c @@ -11,6 +11,7 @@ #include #include +#include "main.h" #include "tcp.h" #define BUFSIZE 1000 diff --git a/src/textFile.c b/src/textFile.c index e55650e..b3c0156 100755 --- a/src/textFile.c +++ b/src/textFile.c @@ -6,6 +6,7 @@ #include #include +#include "main.h" #include "textFile.h" #include "string_length.h" diff --git a/tarball-build.sh b/tarball-build.sh new file mode 100755 index 0000000..fcfb5c0 --- /dev/null +++ b/tarball-build.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +rm -rf tuxanci_ng tuxanci_ng.tar tuxanci_ng.tar.bz2 + +mkdir tuxanci_ng +mkdir tuxanci_ng/image +mkdir tuxanci_ng/font +mkdir tuxanci_ng/arena +mkdir tuxanci_ng/data +mkdir tuxanci_ng/lang +mkdir tuxanci_ng/sound +mkdir tuxanci_ng/music +mkdir tuxanci_ng/include +mkdir tuxanci_ng/src + + +cp image/*.* tuxanci_ng/image +cp font/*.* tuxanci_ng/font +cp arena/*.* tuxanci_ng/arena +cp data/*.* tuxanci_ng/data +cp lang/*.* tuxanci_ng/lang +cp sound/*.* tuxanci_ng/sound +cp music/*.* tuxanci_ng/music +cp include/*.* tuxanci_ng/include +cp src/* tuxanci_ng/src +cp Makefile control deb-ver tuxanci_ng +cp *.sh tuxanci_ng + +tar -cvf tuxanci_ng.tar tuxanci_ng +bzip2 tuxanci_ng.tar diff --git a/tarballbin-build.sh b/tarballbin-build.sh new file mode 100755 index 0000000..ecc053f --- /dev/null +++ b/tarballbin-build.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +rm -rf tuxanci_ng-i386-bin tuxanci_ng-i386-bin.tar tuxanci_ng-i386-bin.tar.bz2 + +mkdir tuxanci_ng-i386-bin +mkdir tuxanci_ng-i386-bin/image +mkdir tuxanci_ng-i386-bin/font +mkdir tuxanci_ng-i386-bin/arena +mkdir tuxanci_ng-i386-bin/data +mkdir tuxanci_ng-i386-bin/lang +mkdir tuxanci_ng-i386-bin/sound +mkdir tuxanci_ng-i386-bin/music + + +cp image/*.* tuxanci_ng-i386-bin/image +cp font/*.* tuxanci_ng-i386-bin/font +cp arena/*.* tuxanci_ng-i386-bin/arena +cp data/*.* tuxanci_ng-i386-bin/data +cp lang/*.* tuxanci_ng-i386-bin/lang +cp sound/*.* tuxanci_ng-i386-bin/sound +cp music/*.* tuxanci_ng-i386-bin/music +cp src/tuxanci-ng tuxanci_ng-i386-bin + +tar -cvf tuxanci_ng-i386-bin.tar tuxanci_ng-i386-bin +bzip2 tuxanci_ng-i386-bin.tar -- cgit v1.2.3