CC := vc +aosppc
AS := ppc-amigaos-as
RM := rm -f
CP := cp -p --remove-destination
MV := mv

CFLAGS := -O3 -I. -Iinclude #-DDEBUG
ASFLAGS := -mregnames
LINK := -final
LIBS := 

TARGET := cdplayer.library
VERSION := 52

OBJS := init.o cdplayer_68k.o main/CDEject.o main/CDPlay.o main/CDResume.o \
	main/CDStop.o main/CDJump.o main/CDActive.o main/CDCurrentTitle.o \
	main/CDTitleTime.o main/CDGetVolume.o main/CDSetVolume.o \
	main/CDReadTOC.o main/CDInfo.o main/CDPlayAddr.o cdplayer_private.o
RELEASEDIR := ../

all: $(TARGET) examples/simple_play

$(TARGET): $(OBJS)
	$(CC) $(LINK) -nostdlib -o $@ $^ $(LIBS)

init.o: $(TARGET)_rev.h
$(OBJS): cdplayer_private.h

examples/simple_play: examples/simple_play.o
	$(CC) $(LINK) -o $@ $^ $(LIBS)

examples/simple_play.o: CFLAGS += -D__USE_INLINE__

.PHONY: install clean dist revision

install: $(TARGET)
	$(CP) $(TARGET) LIBS:

clean:
	$(RM) $(TARGET) examples/simple_play $(OBJS) examples/simple_play.o

dist: $(TARGET)
	$(CP) $(TARGET) $(RELEASEDIR)

revision:
	bumprev $(VERSION) $(TARGET)
