#*      Makefile
#*
#* Include file for MIDAS Module Player for Linux
#*
#* [Hacked by Petteri]
#*
#* Copyright 1996 Petteri Kangaslampi and Jarno Paananen
#*
#* This file is part of the MIDAS Sound System, and may only be
#* used, modified and distributed under the terms of the MIDAS
#* Sound System license, LICENSE.TXT. By continuing to use,
#* modify or distribute this file you indicate that you have
#* read the license and understand and accept it fully.
#*


# Destination directory for midp executable
DEST = /usr/local/bin

# MIDAS base directory:
MIDASDIR = ../..

# MIDAS library directory
LIBDIR = $(MIDASDIR)/lib

# MIDAS include directory
INCDIR = $(MIDASDIR)/src


CPP = gcc
#CPPOPTS = -O2 -fomit-frame-pointer -m486 -g -fpack-struct -funsigned-char -S -Wall -bi486-linux -D__LINUX__ -D_MIT_POSIX_THREADS -DDEBUG
#CPPOPTS = -O6 -frisc -fomit-frame-pointer -mpentium -g -fpack-struct -funsigned-char -fstrength-reduce -Wall -D__LINUX__ -D_MIT_POSIX_THREADS -DDEBUG
CPPOPTS = -O6 -frisc -fomit-frame-pointer -mpentium -fpack-struct -funsigned-char -fstrength-reduce -Wall -D__LINUX__ -DDEBUG -I$(INCDIR)
ASM = gcc
ASMOPTS = $(CPPOPTS)
LINK = gcc -Wall -O2 -fomit-frame-pointer -mpentium -L. -L$(LIBDIR) -o
LIB = ar
TOUCH = /usr/bin/touch

.SUFFIXES:
.SUFFIXES: .c .h .S .o

all :                   midp

%.o:			%.c
		$(CPP) $(CPPOPTS) -c $< -o $@

%.o:			%.S
		$(ASM) $(ASMOPTS) -c $< -o $@

midp: 		midplx.o $(LIBDIR)/libmidas.a
		$(LINK) midp midplx.o -lmidas

midplx.o :      midplx.c


clean:
		rm -f *.o *~ midp

install:	midp
		install -s midp $(DEST)

