# Makefile for bs, the Battleships game
+# Note: When the version changes, you also have to change
+# * the name of the containing directory
+# * the RPM spec file
+V=2.1
+
# Flags for use with the Linux ncurses package (recommended)
-CFLAGS = -DNCURSES -I/usr/local/include -L/usr/local/lib
TERMLIB = -lncurses
CC = gcc
# Flags for use with stock curses
-# CFLAGS =
# TERMLIB = -lcurses
# CC = gcc
clean:
rm -f bs bs.shar bs.tar.gz *~
+SOURCES = READ.ME bs.c Makefile bs.6 bs.lsm bs.spec
+
bs.shar:
- shar READ.ME bs.c Makefile bs.6 >bs.shar
+ shar $(SOURCES) >bs.shar
bs.tar.gz:
- tar -cvf bs.tar READ.ME bs.c Makefile bs.6 bs.lsm
+ (cd ..; tar -cvf bs-$(V)/bs.tar `echo $(SOURCES) | sed "/ /s// bs-$(V)\//g"`)
gzip bs.tar
+
+rpm: bs.tar.gz
+ cp bs.tar.gz /usr/src/SOURCES/bs-$(V).tar.gz
+ cp bs.spec /usr/src/SPECS/bs-$(V)-1.spec
+ rpm -ba bs-$(V)-1.spec