
# Makefile for the Musical Notation Editor
#
# Chris Cannam, January 1994

# Defines:
#
#     + Define HAVE_NO_GETHOSTNAME if you have not got the
#       gethostname() call, or if you don't want the host
#       name displayed in the title bar.
#
#     + Define DEBUG for function entry/exit and memory
#       allocation debugging messages.
#
#     + 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 HAVE_SPECIALIST_MALLOC_LIBRARY if you are
#       linking with a fast malloc library which provides
#       the mallopt() call.  This has only been tested
#       under SGI IRIX; refer to main() in Main.c for
#       the changes this flag induces.


CC		= cc -g

CFLAGS		= -I/homes/ma0/ma0cc/project/include -I/homes/ma0/ma0cc/project/bitmaps -woff 100 -DFUNCPROTO -DHAVE_SPECIALIST_MALLOC_LIBRARY
# -DDEBUG -DREPORT_LINE_AND_FILE
LDFLAGS		= -L/usr/lib/X11 -L/homes/ma0/ma0cc/project/lib
LIBRARIES	= -lmalloc -lY -lXaw -lXext -lXmu -lXt -lX11 -lLists -lMidi -lInterlock

TARGET		= editor
HEADERS		= Classes.h Resources.h Widgets.h Fallbacks.h MTime.h Stave.h Format.h Menu.h StaveEdit.h GC.h StavePrivate.h General.h Notes.h Tags.h IO.h Palette.h Visuals.h StaveCursor.h ItemList.h Spline.h MidiOut.h MidiIn.h
OBJECTS		= Main.o Widgets.o GC.o Constructors.o Methods.o MTime.o Visuals.o Draw.o Menu.o Palette.o Stave.o Format.o IO.o MenuFile.o StaveEdit.o StaveCursor.o ItemList.o MenuEdit.o MenuGroup.o Spline.o MenuMarks.o MenuText.o MenuBar.o MenuStave.o MenuTools.o MidiOut.o MidiIn.o
SOURCES		= Main.c Widgets.c GC.c Constructors.c Methods.c MTime.c Visuals.c Draw.c Menu.c Palette.c Stave.c Format.c IO.c MenuFile.c StaveEdit.c StaveCursor.c ItemList.c MenuEdit.c MenuGroup.c Spline.c MenuMarks.c MenuText.c MenuBar.c MenuStave.c MenuTools.c MidiOut.c MidiIn.c

editor:		${OBJECTS} ../lib/libInterlock.a ../lib/libLists.a ../lib/libY.a ../lib/libListsD.a
		rm -f ${TARGET}
		${CC} -o ${TARGET} ${OBJECTS} ${LDFLAGS} ${LIBRARIES}

tags:		${SOURCES} ${HEADERS}
		etags -t ${SOURCES} ${HEADERS}

libListsD.a:	Lists.c
		${CC} ${CFLAGS} -DDEBUG -DREPORT_LINE_AND_FILE -c Lists.c
		ar r libListsD.a Lists.o

libLists.a:	Lists.c
		${CC} -I/homes/ma0/ma0cc/project/include -c Lists.c
		ar r libLists.a Lists.o

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

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

clean:
		rm -f ${OBJECTS}

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


