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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
|
--- Makefile.orig Sat Dec 4 02:06:42 1999
+++ Makefile Fri May 19 17:52:28 2000
@@ -38,7 +38,7 @@
#----------------------------------------------------------------------
# If you are running a 386 you should comment this line out.
#
-CPU=-m486
+#CPU=-m486
#----------------------------------------------------------------------
# If you are experiencing troubles (like core dumps!), then uncomment
@@ -47,7 +47,7 @@
# adjust the STRIP option to suit compile mode:
#
#DEBUG=-g
-OPT=-O2
+#OPT=-O2
#----------------------------------------------------------------------
# When using 'DEBUG=-g' above, then comment out the 'strip' line:
@@ -59,7 +59,9 @@
# This parameter indicates where the program binaries should be
# placed (wavplay, wavrec, and xltwavplay)
#
-INSTDIR=/usr/local/bin
+PREFIX=/usr/local
+INSTDIR=$(PREFIX)/bin
+MANDIR=$(PREFIX)/man/man1
#----------------------------------------------------------------------
# Uncomment this line if you want to install the xltwavplay.res resource
@@ -81,14 +83,14 @@
# to disable the EDITRES facility. If you're not compiling xltwavplay
# then this setting can be left asis.
#
-#NOEDITRES=-DNO_EDITRES
+NOEDITRES=-DNO_EDITRES
#----------------------------------------------------------------------
# If you COMMENTED OUT the NOEDITRES line, then UNCOMMENT this line.
# If you UNCOMMENTED the NOEDITRES line, then COMMENT out this line.
# (ie. do the opposite of NOEDITRES)
#
-LIBXMU=-lXmu
+#LIBXMU=-lXmu
#----------------------------------------------------------------------
# These are the non X load options (for wavplay/wavrec)
@@ -106,7 +108,13 @@
# only the standard getopt() routine. When commented out, the long options like --help
# are recognized, with the help of the getopt_long() routine.
#
-#STDGETOPTS= -DUSE_GETOPT_STD
+STDGETOPTS= -DUSE_GETOPT_STD
+
+#----------------------------------------------------------------------
+#
+# Uncomment this when compiling on FreeBSD.
+
+EXTRAOPTS=-DFREEBSD -D__GNU_LIBRARY__
#----------------------------------------------------------------------
# The next option specifies the pathname that the xltwavplay X client should exec
@@ -133,7 +141,7 @@
# Environment variable DSPPATH will override this value at runtime, if
# present.
#
-#DSPPATH= -DAUDIODEV=\"/dev/dsp\"
+DSPPATH= -DAUDIODEV=\"/dev/audio\"
#----------------------------------------------------------------------
# Semaphore IPC Key for the Play & Record locks (Default is 0x33333333)
@@ -155,7 +163,7 @@
# Only for unusual sites would you change this: the name of the
# install program. (has no impact if you choose to manually install)
#
-INSTALL=install
+INSTALL=install -c
#----------------------------------------------------------------------
# If you have any custom include directories, like for X or
@@ -163,19 +171,19 @@
# this should be unecessary if the appropriate symlinks are
# installed).
#
-#CUSTINCL= -I/usr/X11R6/include/X11 -I/usr/local/lesstif/include/Xm
+#CUSTINCL= -I/usr/X11R6/include/X11 -I/usr/local/lesstif/include/Xm -I/usr/X11R6/include
#----------------------------------------------------------------------
# Normally, you shouldn't need to change anything beyond this point:
#----------------------------------------------------------------------
.SUFFIXES: .c .cc .h .o
-CUSTMOPTS=$(STDGETOPTS) $(PLAYPATH) $(DSPMIN) $(DSPMAX) $(DSPPATH) $(DSPLOCKS) $(USERES) $(NOEDITRES) $(SCHED_PRIORITY)
+CUSTMOPTS=$(STDGETOPTS) $(EXTRAOPTS) $(PLAYPATH) $(DSPMIN) $(DSPMAX) $(DSPPATH) $(DSPLOCKS) $(USERES) $(NOEDITRES) $(SCHED_PRIORITY)
ELF= # -fPIC
INCL= -I. $(CUSTINCL)
-CCFLAGS= -c $(DEBUG)$(OPT) $(CPU) $(ELF) -fhandle-exceptions $(CUSTMOPTS) -Wall -Wstrict-prototypes
-CFLAGS= -c $(DEBUG)$(OPT) $(CPU) $(ELF) -Wall -Wstrict-prototypes $(CUSTMOPTS)
-CC= gcc
+CCFLAGS+= -c $(DEBUG)$(OPT) $(CPU) $(ELF) -fhandle-exceptions $(CUSTMOPTS) -Wall -Wstrict-prototypes
+CFLAGS+= -c $(DEBUG)$(OPT) $(CPU) $(ELF) -Wall -Wstrict-prototypes $(CUSTMOPTS)
+CC?= gcc
CP= g++
HDRFIL= client.h server.h wavfile.h wavplay.h xltwavplay.h xmsprint.h
@@ -189,9 +197,9 @@
.c.o:
$(CC) $(CFLAGS) $(INCL) $<
-all: wavplay wavrec xltwavplay
+all: wavplay wavrec
-no_x: wavplay wavrec
+with_x: wavplay wavrec xltwavplay
# wavdump: $(WVDMPO)
# $(CP) $(WVDMPO) $(LDOPTS) $(DEBUG) -o wavdump -lRIFF
@@ -209,18 +217,21 @@
$(STRIP) xltwavplay
ls -l xltwavplay
-install: install_wavplay install_xltwavplay
+install: install_wavplay install_man
-install_no_x: install_wavplay
+install_with_x: install_wavplay install_xltwavplay install_man
install_wavplay: wavplay wavrec
- @[ ! -d "$(INSTDIR)" ] && echo "You do not have a directory $(INSTDIR); Check INSTDIR in make file." && exit 13 || :
- $(INSTALL) -o root -g root -m 555 wavplay $(INSTDIR)
+ mkdir -p $(INSTDIR)
+ $(INSTALL) -s -o root -g wheel -m 555 wavplay $(INSTDIR)
rm -f $(INSTDIR)/wavrec
ln $(INSTDIR)/wavplay $(INSTDIR)/wavrec
- @[ ! -z "$(SCHED_PRIORITY)" ] && echo "*** DO 'make setuid_root' IF YOU WANT REAL TIME SCHEDULING ***" || :
@echo
+install_man: wavplay.1
+ mkdir -p $(MANDIR)
+ $(INSTALL) -o root -g wheel -m 444 wavplay.1 $(MANDIR)
+
xltwavplay_test: wavplay xltwavplay
WAVPLAYPATH=./wavplay ./xltwavplay
@@ -234,9 +245,9 @@
@echo
install_xltwavplay: xltwavplay
- $(INSTALL) -o root -g root -m 555 xltwavplay $(INSTDIR)
+ $(INSTALL) -o root -g wheel -m 555 xltwavplay $(INSTDIR)
@[ ! -z "$(USERES)" ] \
- && $(INSTALL) -o root -g root -m 555 xltwavplay.res $(RESDIR)/xltwavplay \
+ && $(INSTALL) -o root -g wheel -m 555 xltwavplay.res $(RESDIR)/xltwavplay \
&& ls -dlL $(RESDIR)/xltwavplay/xltwavplay.res \
|| rm -f $(RESDIR)/xltwavplay
|