# Makefile for any machine
#
# $Author: espie $
# $Id: makefile,v 1.9 1992/10/27 22:52:59 espie Exp espie $
# $Revision: 1.9 $
# $Log: makefile,v $
# Revision 1.9  1992/10/27  22:52:59  espie
# *** empty log message ***
#
# Revision 1.8  1992/07/23  13:52:28  espie
# Added tools.c.
#
# Revision 1.7  1992/07/22  14:50:25  espie
# *** empty log message ***
#
# Revision 1.6  1992/07/17  13:43:00  espie
# *** empty log message ***
#
# Revision 1.5  1992/07/16  17:02:00  espie
# Added randomize/lookup/open.
#
# Revision 1.4  1992/07/15  12:45:41  espie
# *** empty log message ***
#
# Revision 1.3  1992/07/14  14:23:41  espie
# Small changes.
#
# Revision 1.2  1992/07/14  13:20:53  espie
# *** empty log message ***
#
# Revision 1.1  1992/07/13  17:21:11  espie
# Initial revision

INSTALL_DIR = $(HOME)/bin
MAIN_OPTS = -O -DSHOW_SEQ -DSYNC_AUDIO 

# uncomment the following lines for the sun sparcstation.
#
#MACHINE = sparc
#O = .o
#CC=acc
#COPTS = $(MAIN_OPTS) -c
#LIBS = -lm

# uncomment the following lines for the silicon graphics indigo.
#
#O = .u
#COPTS = $(MAIN_OPTS) -j -DSIGNED
#MACHINE = sgi
#LIBS = -laudio -lm

#uncomment the following lines for the soundblaster BSD 386 unix.
#
#INSTALL_DIR = $(HOME)/bin
#O = .o
#CFLAGS = 
#COPTS = $(MAIN_OPTS) -c
#MACHINE = soundblaster
#LIBS = -lm

OBJECTS = main$O $(MACHINE)_audio$O read$O commands$O \
audio$O automaton$O player$O getopt$O getopt1$O open$O tools$O

O2 = analyser$O read$O open$O


all: tracker randomize

install: all
	-rm -f $(INSTALL_DIR)/tracker $(INSTALL_DIR)/randomize
	cp tracker $(INSTALL_DIR)
	chmod a-w $(INSTALL_DIR)/tracker
	cp randomize $(INSTALL_DIR)
	chmod a-w $(INSTALL_DIR)/randomize

tracker: ${OBJECTS}
	$(CC) -o tracker ${MAIN_OPTS} ${OBJECTS} ${LIBS}
	strip tracker

randomize: randomize.c
	$(CC) -o randomize ${MAIN_OPTS} randomize.c 

main$O: main.c song.h
	$(CC) ${COPTS} main.c

tools$O: main.c 
	$(CC) ${COPTS} tools.c
$(MACHINE)_audio$O: $(MACHINE)_audio.c 
	$(CC) ${COPTS} $(MACHINE)_audio.c

open$O: open.c
	$(CC) ${COPTS} open.c

audio$O: audio.c
	$(CC) ${COPTS} audio.c

automaton$O: automaton.c song.h channel.h
	$(CC) ${COPTS} automaton.c

getopt$O: getopt.c getopt.h
	$(CC) ${COPTS} getopt.c
getopt1$O: getopt1.c getopt.h
	$(CC) ${COPTS} getopt1.c

player$O: player.c song.h channel.h
	$(CC) ${COPTS} player.c

read$O: read.c song.h
	$(CC) ${COPTS} read.c

commands$O: commands.c channel.h song.h
	$(CC) ${COPTS} commands.c

clean:
	-rm *.u *.o tracker randomize core str.tar str.tar.Z
export:
	-rm tracker.tar.Z
	tar cvf tracker.tar *.c *.h makefile tracker.doc COPYING 
	compress tracker.tar
