File: Makefile

package info (click to toggle)
speaker 1.0.1-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 264 kB
  • ctags: 174
  • sloc: cpp: 1,521; tcl: 786; makefile: 91; sh: 22
file content (124 lines) | stat: -rw-r--r-- 3,374 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# Makefile for the speaker driver for USR Sportster
# and all other voice modems
# Author: Eugene Anikin
#
# If you have bug report or suggestion, e-mail to:
# anikin@anikin.ddns.org, put "Speaker" in subject.
#

#############################################################
# Specify your configuration:
#############################################################

# Modem port
SERIAL_PORT=/dev/modem

# Location of files for spk
DESTDIR=

CONFIG_FILE=/etc/spk.conf
SPK_DATA=/usr/lib/spk
BIN_PATH=/usr/bin
LOCK_PATH=/var/lock
RUN_PATH=/var/run/spk

#############################################################
# Nothing to be changed after this line (Unless you know
# what you are doing)
#############################################################
VERSION=1.0.1

# Your platform
PLATFORM=LINUX20
#PLATFORM=SOLARIS

#
P_DEFINES=-DCONFIG_FILE=\"$(CONFIG_FILE)\" -D$(PLATFORM)
#
CC=g++
#

# Solaris with gcc-lib 2.7.2:
#INCLFLAGS=-I/usr/local/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2/include \
#-I/usr/local/lib/g++-include -I/usr/openwin/include
# Linux:
INCLFLAGS=

# Solaris
#CFLAGS=-Wall -g -pipe $(INCLFLAGS)
# Linux
CFLAGS=-Wall -g -O2 -pipe -pedantic $(INCLFLAGS)

# Solaris with tcl7.4 and tk4.0
#LDFLAGS=-ltk4.0 -ltcl7.4 -lX11 -ldl -lm -lsocket -L/usr/X11/lib -L/usr/local/lib
# Linux
LDFLAGS=-ltk8.0 -ltcl8.0 -ldl -lm -L/usr/X11/lib

#LDFLAGS=-lprot -lsocket
#LDFLAGS=-s -shlib
#LDFLAGS=-lsocket
#LDFLAGS=-lbsd			
#LDFLAGS=-posix	
#

OBJS= smodlib.o config.o locks.o main.o commandset.o \
   cmdsequence.o tkfunc.o 
INCLUDE= Makefile smodlib.h incall.h config.h locks.h \
   commandset.h cmdsequence.h

all:	speaker

clean:
	rm -f speaker spk.conf.temp *.o

distrib:
	cd ..; tar --gzip -cvf speaker-$(VERSION).tar.gz speaker

install: speaker
	echo "SERIAL_PORT=$(SERIAL_PORT)" > spk.conf.temp
	echo "COMMAND_SET=$(SPK_DATA)/spk.cmds" >> spk.conf.temp
	echo "FIRST_ACTION_FILE=$(SPK_DATA)/config.act" >> spk.conf.temp
	echo "GSPK_LOCATION=$(SPK_DATA)/gspk" >> spk.conf.temp
	echo "COUNTER=$(SPK_DATA)/.spkcount" >> spk.conf.temp
	echo "DEFAULT_PATH=$(SPK_DATA)/vmbox" >> spk.conf.temp
	echo "LOCK_PATH=$(LOCK_PATH)" >> spk.conf.temp
	echo "RUN_PATH=$(RUN_PATH)" >> spk.conf.temp
	echo "CHECK_GSM=1" >> spk.conf.temp
	echo "TEST_LOCAL=0" >> spk.conf.temp
	echo "PORT_SPEED=38400" >> spk.conf.temp
	echo "USE_CALLER_ID=1" >> spk.conf.temp
	echo "SPK_CAPABLE=1" >> spk.conf.temp
	install -d $(DESTDIR)$(SPK_DATA)
	install -d $(DESTDIR)$(BASE_LOCATION)/etc
	install -m 0644 spk.cmds $(DESTDIR)$(SPK_DATA)/spk.cmds
	install -m 0755 gspk $(DESTDIR)$(SPK_DATA)/gspk
	install -m 0644 spk.conf.temp $(DESTDIR)$(CONFIG_FILE)
	install -m 2755 -g dialout speaker $(DESTDIR)$(BIN_PATH)/speaker

# a few C files need extra compiler arguments
tkfunc.o : tkfunc.C $(INCLUDE)
	$(CC) $(CFLAGS) $(P_DEFINES) -c tkfunc.C

smodlib.o : smodlib.C $(INCLUDE)
	$(CC) $(CFLAGS) $(P_DEFINES) -c smodlib.C

config.o : config.C $(INCLUDE)
	$(CC) $(CFLAGS) $(P_DEFINES) -c config.C

locks.o : locks.C $(INCLUDE)
	$(CC) $(CFLAGS) $(P_DEFINES) -c locks.C

commandset.o : commandset.C $(INCLUDE)
	$(CC) $(CFLAGS) $(P_DEFINES) -c commandset.C

cmdsequence.o : cmdsequence.C $(INCLUDE)
	$(CC) $(CFLAGS) $(P_DEFINES) -c cmdsequence.C

main.o : main.C $(INCLUDE)
	$(CC) $(CFLAGS) $(P_DEFINES) -c main.C

# here are the binaries...

speaker : main.C $(OBJS) 
	$(CC) -g -o speaker $(OBJS) $(LDFLAGS)