
# Simple Makefile for Rosegarden; not efficient at all
#
# Chris Cannam, February 1995

# Defines:
#
#     + Check first batch of defines in this Makefile for
#	library locations, source tree location, that kind
#	of thing.
#
#     + 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; otherwise defining
#	REPORT_LINE_AND_FILE just increases the information
#	content of midi read/write errors.
#
#     + 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.
#
#     + Define 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 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.
#
#     + Define NO_STRCASECMP if you haven't got strcasecmp()
#       or strncasecmp().
#
#       The above three will be defined automatically if
#       _POSIX_SOURCE is defined.  (This application is
#	mostly POSIX-compliant, but I haven't included the
#	POSIX signal-handling stuff yet.)
#
#     + Define HAVE_Z8530 if you have an SGI machine with
#       the Zilog Z8530 output controller, and want to
#       be able to record and sequence using it. Define
# 	HAVE_SGI_MIDI_LIB if you have and want to use the
#	SGI IRIX 5.3 dmedia MIDI library instead. In this
#	case, remember to add -lmd to the link flags.
#	If you define neither HAVE_Z8530 nor HAVE_SGI_MIDI_LIB,
#	you won't get any recording or playback
#
#     + If the type of the callback expected by signal()
#       on your system is something other than
#       (void (*)()), define SIGNAL_CALLBACK_TYPE=
#       whatever.  For instance, under SunOS 4.x you will
#       probably need to define SIGNAL_CALLBACK_TYPE=(SIG_PF),
#       and some systems will require
#       SIGNAL_CALLBACK_TYPE='(void (*)(int))'.  This
#       define should only be necessary if you're using a
#       particularly pedantic (C++?) compiler.


# This should point to a Bourne shell
SHELL		= /bin/sh


# Root of the Rosegarden tree.  This will be exported to inferior makes;
# you'll certainly need to change it
ROSEGARDEN	= /user/cannam/rosegarden


# System include directories.  This will also be exported
SYSINCDIRS	= -I/usr/include -I/usr/include/X11 \
		  -I/usr/include/X11/Xaw -I/usr/include/X11/bitmaps


# System library directories, also exported
SYSLDFLAGS	= -L/usr/lib -L/usr/lib/X11 -lmd


# Compile defines.  This will also be exported
DEFINES		= -DNeedFunctionPrototypes -DYAWN_AVAILABLE -D_POSIX_SOURCE -DHAVE_SGI_MIDI_LIB


# Name of the compiler, and some flags, also exported
CC		= cc
OPTFLAGS	= -g


# ranlib program, make it just "touch" or something if you don't need it
RANLIB		= /bin/echo


###
###
###

# None of the rest will be exported, so leave it alone

EXPORTATION	= ROSEGARDEN="$(ROSEGARDEN)" ; SYSINCDIRS="$(SYSINCDIRS)" ; SYSLDFLAGS="$(SYSLDFLAGS)" ; CC="$(CC)" ; DEFINES="$(DEFINES)" ; RANLIB="$(RANLIB)" ; OPTFLAGS="$(OPTFLAGS)" ; export ROSEGARDEN SYSINCDIRS DEFINES SYSLDFLAGS CC RANLIB OPTFLAGS

LISTLIB		= $(ROSEGARDEN)/lists/lib/libLists.a
YAWNLIB		= $(ROSEGARDEN)/yawn/lib/libY.a
LOCKLIB		= $(ROSEGARDEN)/interlock/lib/libInterlock.a
MIDILIB		= $(ROSEGARDEN)/midi/lib/libMidi.a

TOPBOX		= $(ROSEGARDEN)/bin/rosegarden
SEQUENCER	= $(ROSEGARDEN)/bin/sequencer
EDITOR		= $(ROSEGARDEN)/bin/editor

DO_SUBMAKE	= $(MAKE) depend ; $(MAKE)


.SILENT:

all:		Libraries Rosegarden
Libraries:	Lists Yawn Interlock Midi
Rosegarden:	Sequencer Editor Topbox


Lists:
		echo ; echo Checking the List library ; echo
		rm -f $(LISTLIB)
		( $(EXPORTATION) ; cd $(ROSEGARDEN)/lists/src ; $(DO_SUBMAKE) )

Yawn:
		echo ; echo Checking the Yawn library ; echo
		rm -f $(YAWNLIB)
		( $(EXPORTATION) ; cd $(ROSEGARDEN)/yawn/src ; $(DO_SUBMAKE) )

Interlock:
		echo ; echo Checking the Interlock library ; echo
		rm -f $(LOCKLIB)
		( $(EXPORTATION) ; cd $(ROSEGARDEN)/interlock/src ; \
		  $(DO_SUBMAKE) )

Midi:
		echo ; echo Checking the Midi library ; echo
		rm -f $(MIDILIB)
		( $(EXPORTATION) ; cd $(ROSEGARDEN)/midi/src ; $(DO_SUBMAKE) )

Sequencer:
		$(MAKE) Libraries ; rm -f $(SEQUENCER)
		echo ; echo Checking the Sequencer ; echo
		( $(EXPORTATION) ; cd $(ROSEGARDEN)/sequencer/src ; \
		  $(DO_SUBMAKE) )

Editor:
		$(MAKE) Libraries ; rm -f $(EDITOR)
		echo ; echo Checking the Editor ; echo
		( $(EXPORTATION) ; cd $(ROSEGARDEN)/editor/src ; \
		  $(DO_SUBMAKE) )

Topbox:
		$(MAKE) Libraries ; rm -f $(TOPBOX)
		echo ; echo Checking the Top Box ; echo
		( $(EXPORTATION) ; cd $(ROSEGARDEN)/topbox/src ; \
		  $(DO_SUBMAKE) )

clean:
		( $(EXPORTATION) ; cd $(ROSEGARDEN)/lists/src ; \
		  $(MAKE) clean )
		( $(EXPORTATION) ; cd $(ROSEGARDEN)/yawn/src ; \
		  $(MAKE) clean )
		( $(EXPORTATION) ; cd $(ROSEGARDEN)/interlock/src ; \
		  $(MAKE) clean )
		( $(EXPORTATION) ; cd $(ROSEGARDEN)/midi/src ; \
		  $(MAKE) clean )
		( $(EXPORTATION) ; cd $(ROSEGARDEN)/sequencer/src ; \
		  $(MAKE) clean )
		( $(EXPORTATION) ; cd $(ROSEGARDEN)/editor/src ; \
		  $(MAKE) clean )
		( $(EXPORTATION) ; cd $(ROSEGARDEN)/topbox/src ; \
		  $(MAKE) clean )

distclean:
		$(MAKE) clean
		rm -f $(SEQUENCER) $(EDITOR) $(TOPBOX)
		rm -f $(LISTLIB) $(YAWNLIB) $(LOCKLIB) $(MIDILIB)

