src/Makefile
author Markus Bröker <mbroeker@largo.dyndns.tv>
Sat, 13 Dec 2008 15:56:39 +0100
changeset 0 06dd3b8d90ad
child 1 fd135abaac89
permissions -rw-r--r--
Virtual Reader 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 \
	sentence.o \
	keyboard.o \
	thread.o \
	audioplayer.o \
	proser_interface.o \
	mbrola_interface.o \
	festival_interface.o

.c.o:
	@if [ -f ../lib/libProserGerman.a ]; \
	then \
		$(CC) -c $(PCFLAGS) $(INCLUDE) $(DEBUG) -o $@ $<; \
	elif [ -x $(MBROLA) ]; \
	then \
		$(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"; \
	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)