#########################################################################
#									
# File:		Makefile
#
# Description:	makefile for BDF and SNF font utilities (for HP 700/X)
#
# Revision:	$Revision: 1.7 $
#
# Date:		$Date: 91/11/01 07:58:02 $
#
# Language:	K&R C
#
# Project:	HP 700/X Font Utilities
#
# Status:	Released (Unsupported)
#
# (C) Copyright 1989, 1990 Hewlett-Packard Company. All rights reserved.
#
#########################################################################

CFLAGS		= -DHP700X -DFORMAT $(INCLUDES) $(FONT_DEFINES)

INCLUDES	= -I. -I../include -I/usr/include/X11R4 -I$(OPENWINHOME)/include

FONT_DEFINES	= -DFONT_SNF -DFONT_BDF -DCOMPRESSED_FONTS \
		-DUNCOMPRESSFILT=\"/usr/bin/uncompress\" \
		-DBDFTOSNFFILT=\"bdftosnf\" \
		-DSHELLPATH=\"/bin/sh\" \
		-DZBDFTOSNFFILT=\"/usr/bin/uncompress" | bdftosnf $(FCFLAGS)\""

HDRS		= ../include/bdftosnf.h \
		../include/font.h \
		../include/fontdir.h \
		../include/fontstruct.h \
		../include/misc.h \
		../include/os.h \
		../include/port.h \
		../include/servermd.h \
		../include/snfstruct.h \
		../include/swaptest.h

LD		= cc 

LDFLAGS		= -s -L /usr/lib/X11R4

LIBS		=

MAKEFILE	= Makefile

OBJ1		= xtbdftosnf.o

OBJ2		= xtshowsnf.o

OBJ3		= xtsnftosnf.o

OBJ4		= xtmkfontdir.o

UOBJ1		= fontutil.o

UOBJ2		= Lower.o

UOBJ3		= fontdir.o

UOBJ4		= fontswap.o

UOBJ5		= snf_util.o

OBJS		= $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) \
		$(UOBJ1) $(UOBJ2) $(UOBJ3) $(UOBJ4) $(UOBJ5)

PROG1		= xtbdftosnf

PROG2		= xtshowsnf

PROG3		= xtsnftosnf

PROG4		= xtmkfontdir

SHELL		= /bin/sh

SRCS		= xtbdftosnf.c \
		xtshowsnf.c  \
		xtsnftosnf.c \
		xtmkfontdir.c

USRCS		= fontutil.c \
		Lower.c \
		fontdir.c \
		fontswap.c \
		snf_util.c

.c.o:
		@echo "Compiling $*.c"
		@$(CC) $(CFLAGS) -c $<

#########################################################################

all:		$(PROG1) $(PROG2) $(PROG3) $(PROG4)

$(PROG1):       $(OBJ1) $(UOBJ1) $(UOBJ4) $(LIBS)
		@echo "Linking $(PROG1)"
		@$(LD) $(LDFLAGS) $(OBJ1) $(UOBJ1) $(UOBJ4) $(LIBS) -o $(PROG1)

$(PROG2):       $(OBJ2) $(UOBJ1) $(UOBJ4) $(LIBS)
		@echo "Linking $(PROG2)"
		@$(LD) $(LDFLAGS) $(OBJ2) $(UOBJ1) $(UOBJ4) $(LIBS) -o $(PROG2)

$(PROG3):       $(OBJ3) $(UOBJ1) $(UOBJ4) $(LIBS)
		@echo "Linking $(PROG3)"
		@$(LD) $(LDFLAGS) $(OBJ3) $(UOBJ1) $(UOBJ4) $(LIBS) -o $(PROG3)

$(PROG4):       $(OBJ4) $(UOBJ2) $(UOBJ3) $(UOBJ4) $(UOBJ5) $(LIBS)
		@echo "Linking $(PROG4)"
		@$(LD) $(LDFLAGS) $(UOBJ2) $(UOBJ3) $(OBJ4) $(UOBJ4) $(UOBJ5) $(LIBS) -o $(PROG4)

clean:;		@rm -f $(OBJS) core

clobber:;	@rm -f $(OBJS) $(PROG1) $(PROG2) $(PROG3) $(PROG4) core tags

echo:;		@echo $(HDRS) $(SRCS) $(USRCS)

index:;		@ctags -wx $(HDRS) $(SRCS) $(USRCS)

tags:           $(HDRS) $(SRCS) $(USRCS); @ctags $(HDRS) $(SRCS) $(USRCS)

xtbdftosnf.o: \
	../include/bdftosnf.h \
	../include/font.h \
	../include/fontstruct.h \
	../include/misc.h \
	../include/os.h \
	../include/servermd.h \
	../include/snfstruct.h \
	../include/swaptest.h

xtshowsnf.o: \
	../include/bdftosnf.h \
	../include/font.h \
	../include/fontstruct.h \
	../include/misc.h \
	../include/os.h \
	../include/servermd.h \
	../include/snfstruct.h \
	../include/swaptest.h

xtsnftosnf.o: \
	../include/bdftosnf.h \
	../include/font.h \
	../include/fontstruct.h \
	../include/misc.h \
	../include/os.h \
	../include/servermd.h \
	../include/snfstruct.h \
	../include/swaptest.h

xtmkfontdir.o: \
	../include/fontdir.h \
	../include/swaptest.h

fontutil.o: \
	../include/bdftosnf.h \
	../include/font.h \
	../include/fontstruct.h \
	../include/misc.h \
	../include/os.h \
	../include/port.h \
	../include/servermd.h \
	../include/snfstruct.h

fontswap.o: \
	../include/bdftosnf.h \
	../include/font.h \
	../include/fontstruct.h \
	../include/misc.h \
	../include/os.h \
	../include/servermd.h \
	../include/snfstruct.h

snf_util.o: \
	../include/bdftosnf.h \
	../include/font.h \
	../include/fontdir.h \
	../include/fontstruct.h \
	../include/misc.h \
	../include/os.h \
	../include/servermd.h \
	../include/snfstruct.h

fontdir.o: \
	../include/fontdir.h
