
#    Sfront, a SAOL to C translator    
#    This file: Makefile for Sfront
#    Copyright (C) 1999  Regents of the University of California
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License (Version 2) as
#    published by the Free Software Foundation.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
#    Maintainer: John Lazzaro, lazzaro@cs.berkeley.edu
#

##
## The current version and release date.
##
##             --IDSTRING--

##
## Compiler optimization and debug options. Mac OS X users 
## should replace "gcc" with "cc".
##

CC = gcc
OPT  = -O2 
DBUG = -g

##
## Machine/OS specific compiling options should be added
## to CFLAGS below.
##

CFLAGS = $(OPT) $(DBUG) 

##
## 

LIBMAKER = libmaker

OBJS = libmaker.o 

NSYS = net_sfront net_include net_globals net_siplib \
       net_rtplib net_rtcplib net_jsend net_jrecv net_crypto

PSYS =  pa_hosthdr pa_porthdr pa_tracehdr pa_lib pa_unix_oss \
	pa_win_wmme pa_dshdr pa_dswrap pa_dsound

CSRC =  runtime runtimef callback robust preamble runspt \
        tsync psync tgen 

ASYS  = aif hpux raw wav dsound linux freebsd std vcdat null irix \
	portaudio coreaudio

CSYS = ascii gliss linmidi freebsdmidi win32 alsamidi alsaseq fstr \
       coremidi

all: $(LIBMAKER)
	./libmaker -csrc $(CSRC)
	./libmaker -asys $(ASYS)
	./libmaker -csys $(CSYS)
	./libmaker -nsys $(NSYS)
	./libmaker -psys $(PSYS)
	(cd .. ; make; cd lib)

cfiles: $(LIBMAKER)
	./libmaker -csrc $(CSRC)
	./libmaker -asys $(ASYS)
	./libmaker -csys $(CSYS)
	./libmaker -nsys $(NSYS)
	./libmaker -psys $(PSYS)

$(LIBMAKER):  $(OBJS) libmaker.h
	$(CC) $(CFLAGS) $(OBJS) -o $(LIBMAKER)

do_csrc: $(LIBMAKER)
	./libmaker -csrc $(CSRC)
	(cd .. ; make; cd lib)

do_asys: $(LIBMAKER)
	./libmaker -asys $(ASYS)
	(cd .. ; make; cd lib)

do_csys: $(LIBMAKER)
	./libmaker -csys $(CSYS)
	(cd .. ; make; cd lib)

do_nsys: $(LIBMAKER)
	./libmaker -nsys $(NSYS)
	(cd .. ; make; cd lib)

do_psys: $(LIBMAKER)
	./libmaker -psys $(PSYS)
	(cd .. ; make; cd lib)

clean:
	-rm *.o $(LIBMAKER)




