From 7af1552a8bab6f9950adf857b41f4934d775de88 Mon Sep 17 00:00:00 2001 From: Xiangfu Liu Date: Thu, 24 Feb 2011 17:01:17 +0800 Subject: [PATCH] new package: Easy Tic-Tac-Toe game --- tic-tac-toe/Makefile | 47 +++++++++++++++++++ .../patches/001-replace-static-gcc.patch | 43 +++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 tic-tac-toe/Makefile create mode 100644 tic-tac-toe/patches/001-replace-static-gcc.patch diff --git a/tic-tac-toe/Makefile b/tic-tac-toe/Makefile new file mode 100644 index 0000000..5af0a54 --- /dev/null +++ b/tic-tac-toe/Makefile @@ -0,0 +1,47 @@ +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=tic-tac-toe +PKG_VERSION:=1.0 +PKG_REV:=1ef5285d7fb188cd2049936f85de98cabc911144 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=git://github.com/garretraziel/gomoku.git +PKG_SOURCE_PROTO:=git +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=$(PKG_REV) + +include $(INCLUDE_DIR)/package.mk + +define Package/tic-tac-toe + MAINTAINER:="Xiangfu Liu" + SECTION:=games + CATEGORY:=Games + TITLE:=Easy Tic-Tac-Toe game + URL:=http://github.com/garretraziel/gomoku +endef + +define Package/tic-tac-toe/description +Easy Tic-Tac-Toe game, using SDL and own AI. +endef + +TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/ \ + -Wl,-rpath-link=$(STAGING_DIR)/usr/lib \ + -L$(STAGING_DIR)/usr/lib + +define Package/tic-tac-toe/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/gobango $(1)/usr/bin +endef + +$(eval $(call BuildPackage,tic-tac-toe)) + +# The following comments configure the Emacs editor. Just ignore them. +# Local Variables: +# compile-command: "make -C ~/openwrt-xburst.full_system package/tic-tac-toe/{clean,compile} -j2 V=99" +# End: diff --git a/tic-tac-toe/patches/001-replace-static-gcc.patch b/tic-tac-toe/patches/001-replace-static-gcc.patch new file mode 100644 index 0000000..d5578ad --- /dev/null +++ b/tic-tac-toe/patches/001-replace-static-gcc.patch @@ -0,0 +1,43 @@ +diff --git a/Makefile b/Makefile +index 578e8af..e64d40f 100755 +--- a/Makefile ++++ b/Makefile +@@ -5,30 +5,30 @@ HACKA=defines.h game.h human.h ai1.h ai2.h graphics.h + OCKA=main.o ai1.o ai2.o game.o human.o graphics.o + + +-FLAGS=-std=c99 -pedantic -Wall ++CFLAGS:=$(CFLAGS) -std=c99 -pedantic -Wall + LIBS=-lSDL -lSDL_gfx + + build:$(program) + + $(program): $(OCKA) +- gcc $(FLAGS) $(OCKA) $(LIBS) -o $(program) ++ $(CC) $(CFLAGS) $(OCKA) $(LIBS) -o $(program) + + $(OCKA):$(HACKA) + + main.o: main.c +- gcc $(FLAGS) main.c -c ++ $(CC) $(CFLAGS) main.c -c + + ai1.o: ai1.c +- gcc $(FLAGS) ai1.c -c ++ $(CC) $(CFLAGS) ai1.c -c + + ai2.o: ai2.c +- gcc $(FLAGS) ai2.c -c ++ $(CC) $(CFLAGS) ai2.c -c + + game.o: game.c +- gcc $(FLAGS) game.c -c ++ $(CC) $(CFLAGS) game.c -c + + human.o: human.c +- gcc $(FLAGS) human.c -c ++ $(CC) $(CFLAGS) human.c -c + + graphics.o: graphics.c +- gcc $(FLAGS) graphics.c -c ++ $(CC) $(CFLAGS) graphics.c -c