GAPPATH=../..
# makefile prototype for the Browse package                    Frank Lbeck
#  $Id:$

GAP = $(GAPPATH)/bin/x86_64/gap -b -l $(GAPPATH)

GAPINCL=-I$(GAPPATH)/src -I$(GAPPATH)/bin/x86_64

.PHONY: bindir

default: bindir bin/x86_64/ncurses.so

# this target creates a bin-directory
bindir:
	if test ! -d bin;  then mkdir bin;  fi
	if test ! -d bin/x86_64;  then mkdir bin/x86_64;  fi

bin/x86_64/ncurses.so: src/ncurses.c
	$(GAPPATH)/bin/x86_64/gac -d -o bin/x86_64/ncurses.so \
        src/ncurses.c -P -lpanel -P -lncurses

# make a statically linked GAP including the ncurses module
static:
	(cd $(GAPPATH)/bin/x86_64; \
        ./gac -o gap-static -p "-DEDIVSTATIC" -P "-static" \
        ../../pkg/Browse/src/ncurses.c)

# just make it again when called with 'manual'
##  manual: doc/manual.six
##  doc/manual.six: doc/main.xml doc/browsebib.xml doc/appl.xml doc/browse.xml \
##                  doc/curses.xml doc/intro.xml doc/util.xml
manual:
	($(GAP) < makedocrel.g)
	echo "LaTeX warnings:"
	grep "\(^LaTeX Warning\|^Overfull \\hbox\)" doc/main.log; exit 0

clean:
	rm -rf bin/x86_64 Makefile *~

WIDECHARS:
	$(GAPPATH)/bin/x86_64/gac -d -o bin/x86_64/ncurses.so \
        src/ncurses.c -p -DWIDECHARS -P -lpanelw -P -lncursesw

