Bug#620634: libforms upgrade broke xmancala

Jens Thoms Toerring jt at toerring.de
Tue Apr 5 12:29:27 UTC 2011


Hi Paul,

On Tue, Apr 05, 2011 at 08:07:36PM +0800, Paul Wise wrote:
> I'll forward your changes to the mancala upstream and update the Debian
> package.

Thanks!

> BTW: do you recommend that programs based on libforms generate their .c
> file from the .fd file at build time instead of doing the conversion
> once and saving the result?

I'd think that would be more clever - you safe a bit of storage
and the form designer file (the one with the .fd extension) is
the one that's important (and it's a PITA if someone edits the
.c file and it then gets out of sync with the .fd file). To re-
create the .c and .h files you just need something like

%.c %.h: %.fd
    fdesign -convert $<

in the Makefile (but that requires the .c or .h file is listed
somewhere as a dependency). I append a new version of the Make-
file that should do it automatically.

                          Best regards, Jens
-- 
  \   Jens Thoms Toerring  ________      jt at toerring.de
   \_______________________________      http://toerring.de
-------------- next part --------------
# $Id: Makefile,v 1.7 2007-06-13 18:29:52 sverrehu Exp $
TARGETS		= mancala xmancala
DIST		= mancala
VERMAJ		= 1
VERMIN		= 0
VERPAT		= 1
VERSION		= $(VERMAJ).$(VERMIN).$(VERPAT)

CC		= gcc

# Common directories and libraries
INCDIR		= -I.
LIBDIR		= -L.
LIBS		= 

# Directories and libraries for X, Xpm and XForms.
# If you don't have Xpm, you'll need to link with a static version of XForms.
XINCDIR		= -I/usr/include/X11
XLIBDIR		= -L/usr/X11R6/lib
XLIBS		= -lXpm -lforms -lX11 -lm

OPTIM		= -O3 -fomit-frame-pointer
CCOPT		= -Wall $(OPTIM) $(INCDIR) $(XINCDIR) -DVERSION=\"$(VERSION)\"
LDOPT		= -s $(LIBDIR)

# Object files common to all programs.
OBJS		= minimax.o mancala.o

# Object files used by xmancala
XSRCS       = xform.c rulestxt.c
XOBJS		= $(XSRCS:.c=.o)


all: $(TARGETS)

%.c %.h: %.fd
	fdesign -convert $<

mancala: textmain.o $(OBJS)
	$(CC) $(CCOPT) -o $@ textmain.o $(OBJS) $(LDOPT) $(LIBS)

xmancala: $(XOBJS) xmain.o $(OBJS)
	$(CC) $(CCOPT) -o $@ xmain.o $(XOBJS) $(OBJS) \
		$(LDOPT) $(XLIBDIR) $(XLIBS)

.c.o:
	$(CC) -o $@ -c $(CCOPT) $<

clean:
	rm -f *.o core depend *~  xform.c xform.h

veryclean: clean
	rm -f $(TARGETS) $(DIST)-$(VERSION).tar.gz

chmod:
	chmod a+r *

depend dep:
	$(CC) $(INCDIR) $(XINCDIR) -MM *.c >depend

# To let the authors make a distribution. The rest of the Makefile
# should be used by the authors only.
LSMFILE		= $(DIST)-$(VERSION).lsm
DISTDIR		= $(DIST)-$(VERSION)
DISTFILE	= $(DIST)-$(VERSION).tar.gz
DISTFILES	= README INSTALL RULES $(LSMFILE) \
		  Makefile Makefile.bcc \
		  mancala.c mancala.h minimax.c minimax.h \
		  textmain.c \
		  xform.c xform.h xform.fd xmain.c rulestxt.c

$(LSMFILE): FORCE
	VER=$(VERSION); \
	DATE=`date "+%d%b%y"|tr '[a-z]' '[A-Z]'`; \
	sed -e "s/VER/$$VER/g;s/DATE/$$DATE/g" $(DIST).lsm.in > $(LSMFILE)

FORCE:

# Warning: distclean removes the lsm-file, which can not be
# regenerated without the lsm.in-file, which is not part of the package.
distclean: veryclean
	rm -f $(LSMFILE)

dist: $(LSMFILE) chmod
	mkdir $(DISTDIR)
	chmod a+rx $(DISTDIR)
	ln $(DISTFILES) $(DISTDIR)
	tar -cvzf $(DISTFILE) $(DISTDIR)
	chmod a+r $(DISTFILE)
	rm -rf $(DISTDIR)

ifeq (depend,$(wildcard depend))
include depend
endif


More information about the Pkg-games-devel mailing list