src/Makefile
author Markus Bröker <mbroeker@largo.dyndns.tv>
Mon, 09 Sep 2013 15:54:09 +0200
changeset 4 be4de85337e5
parent 2 6ee2a130dc07
permissions -rw-r--r--
Small changes committer: Markus Bröker <mbroeker@largo.homelinux.org>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     1
###### USER CONFIG ###############
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     2
TARGET  = ../bin/vreader         #
4
be4de85337e5 Small changes
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 2
diff changeset
     3
MBROLA  = /opt/mbrola/bin/mbrolas #
0
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     4
FESTIVAL= /usr/bin/festival      #
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     5
INSTDIR = ~/bin                  #
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     6
##### USER CONFIG ENDS ###########
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     7
2
6ee2a130dc07 Common Makefile Style
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 1
diff changeset
     8
     CC = gcc
0
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     9
MCFLAGS =  -Wall -O2 -DMBROLA $(shell sdl-config --cflags)
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    10
FCFLAGS =  -Wall -O2 -DFESTIVAL $(shell sdl-config --cflags)
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    11
PCFLAGS =  -Wall -O2 -DPROSER -DLINUX -DWINAPI="" $(shell sdl-config --cflags)
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    12
INCLUDE = -I../include
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    13
LDFLAGS = -Wl,-rpath,lib -L../lib $(shell sdl-config --libs)
2
6ee2a130dc07 Common Makefile Style
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 1
diff changeset
    14
  DEBUG = -g -ggdb
6ee2a130dc07 Common Makefile Style
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 1
diff changeset
    15
6ee2a130dc07 Common Makefile Style
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 1
diff changeset
    16
OBJECTS  = main.o
6ee2a130dc07 Common Makefile Style
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 1
diff changeset
    17
OBJECTS += sentence.o
6ee2a130dc07 Common Makefile Style
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 1
diff changeset
    18
OBJECTS += keyboard.o
6ee2a130dc07 Common Makefile Style
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 1
diff changeset
    19
OBJECTS += thread.o
6ee2a130dc07 Common Makefile Style
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 1
diff changeset
    20
OBJECTS += audioplayer.o
6ee2a130dc07 Common Makefile Style
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 1
diff changeset
    21
OBJECTS += proser_interface.o
6ee2a130dc07 Common Makefile Style
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 1
diff changeset
    22
OBJECTS += mbrola_interface.o
6ee2a130dc07 Common Makefile Style
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 1
diff changeset
    23
OBJECTS += festival_interface.o
0
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    24
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    25
.c.o:
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    26
	@if [ -f ../lib/libProserGerman.a ]; \
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    27
	then \
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    28
		$(CC) -c $(PCFLAGS) $(INCLUDE) $(DEBUG) -o $@ $<; \
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    29
	elif [ -x $(MBROLA) ]; \
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    30
	then \
1
fd135abaac89 Troubleshooting:
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 0
diff changeset
    31
		if [ ! -f /etc/txt2pho ]; \
fd135abaac89 Troubleshooting:
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 0
diff changeset
    32
		then \
fd135abaac89 Troubleshooting:
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 0
diff changeset
    33
			if [ ! -f ~/.txt2phorc ]; \
fd135abaac89 Troubleshooting:
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 0
diff changeset
    34
			then \
fd135abaac89 Troubleshooting:
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 0
diff changeset
    35
				echo "Warning: ~/.txt2phorc or /etc/txt2pho is missing"; \
fd135abaac89 Troubleshooting:
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 0
diff changeset
    36
			fi; \
fd135abaac89 Troubleshooting:
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 0
diff changeset
    37
		fi; \
0
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    38
		$(CC) -c $(MCFLAGS) $(INCLUDE) $(DEBUG) -o $@ $<; \
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    39
	elif [ -x $(FESTIVAL) ]; \
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    40
	then \
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    41
		$(CC) -c $(FCFLAGS) $(INCLUDE) $(DEBUG) -o $@ $<; \
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    42
	else \
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    43
		echo "Cannot find any TTS-System on your Machine"; \
1
fd135abaac89 Troubleshooting:
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 0
diff changeset
    44
		exit 1; \
0
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    45
	fi;
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    46
	@echo "CC $<"
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    47
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    48
all: $(TARGET)
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    49
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    50
$(TARGET): $(OBJECTS)
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    51
	@if [ -f ../lib/libProserGerman.a ]; \
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    52
	then \
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    53
		$(CC) $(OBJECTS) $(LDFLAGS) -lProserGerman -o $@; \
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    54
	else \
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    55
		$(CC) $(OBJECTS) $(LDFLAGS) -o $@; fi
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    56
	@echo "LD OBJECTS -o $@"
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    57
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    58
.PHONY: clean distclean
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    59
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    60
clean:
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    61
	@rm -f *.o *~
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    62
	@echo "CLEANING $$PWD"
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    63
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    64
distclean:
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    65
	@make clean
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    66
	@rm -f $(TARGET)
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    67
	@echo "WIPING $$PWD OUT"
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    68
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    69
install: $(TARGET)
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    70
	install -m 755 $(TARGET) $(INSTDIR)