#
# Copyright 1996, 1997 Computing Research Labs, New Mexico State University
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
# THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
# OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
# THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
#
# $Id: Makefile,v 1.11 1997/09/15 04:49:20 mleisher Exp $
#
CC = gcc
CFLAGS = -g -Wall

OTHER = README COPYRIGHTS Makefile Imakefile.lesstif xmbdfedrc xmbdfed.man

HDRS = FGrid.h FGridP.h GEShared.h GEdit.h GEditP.h GEditTB.h GEditTBP.h \
       GTest.h GTestP.h ProgBar.h ProgBarP.h bdf.h bdfP.h bitmaps.h \
       hbf.h htext.h xmbdfed.h

SRCS = FGrid.c GEdit.c GEditTB.c GTest.c ProgBar.c bdf.c bdfgrab.c bdfgrid.c \
       bdfcons.c bdfpkgf.c comment.c finfo.c glyphed.c grab.c hbf.c help.c \
       prog.c props.c setup.c test.c xmbdfed.c

OBJS = FGrid.o GEdit.o GEditTB.o GTest.o ProgBar.o bdf.o bdfgrab.o bdfgrid.o \
       bdfcons.o bdfpkgf.o comment.o finfo.o glyphed.o grab.o hbf.o help.o \
       prog.o props.o setup.o test.o xmbdfed.o

#
# Specify the various defines needed for HBF fonts.  If you do not have GNU
# zip/unzip, then don't worry, you just can not open HBF fonts that refer to
# files with a ".gz" extension.  If you don't care about HBF fonts, just
# comment this line out.
#
HBFDEFS = -Dunix -DIN_MEMORY -DGUNZIP_CMD="\"/usr/local/bin/gunzip -c\""

#
# Uncomment these for SunOS.
#
INCS = -I/usr/local/include/X11R5
LIBS = -L/usr/local/lib/X11R5 -lXm -lXmu -lXt -lX11

#
# Uncomment these for Solaris.
#
#INCS = -I/usr/openwin/include -I/usr/dt/include
#LIBS = -L/usr/openwin/lib -L/usr/dt/lib -lXm -lXmu -lXt -lX11

#
# Uncomment these for Linux.
#
#INCS = -I/usr/X11/include -I/usr/Motif-2.0.1/include
#LIBS = -L/usr/Motif-2.0.1/lib -lXm -L/usr/X11/lib -lXpm -lXmu -lXt -lX11 -lSM -lICE


all: xmbdfed

xmbdfed: $(OBJS)
	$(PURIFY) $(CC) $(STATIC) $(CFLAGS) -o xmbdfed $(OBJS) $(LIBS)

hbf.o: hbf.c
	$(CC) $(CFLAGS) $(DEFS) $(HBFDEFS) $(INCS) -c $< -o $@

.c.o:
	$(CC) $(CFLAGS) $(DEFS) $(INCS) -c $< -o $@

tar:
	gtar zcf xmbdfed.tar.gz $(OTHER) $(HDRS) $(SRCS)

clean:
	/bin/rm -f *.o *BAK *CKP *~

realclean: clean
	/bin/rm -f xmbdfed

#
# Dependencies.
#
FGrid.o: FGrid.c FGridP.h FGrid.h bdfP.h bdf.h
GEdit.o: GEdit.c GEditP.h GEdit.h bdf.h GEShared.h
GEditTB.o: GEditTB.c GEditTBP.h GEditTB.h bdf.h GEShared.h bitmaps.h
GTest.o: GTest.c GTestP.h GTest.h bdfP.h bdf.h
ProgBar.o: ProgBar.c ProgBarP.h ProgBar.h
bdf.o: bdf.c bdfP.h bdf.h hbf.h
bdfgrab.o: bdfgrab.c bdfP.h bdf.h
bdfgrid.o: bdfgrid.c bdfP.h bdf.h
bdfcons.o: bdfcons.c bdfP.h bdf.h
bdfpkgf.o: bdfpkgf.c bdfP.h bdf.h
comment.o: comment.c FGrid.h bdfP.h bdf.h xmbdfed.h
finfo.o: finfo.c FGrid.h bdfP.h bdf.h xmbdfed.h
glyphed.o: glyphed.c FGrid.h bdfP.h bdf.h GEdit.h GEShared.h GEditTB.h \
 xmbdfed.h
grab.o: grab.c FGrid.h bdfP.h bdf.h xmbdfed.h
hbf.o: hbf.c hbf.h
help.o: help.c bdf.h xmbdfed.h htext.h
prog.o: prog.c ProgBar.h bdf.h xmbdfed.h
props.o: props.c FGrid.h bdfP.h bdf.h xmbdfed.h
setup.o: setup.c FGrid.h bdfP.h bdf.h xmbdfed.h
test.o: test.c FGrid.h bdfP.h bdf.h xmbdfed.h GTest.h
xmbdfed.o: xmbdfed.c FGrid.h bdfP.h bdf.h GTest.h xmbdfed.h
