# Sound server
#
# (c)2001 Dan Potter
#
# $Id$

PROG = sndserver
OBJS = main.o sndmp3.o sndstream.o sfxmgr.o

all: $(PROG).klf

include $(KALLISTIBASE)/Makefile.globals
include $(KALLISTIBASE)/Makefile.rules

INCS = -I$(KALLISTIBASE)/userland/include -Ixingmp3 -Wall
LIBS = -Lxingmp3 -lxingmp3 -lm -lk -lgcc

# First one checks for missing symbols, second one makes the real file
$(PROG).klf: $(OBJS)
	$(CC) -ml -m4-single-only -O2 -g -e _ko_main -nostartfiles -nostdlib -o $(PROG).klf $(OBJS)  -L$(KALLISTIBASE)/userland/lib -lk -lgcc $(LIBS)
	$(CC) -ml -m4-single-only -O2 -Wl,-d -Wl,-r -Wl,-S -Wl,-x -nostartfiles -nostdlib -o $(PROG).klf $(OBJS) -L$(KALLISTIBASE)/userland/lib -lk -lgcc $(LIBS)
	-cp $(PROG).klf ../romdisk_boot/sndserver/

clean:
	-rm -f *.bck *.o *.klf

#run:
#	cd $(KALLISTIBASE); $(MAKE) all run
run:
	cp sndserver.klf ../launcher/romdisk_boot/
	$(MAKE) -C ../launcher all run


