#
# Top Makefile
#
SHELL=/bin/sh
VERSION=1.1

# TOPDIR = where the compiled fonts (pcf...) will be installed
# use absolute path!
TOPDIR=/homes/ah/src/grfonts/INST

# pcf or pcfz (compressed)
TARGET=pcf

# the directories you wish to install - leave it as is for all
DIRS=75dpi 100dpi misc Type1

# CHANGE THIS TO REFLECT YOUR ARCHITECTURE. pcf files produced with the
# wrong values will STILL work but wil be slightly slower.
# byte order : -L (little endian) -M (big endian)
# bit order  : -l (LSBit first)   -m (MSBit first)
# (see bdftopcf(1) for more details)
#
# You can use .bdf files directly with X servers. But pcf will be FASTER.
# ix86 : -t -L -m
# sparc: -t -M -m  ?
#
B2POPTS ="-t -L -m" 


all::
	@echo "Building and installing all fonts in $(TOPDIR)..."
	@for i in $(DIRS); do \
		( [ -d $$i ] && cd $$i && echo "*** Dir: $$i" && make TOPDIR=$(TOPDIR) B2POPTS=$(B2POPTS) $(TARGET) && cp ../tools/xinst_top $(TOPDIR)  ) \
	done
	-cp README $(TOPDIR)


# --- create archive(s) : only for maintainers of the package
TAR=tar -cvpf -
GZIP=gzip -9
EXTRA=tools Makefile README xinst_top

# dir where the tar arhives will be stored
PDIR=$(HOME)

pack: pall

pall:
	$(TAR) $(DIRS) $(EXTRA) | $(GZIP) > $(PDIR)/greekXfonts-full-$(VERSION).tgz

pgrtex:
	$(TAR) 75dpi 100dpi $(EXTRA) | $(GZIP) > $(PDIR)/greekXfonts-grtex-$(VERSION).tgz

pbdf:
	$(TAR) 75dpi 100dpi misc $(EXTRA) | $(GZIP) > $(PDIR)/greekXfonts-BDF-$(VERSION).tgz

pps:
	$(TAR) Type1 $(EXTRA) | $(GZIP) > $(PDIR)/greekXfonts-Type1-$(VERSION).tgz

pi:
	( cd INST ; $(TAR) . | $(GZIP) > $(PDIR)/greekXfonts-full-linux.tgz )
