
# Chris Cannam, January 1994

# Defines:
#
#     + Define HAVE_VIEWPORT_SET_FUNCTIONS if you have
#       the XawViewportSetCoordinates function and you'd
#       like the file selection box lists to scroll up and
#       down automatically to centre your selection.
#
#     + Define DEBUG for function entry/exit and memory
#       allocation debugging messages.  These only apply
#       to the core YAWN library, and not to the File or
#       Help code.
#
#     + Define REPORT_LINE_AND_FILE for verbose debugging
#       messages listing process id, filename and line no
#       for function entry and exit messages.  This is only
#       active if DEBUG is also defined.
#
#     + Define NO_SYS_ERRLIST for systems which do not
#       provide built-in external sys_errlist and sys_nerr
#       variables for error reporting.  This only affects
#       the quality of file error reporting.

CC		= cc

CFLAGS		= -O2 -g3 -I./bitmaps -woff 100 -DHAVE_VIEWPORT_SET_FUNCTIONS

TARGET		= yawn
HEADERS		= Yawn.h YHelp.h
OBJECTS		= Yawn.o YFile.o YHelp.o YMenu.o YSmeHack.o
SOURCES		= Yawn.c YFile.c YHelp.c YMenu.c YSmeHack.c

yawn:		libY.a libYHelp.a

libY.a:		Yawn.o YFile.o YMenu.o YSmeHack.o
		ar r libY.a Yawn.o YFile.o YMenu.o YSmeHack.o

#libY.a:		Yawn.c YFile.c YMenu.c
#		${CC} ${CFLAGS} -c Yawn.c
#		${CC} ${CFLAGS} -c YFile.c
#		${CC} ${CFLAGS} -c YMenu.c
#		ar r libY.a Yawn.o YFile.o YMenu.o

#libYD.a:	Yawn.c YFile.c
#		${CC} ${CFLAGS} -DDEBUG -DREPORT_LINE_AND_FILE -c Yawn.c
#		${CC} ${CFLAGS} -DDEBUG -DREPORT_LINE_AND_FILE -c YFile.c
#		${CC} ${CFLAGS} -DDEBUG -DREPORT_LINE_AND_FILE -c YMenu.c
#		ar r libYD.a Yawn.o YFile.o YMenu.o

libYHelp.a:	YHelp.o
		ar r libYHelp.a YHelp.o

YHelp.o:	YHelp.c
		${CC} -I/homes/ma0/ma0cc/project/include -I/homes/ma0/ma0cc/project/bitmaps -O2 -g3 -c -DHAVE_VIEWPORT_SET_FUNCTIONS YHelp.c

all:		${SOURCES}
		rm -f ${TARGET} ${OBJECTS}
		$(MAKE) yawn
		$(MAKE) backup

backup:		${SOURCES} ${HEADERS}
		for x in *.c *.h Makefile; do if [ -f $$HOME/backup-yawn/$$x ]; then :; else cp $$x $$HOME/backup-yawn/$$x; fi; done
		find . ! -name ${TARGET} ! -type d -newer $$HOME/backup-yawn/Makefile -exec cp {} $$HOME/backup-yawn \; ;

clean:
		rm -f ${OBJECTS}

depend:		${SOURCES} ${HEADERS}
		makedepend -- ${CFLAGS} -- ${SOURCES}


