OpenWrt packages
Sign in or create your account | Project List | Help
OpenWrt packages Git Source Tree
Root/
| 1 | # |
| 2 | # This is free software, licensed under the GNU General Public License v2. |
| 3 | # |
| 4 | |
| 5 | include $(TOPDIR)/rules.mk |
| 6 | |
| 7 | PKG_NAME:=bsd-games |
| 8 | PKG_VERSION:=2.17 |
| 9 | PKG_RELEASE:=1 |
| 10 | |
| 11 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz |
| 12 | PKG_SOURCE_URL:=ftp://metalab.unc.edu/pub/Linux/games/ |
| 13 | PKG_MD5SUM:=238a38a3a017ca9b216fc42bde405639 |
| 14 | |
| 15 | include $(INCLUDE_DIR)/package.mk |
| 16 | |
| 17 | define Package/bsd-games |
| 18 | SUBMENU:=bsd-games |
| 19 | SECTION:=games |
| 20 | CATEGORY:=Games |
| 21 | URL:=ftp://metalab.unc.edu/pub/Linux/games/ |
| 22 | endef |
| 23 | |
| 24 | define Build/Configure |
| 25 | endef |
| 26 | CFLAGS:= |
| 27 | define Build/Compile |
| 28 | #Building tetris |
| 29 | cd $(PKG_BUILD_DIR)/tetris; \ |
| 30 | cp pathnames.h.in pathnames.h; \ |
| 31 | $(TARGET_CC) -c -O2 -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-align -Wcast-qual -Wwrite-strings -I$(STAGING_DIR)/usr/include input.c screen.c shapes.c scores.c tetris.c; \ |
| 32 | $(TARGET_CC) -lncurses -L$(STAGING_DIR)/usr/lib -o tetris input.o screen.o shapes.o scores.o tetris.o |
| 33 | |
| 34 | #Building primes |
| 35 | cd $(PKG_BUILD_DIR)/primes; \ |
| 36 | $(TARGET_CC) -c -O2 -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-align -Wcast-qual -Wwrite-strings pattern.c pr_tbl.c primes.c; \ |
| 37 | $(TARGET_CC) -lm -o primes pattern.o pr_tbl.o primes.o |
| 38 | |
| 39 | #Building worm |
| 40 | cd $(PKG_BUILD_DIR)/worm; \ |
| 41 | $(TARGET_CC) -lncurses -L$(STAGING_DIR)/usr/lib -I$(STAGING_DIR)/usr/include -O2 -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-align -Wcast-qual -Wwrite-strings -o worm worm.c |
| 42 | |
| 43 | #Building backgammon |
| 44 | cd $(PKG_BUILD_DIR)/backgammon; \ |
| 45 | cd common_source; \ |
| 46 | $(TARGET_CC) -c -O2 -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-align -Wcast-qual -Wwrite-strings -I$(STAGING_DIR)/usr/include -DEXEC_PATH=\"/usr/bin/backgammon\" -DTEACH_PATH=\"/usr/bin/teachgammon\" allow.c board.c check.c fancy.c init.c odds.c one.c save.c subs.c table.c; \ |
| 47 | cd ../backgammon; \ |
| 48 | $(TARGET_CC) -c -O2 -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-align -Wcast-qual -Wwrite-strings -I$(STAGING_DIR)/usr/include -I$(PKG_BUILD_DIR)/backgammon/common_source extra.c main.c move.c text.c version.c; \ |
| 49 | $(TARGET_CC) -lncurses -L$(STAGING_DIR)/usr/lib -o backgammon $(ECHO) ../common_source/*.o ../backgammon/*.o; \ |
| 50 | cd ../teachgammon; \ |
| 51 | $(TARGET_CC) -c -O2 -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-align -Wcast-qual -Wwrite-strings -I$(STAGING_DIR)/usr/include -I$(PKG_BUILD_DIR)/backgammon/common_source data.c teach.c ttext1.c ttext2.c tutor.c; \ |
| 52 | $(TARGET_CC) -lncurses -L$(STAGING_DIR)/usr/lib -o teachgammon $(ECHO) ../common_source/*.o ../teachgammon/*.o |
| 53 | endef |
| 54 | |
| 55 | define Package/tetris |
| 56 | $(call Package/bsd-games) |
| 57 | TITLE:=the game of tetris |
| 58 | DEPENDS:=+libncurses |
| 59 | endef |
| 60 | |
| 61 | define Package/tetris/install |
| 62 | $(INSTALL_DIR) \ |
| 63 | $(1)/usr/bin \ |
| 64 | $(1)/usr/share/games |
| 65 | |
| 66 | $(INSTALL_BIN) \ |
| 67 | $(PKG_BUILD_DIR)/tetris/tetris \ |
| 68 | $(1)/usr/bin/tetris |
| 69 | endef |
| 70 | |
| 71 | define Package/primes |
| 72 | $(call Package/bsd-games) |
| 73 | TITLE:=generate primes |
| 74 | endef |
| 75 | |
| 76 | define Package/primes/install |
| 77 | $(INSTALL_DIR) \ |
| 78 | $(1)/usr/bin |
| 79 | |
| 80 | $(INSTALL_BIN) \ |
| 81 | $(PKG_BUILD_DIR)/primes/primes \ |
| 82 | $(1)/usr/bin/primes |
| 83 | endef |
| 84 | |
| 85 | define Package/worm |
| 86 | $(call Package/bsd-games) |
| 87 | TITLE:=The growing worm game |
| 88 | DEPENDS:=+libncurses |
| 89 | endef |
| 90 | |
| 91 | define Package/worm/install |
| 92 | $(INSTALL_DIR) \ |
| 93 | $(1)/usr/bin |
| 94 | |
| 95 | $(INSTALL_BIN) \ |
| 96 | $(PKG_BUILD_DIR)/worm/worm \ |
| 97 | $(1)/usr/bin/worm |
| 98 | endef |
| 99 | |
| 100 | define Package/backgammon |
| 101 | $(call Package/bsd-games) |
| 102 | TITLE:=the game of backgammon |
| 103 | DEPENDS:=+libncurses |
| 104 | endef |
| 105 | |
| 106 | define Package/backgammon/install |
| 107 | $(INSTALL_DIR) \ |
| 108 | $(1)/usr/bin |
| 109 | |
| 110 | $(INSTALL_BIN) \ |
| 111 | $(PKG_BUILD_DIR)/backgammon/backgammon/backgammon \ |
| 112 | $(1)/usr/bin/backgammon |
| 113 | |
| 114 | $(INSTALL_BIN) \ |
| 115 | $(PKG_BUILD_DIR)/backgammon/teachgammon/teachgammon \ |
| 116 | $(1)/usr/bin/teachgammon |
| 117 | |
| 118 | $(INSTALL_BIN) \ |
| 119 | $(FILES_DIR)/backgammon.sh \ |
| 120 | $(1)/usr/bin/backgammon.sh |
| 121 | endef |
| 122 | |
| 123 | $(eval $(call BuildPackage,tetris)) |
| 124 | $(eval $(call BuildPackage,primes)) |
| 125 | $(eval $(call BuildPackage,worm)) |
| 126 | $(eval $(call BuildPackage,backgammon)) |
| 127 |
