TOPDIR = ../..
include $(TOPDIR)/MakeVars
include $(TOPDIR)/Makerules

###########################################################################
# playmidi Makefile  last modification 2 January 1996
#
# by Nathan I Laredo, laredo@gnu.ai.mit.edu
#
# I don't wish to assert any rights (copyright) for this Makefile.
# This Makefile is specially designed for using "make install"
# thousands of times (for developing), and will only install updated
# files.  It does not write over exiting fm patch libs if you have them.
#
# 5/10/95 - Fixed a few bugs here and there. -- Alex
#
# 9/15/95 - Changed back to what I originally intended.
#
# 10/5/95 - Moved configurables to the start of Makefile, made variables
#           Added install for patch libraries
#
# 12/9/95 - Added stuff for xplaymidi, modified default paths for FSSTND
#           Any RedHat system should compile as is.
#
# 1/2/96  - Tried to document more completely, added some more objects
#           install.noX11, install.novga, install.Xonly, install.lame
#
# 1/5/96  - Added -DNARROWPROTO for xplaymidi
#
# 1/28/96 - Added options to make xview and xforms versions of xplaymidi
###########################################################################

INSTALL = install -s
CC	= gcc

# if you are using the GUS Ultra driver module, add -DULTRA_DRIVER

#INCLUDES = -I. -I../../include
#CFLAGS	= -Wall -pipe -fomit-frame-pointer -O2 -m486 -DUNIX $(INCLUDES)
#-DPLUGIN -DAWETHOR -DSOUNDSUPPORT 

SRCS = $(wildcard *.c)
OBJS = $(SRCS:.c=.o)

all: playmidi.o

config:
playmidi.h: playmidi.h-dist
	Configure

playmidi.o: playmidi.h $(OBJS)
	$(RM) playmidi.o
	$(LD) -r -o playmidi.o $(OBJS)

/etc/std.o3:
	cp -i std.o3 /etc

/etc/drums.o3:
	cp -i drums.o3 /etc

/etc/std.sb:
	cp -i std.sb /etc

/etc/drums.sb:
	cp -i drums.sb /etc

install: $(INSTALLDIR)/playmidi \
	 /etc/std.o3 /etc/drums.o3 /etc/std.sb /etc/drums.sb

clean:
	rm -f *.o playmidi a.out

realclean: clean
	rm -f .depend  *~ *.bak playmidi.h config.sed


dep depend:
	$(DEPEND) $(SRCS) > .depend
tags: 
	ln -sf $(TOPDIR)/TAGS TAGS
	etags -a -o TAGS $(SRCS)

#
# include a dependency file if one exists
#
ifeq (.depend,$(wildcard .depend))
include .depend
endif
