#
#	$Id: Makefile,v 1.4 89/11/28 16:26:23 gregc Exp $
#
#	See the manual pages for a description of what these programs
#	do.  To install, do a "make install" and then as root do a
#	"make installman".  You may want to change the APPDEST and
#	BINDEST macros first though.
#
SHELL		= /bin/sh

APPDEST		= /LocalApps
BINDEST		= /usr/local/bin

CFLAGS		= -O -Wall -pendantic

PROGRAM1	= Pseudo
APPICON1	= Pseudo.tiff
APPICONFLAGS1	= -segcreate __ICON __header ${PROGRAM1}.iconheader \
		-segcreate __ICON app ${APPICON1}
SRCS1		= Pseudo.c
OBJS1		= Pseudo.o
LIBS1		= -lNeXT_s -lsys_s

PROGRAM2	= window-position
SRCS2		= window-position.c
OBJS2		= window-position.o
LIBS2		= -lsys_s

all: ${PROGRAM1} ${PROGRAM2}

install: ${PROGRAM1} ${PROGRAM2}
	install -s ${PROGRAM1} ${APPDEST}/${PROGRAM1}
	install -s ${PROGRAM2} ${BINDEST}/${PROGRAM2}

installman:
	@echo "You probably need to be root to install the manual pages"
	ln ${PROGRAM1}.1 ${PROGRAM1}.l ; \
		installman ${PROGRAM1}.l ; \
	rm ${PROGRAM1}.l
	ln ${PROGRAM2}.1 ${PROGRAM2}.l ; \
		installman ${PROGRAM2}.l ; \
	rm ${PROGRAM2}.l

${PROGRAM1}: ${OBJS1} ${PROGRAM1}.iconheader
	${CC} ${CFLAGS} -o ${PROGRAM1} ${OBJS1} ${LIBS1} ${APPICONFLAGS1}

${PROGRAM2}: ${OBJS2}
	${CC} ${CFLAGS} -o ${PROGRAM2} ${OBJS2} ${LIBS2}

clean:
	rm -f ${OBJS1} ${PROGRAM1} ${OBJS2} ${PROGRAM2} ${PROGRAM1}.shar

tar:
	tar cf - Makefile *.c *.1 *.iconheader *.tiff \
		| compress -c > ${PROGRAM1}.tar.Z
