# sod2, a player for polychannel .csf music files.
# Copyright (C) 1995 Russell Marks. See sod2.c for license details.
#
# Based on `sodman' by Graham Richards.
#
#
# Makefile - makefile for sod2

# Notes
# -----
#
# You need an ANSI C compiler to compile sod2. Use one which permits
# using the 'inline' keyword to mark functions which should be
# inlined, if possible.
#
# If you don't have an ANSI C compiler, consider installing gcc, the
# GNU C compiler. It's portable, and free. Look on prep.ai.mit.edu or
# a site which mirrors it.
#
# If you're using MS-DOS, compile with djgpp. I think this is also on
# prep.ai.mit.edu. It's a DOS port of gcc.


# Compile-time settings
# ---------------------
#
# _ALLOW_INLINE : comment this out if your compiler doesn't like the
#                 'inline' keyword.
INLINE_FLAG = -D_ALLOW_INLINE

# _ALLOW_BUFFERING : comment this out if you're not using Linux.
BUF_FLAG = -D_ALLOW_BUFFERING


# settings for gcc.
CC=gcc
CFLAGS=-O2 -fomit-frame-pointer $(INLINE_FLAG) $(BUF_FLAG)

# settings for generic ANSI C compiler. Comment out the lines above if
# you use this.
#CFLAGS=-O $(INLINE_FLAG) $(BUF_FLAG)

# directory to install the 'sod2' binary in
BINDIR=/usr/local/bin

# directory in which to install 'sod2.1', the sod2 man page
MANDIR1=/usr/man/man1

# directory in which to install 'csf.5', the csf file format man page
MANDIR5=/usr/man/man5

# ------------- don't edit anything below this line --------------

VERSION=1.0

OBJS = sod2.o grokfile.o tarfile.o

all: sod2

sod2: $(OBJS)
	$(CC) $(CFLAGS) -o sod2 $(OBJS) -lm

install: all
	install -m 511 -s sod2 csf2tar	$(BINDIR)
	install -m 444 sod2.1	$(MANDIR1)
	install -m 444 csf.5	$(MANDIR5)

clean:
	$(RM) *.o *~ sod2

tar:
	cd ..;tar -cvf - sod2 | gzip >$(HOME)/sod2-$(VERSION).tar.gz

# Dependancies

grokfile.o : grokfile.c sod2.h config.h tarfile.h 
sod2.o : sod2.c sod2.h config.h grokfile.h 
tarfile.o : tarfile.c sod2.h config.h tarfile.h 
