1 2 3# Sfront, a SAOL to C translator 4# This file: Makefile for an sfront example 5# 6# Copyright (c) 2000-2006, Regents of the University of California 7# All rights reserved. 8# 9# Redistribution and use in source and binary forms, with or without 10# modification, are permitted provided that the following conditions are 11# met: 12# 13# Redistributions of source code must retain the above copyright 14# notice, this list of conditions and the following disclaimer. 15# 16# Redistributions in binary form must reproduce the above copyright 17# notice, this list of conditions and the following disclaimer in the 18# documentation and/or other materials provided with the distribution. 19# 20# Neither the name of the University of California, Berkeley nor the 21# names of its contributors may be used to endorse or promote products 22# derived from this software without specific prior written permission. 23# 24# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35# 36# Maintainer: John Lazzaro, lazzaro@cs.berkeley.edu 37 38 39FILENAME = linvoc 40 41SAOLFILE = $(FILENAME).saol 42SASLFILE = $(FILENAME).sasl 43MP4FILE = $(FILENAME).mp4 44 45INFILE = 46OUTFILE = all 47 48CC = gcc 49OPT = -O3 50CFLAGS = $(OPT) 51SFRONT = sfront 52 53OUTMODE = -latency 0.002 -aout linux 54INMODE = -ain linux 55CNMODE = -cin linmidi 56 57## for INFILE/OUTFILE selections that need libraries 58 59IOLINK = 60 61## for INFILE/OUTFILE std selection: > foo < bar 62 63REDIRECT = 64 65## 66## makes a raw 16-bit signed integer audio file 67## 68 69$(OUTFILE): $(SAOLFILE) 70 $(SFRONT) $(OUTMODE) $(INMODE) $(CNMODE) -orc $(SAOLFILE) -sco $(SASLFILE) 71 $(CC) $(CFLAGS) sa.c -lm $(IOLINK) -o sa 72 ./sa $(REDIRECT) 73 74## tests bitstream creation code, by creating an MP4 file, decoding 75## it, and comparing audio out with audio created by original ASCII 76## files. doesn't work with stdin/stdout. 77 78mp4test : $(OUTFILE) 79 rm -rf $(MP4FILE) sa.c 80 mv $(OUTFILE) safe 81 $(SFRONT) -symtab -orc $(SAOLFILE) -bitout $(MP4FILE) 82 $(SFRONT) $(OUTMODE) $(INMODE) -bit $(MP4FILE) 83 $(CC) $(CFLAGS) sa.c -lm $(IOLINK) -o sa 84 ./sa $(REDIRECT) 85 cmp $(OUTFILE) safe 86 87## tests a new sfront against an old one. assume safe is the audio 88## created by old sfront. 89 90compare : $(OUTFILE) 91 cmp $(OUTFILE) safe 92 93safe : $(OUTFILE) 94 cp $(OUTFILE) safe 95 96## for performance testing 97## 98 99timing : 100 ./sa $(REDIRECT) 101 102## 103## 104## 105 106## only works on HPUX, for WAV files 107 108play : $(OUTFILE) 109 splayer $(OUTFILE) 110 111clean: 112 rm -rf sa.c sa audio a*.wav $(MP4FILE) $(OUTFILE) *.info *~ safe 113 114 115 116