#								Csound Makefile
# edit the following definitions according to need:

INCLUDE	= /usr/local/include
LIB	= /usr/local/lib
DEST	= /usr/local/bin
MAN	= /usr/local/man
MAN1	= $(MAN)/man1
CAT1	= $(MAN)/cat1
# these directories must exist for stages beyond 'make csound'

CDEP =
COBS =	$(COBJS)
CC = cc
# choose either -
#	CDEP =			for UNIX
#	COBS = $(COBJS)
#	CC = cc
# or -
#	CDEP = $(CRFILE)	for MSDOS
#	COBS = @$(CDEP)
#	CC = gcc
#	.c.o:
#		$(CC) $(CFLAGS) -c $*.c -o $@

DEFINES = -DWINDOWS -DRTAUDIO -DSFIRCAM -DSYS5 -DLINUX -DPIPES -DMACROS
# choose any of -
#	-DSYS5	    invoke System 5 headers (e.g. 'string.h' for 'strings.h')
#	-DWINDOWS   include window system calls (X11, SGI, or FG graphics)
#	-DRTAUDIO   include real-time sound i/o via DEC or other audio-board
#	-DDOSGCC    for PC, if above defined CC = gcc compiler under MSDOS
#	-DHPUX -D_HPUX_SOURCE	for HP compilation under HP Unix
#	-DPIPES     if system supports popen and pclose calls
# at most one of -
#	-DSFIRCAM   read/write IRCAM-format soundfiles, with 1024-byte header;
#	-DSFSUN41   read/write SUN4.1-format soundfiles, with their own header;
#	-DNeXT      read/write NeXT-format soundfiles, with their own header;
#			(else read/write sound with no headers)
# and at most one of -
#	-DDEC		send rtaudio calls to DEC audio device handler
#	-DSGI		send rtaudio calls to SGI audio device handler
#	-Dsun		send rtaudio calls to sun audio device handler
#	-Dsol		send rtaudio calls to solaris audio handler
#	-DHP		send rtaudio calls to HP  audio device handler
#	-DLINUX		send rtaudio calls to Linux audio device handler
# Defining LINUX also enables an additional command-line option (-V <volume>)
# and includes an extra header in 'midirecv.c'.
# If LINUX is defined, but the target is Linux on a big-endian architecture
# (e.g., Linux on SPARC [not tested]), you should also define -
#       -DLINUX_BE      Linux audio device handler for big-endian samples
# Be sure to include 'LINUXaudio.o' under 'AUDOBJ' below as well.
#                                  --  Jonathan Mohr  1995 Oct 17

CFLAGS = -g $(DEFINES) -I../..
#	-O		Simple optimisation
#	-O2		to be more specific about the optimization level
#	-f		compile single-precision floats (4.3,VAX,DEC-RISC)
# 	-fsingle	as above, for SUN Unix
# 	-float -cckr 	as above, for SGI Unix
#	-f68881		employ the 68881 co-processor
#	-ffpa		employ the SUN fl-pt accelerator
#	-f -DWITHx87	for PC with 80x87 floating-point coprocessor
#	-w -D__STDC__	for PC
#	-Aa		for HP to invoke ANSI C compiler
#	+e		for HPUX rtaudio compilation
#	+x		generate HP inline 68020 and 68881 code
#	+Nd1200		expand SYS5 pass3 tablesize
#	-DWITHx87	for fpt chip on LINUX
#	-I/usr/demo/SOUND		to find SUN4.1 audio includes
#	-I/usr/include/X11R4		to find HP X11 includes, v.4
#	-I/usr/include/sys		to find NeXT malloc.h
#	-I/usr/openwin/include		Solaris openwin interface
#	-I/usr/demo/SOUND/include	Solaris sound interface

LIBS =	-L /usr/X11R6/lib -lX11 -lm -lbsd
#	-lefence
#	-lm		    		required
#	-lX11				for X window calls
#	-L/usr/lib/X11R4		for HP X11 library, v.4
#	-L$(newlib)			for other special access
#	-lfm_s -lgl_s 			for SGI graphics library
#	fgp.lib				for PC FlashGraphics lib
#	-l881				tell -lm to use 68881
#	-laudio				on SUN, for SFSUN41
#	-laudio				on SGI, to include rt devaudio library
#	-lAlib				on HP, to include rt devaudio library
#	-lmidi				on NeXT, to find the midi support
#	-lbsd				on LINUX
#	-L/usr/demo/SOUND/lib		on Solaris 2.4
#	-L/usr/X11R6/li			on LINUX

# do not edit below this line
# --------------------------------------------------------------------------

SHELL = /bin/sh
T = ../..

CSRC =	dnoise.c fft.c

COBJS =	filopen.o sfheader.o \
	soundin.o $T/getstring.o $T/ulaw.o wave.o $T/aiff.o $T/ieee80.o \
	$T/memalloc.o $T/aifc.o fft.o

HDRS =  

PROGS   = dnoise dnoise_f

all:		$(PROGS)

dnoise:		$(COBJS) dnoise.o 
		$(CC) $(CFLAGS) -o dnoise dnoise.o $(COBJS) $(LIBS)

dnoise_f:	$(COBJS) dnoise-safe.o 
		$(CC) $(CFLAGS) -o dnoise_f dnoise-safe.o $(COBJS) $(LIBS)


TAGS:	$(CSRCS) $(HDRS)
		etags $(CSRCS) $(HDRS)

.c.o:
	$(CC) $(CFLAGS) -c $*.c

install:	$(PROGS)
		-strip $(PROGS)
		-rm $(DEST)/dnoise
		cp $(PROGS) $(DEST)

clean:
		-rm $(COBS)

rmbak:
		-rm *.bak *~

depend:
	gcc -M $(DEFINES) $(CSRCS) > deps
	cat Makefile deps > makefile

# DO NOT DELETE THIS LINE
