src/Makefile
author Markus Bröker <mbroeker@largo.dyndns.tv>
Tue, 02 Feb 2010 13:41:48 +0100
changeset 3 a80adbcf4882
parent 2 6ee2a130dc07
child 4 be4de85337e5
permissions -rw-r--r--
Default txt2pho file committer: Markus Bröker <mbroeker@largo.homelinux.org>

###### USER CONFIG ###############
TARGET  = ../bin/vreader         #
MBROLA  = /opt/mbrola/bin/mbrola #
FESTIVAL= /usr/bin/festival      #
INSTDIR = ~/bin                  #
##### USER CONFIG ENDS ###########

     CC = gcc
MCFLAGS =  -Wall -O2 -DMBROLA $(shell sdl-config --cflags)
FCFLAGS =  -Wall -O2 -DFESTIVAL $(shell sdl-config --cflags)
PCFLAGS =  -Wall -O2 -DPROSER -DLINUX -DWINAPI="" $(shell sdl-config --cflags)
INCLUDE = -I../include
LDFLAGS = -Wl,-rpath,lib -L../lib $(shell sdl-config --libs)
  DEBUG = -g -ggdb

OBJECTS  = main.o
OBJECTS += sentence.o
OBJECTS += keyboard.o
OBJECTS += thread.o
OBJECTS += audioplayer.o
OBJECTS += proser_interface.o
OBJECTS += mbrola_interface.o
OBJECTS += festival_interface.o

.c.o:
	@if [ -f ../lib/libProserGerman.a ]; \
	then \
		$(CC) -c $(PCFLAGS) $(INCLUDE) $(DEBUG) -o $@ $<; \
	elif [ -x $(MBROLA) ]; \
	then \
		if [ ! -f /etc/txt2pho ]; \
		then \
			if [ ! -f ~/.txt2phorc ]; \
			then \
				echo "Warning: ~/.txt2phorc or /etc/txt2pho is missing"; \
			fi; \
		fi; \
		$(CC) -c $(MCFLAGS) $(INCLUDE) $(DEBUG) -o $@ $<; \
	elif [ -x $(FESTIVAL) ]; \
	then \
		$(CC) -c $(FCFLAGS) $(INCLUDE) $(DEBUG) -o $@ $<; \
	else \
		echo "Cannot find any TTS-System on your Machine"; \
		exit 1; \
	fi;
	@echo "CC $<"

all: $(TARGET)

$(TARGET): $(OBJECTS)
	@if [ -f ../lib/libProserGerman.a ]; \
	then \
		$(CC) $(OBJECTS) $(LDFLAGS) -lProserGerman -o $@; \
	else \
		$(CC) $(OBJECTS) $(LDFLAGS) -o $@; fi
	@echo "LD OBJECTS -o $@"

.PHONY: clean distclean

clean:
	@rm -f *.o *~
	@echo "CLEANING $$PWD"

distclean:
	@make clean
	@rm -f $(TARGET)
	@echo "WIPING $$PWD OUT"

install: $(TARGET)
	install -m 755 $(TARGET) $(INSTDIR)