SYSTEM := $(shell uname -s)
CC := ppc-amigaos-gcc
STRIP := ppc-amigaos-strip
RM := rm -f

CFLAGS := -O2 -g -Wall -Werror -I../include -DWORDS_BIGENDIAN
LDFLAGS :=
LIBS := -lflite_cmu_us_kal16 -lflite_usenglish -lflite_cmulex -lflite

TARGET := flite.device
VERSION := 52

OBJS := init.o io.o unit.o

.PHONY: all
all: ../$(TARGET) ../Say

../$(TARGET): $(TARGET).debug
	$(STRIP) -R.comment -o $@ $<

$(TARGET).debug: $(OBJS)
	$(CC) -nostartfiles $(LDFLAGS) -o $@ $^ $(LIBS)

init.o: $(TARGET)_rev.h

../Say: Say.debug
	$(STRIP) -R.comment -o $@ $<

Say.debug: say.o
	$(CC) $(LDFLAGS) -o $@ $^

ifeq ($(SYSTEM),AmigaOS)
.PHONY: install
install: $(TARGET)
	copy $(TARGET) DEVS:
endif

.PHONY: clean
clean:
	$(RM) *.debug *.o

.PHONY: revision
revision:
	bumprev $(VERSION) $(TARGET)

