File: NetAudio.tmpl

package info (click to toggle)
nas 1.8-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 8,452 kB
  • ctags: 23,094
  • sloc: ansic: 54,190; makefile: 23,934; sh: 7,406; perl: 2,208; yacc: 244; cpp: 216; lex: 63
file content (371 lines) | stat: -rw-r--r-- 12,498 bytes parent folder | download
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
/*
 * Copyright 1993 Network Computing Devices, Inc.
 *
 * Permission to use, copy, modify, distribute, and sell this software and
 * its documentation for any purpose is hereby granted without fee, provided
 * that the above copyright notice appear in all copies and that both that
 * copyright notice and this permission notice appear in supporting
 * documentation, and that the name Network Computing Devices, Inc. not be
 * used in advertising or publicity pertaining to distribution of this 
 * software without specific, written prior permission.
 * 
 * THIS SOFTWARE IS PROVIDED `AS-IS'.  NETWORK COMPUTING DEVICES, INC.,
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT
 * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
 * PARTICULAR PURPOSE, OR NONINFRINGEMENT.  IN NO EVENT SHALL NETWORK
 * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING
 * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA,
 * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF
 * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN
 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 * 
 * $Id: NetAudio.tmpl,v 1.14 2006/06/03 20:24:03 jon Exp $
 * $NCDId: @(#)NetAudio.tmpl,v 1.28 1996/09/04 22:30:36 greg Exp $
 */

/* JET - this should be properly defined by your imake config system */

#define DoSharedLib             HasSharedLibraries
#define DoNormalLib             YES

#ifndef WIN32
#define Date @date
#define RmTree(dir)		$(RM) -r dir
#define AuPassCDebugFlags	'CDEBUGFLAGS=$(CDEBUGFLAGS)'
#define Obj(x)			x.o
#if defined(cygwinArchitecture)
# define Exe(x)			x.exe
#else
# define Exe(x)			x
#endif
#define LibPre()		lib
#define Lib(x)			LibPre()x.a
#else /* WIN32 */
#define ImakeSubCmdHelper	$(IMAKE_CMD)
#define Date
#define RmTree(dir)		RmTreeCmd dir
#define AuPassCDebugFlags
#define Obj(x)			x.obj
#define Exe(x)			x.exe
#define LibPre()
#define Lib(x)			LibPre()x.lib
EXTRA_LOAD_FLAGS=/link /nodefaultlib:libc /*/force:multiple /debug:full /debugtype:cv /pdb:none */
/* CDEBUGFLAGS=/Zi */
#endif /* WIN32 */

#define DebugLibX		NO
#define ProfileLibX		NO

#if HasSharedLibraries
#define NormalLibAudio          NormalLibX
#define SharedLibAudio          SharedLibX
#define DebugLibAudio           DebugLibX
#define ProfileLibAudio         ProfileLibX
#else
#ifndef WIN32
#define NormalLibAudio		YES
#define SharedLibAudio		NO
#else /* WIN32 */
#define NormalLibAudio		NO
#define SharedLibAudio		YES
#endif /* WIN32 */
#define DebugLibAudio		NO
#define ProfileLibAudio		NO
#endif

/*
 * Enable the next line if <NetAudio.tmpl> and audio include files/libraries
 * are installed for normal use via installed imake or xmkmf into the 
 * installed X11 area.  
 */
#if 0
#define AuUseInstalled YES
#endif

/*
 * _AuUse - makes a choice based on AuUseInstalled.
 */
#ifndef _AuUse
#ifdef AuUseInstalled
#define _AuUse(a,b) a
#else
#define _AuUse(a,b) b
#endif
#endif

/*
 * _AuUseCat - combination of _AuUse and Concat.
 *           exists to avoid problems with some preprocessors
 */
#ifndef _AuUseCat
#if defined(__STDC__) && !defined(UnixCpp)
#ifdef AuUseInstalled
#define _AuUseCat(a,b,c) a##c
#else
#define _AuUseCat(a,b,c) b##c
#endif
#else
#ifdef AuUseInstalled
#define _AuUseCat(a,b,c) a/**/c
#else
#define _AuUseCat(a,b,c) b/**/c
#endif
#endif
#endif

#ifndef SharedAudioRev
#define SharedAudioRev 2.4
#endif

         AUSRC = $(TOP)/lib/audio
    SOAUDIOREV = SharedAudioRev

#if SharedLibAudio && !defined(WIN32)
/*
 * Shared library support is unfortunatly different on every machine
 */
/* 
 * If not AuUseInstalled, search audio source area before installed area.
 * That way, the binary will use the source area library if invoked
 * from the source area for testing, and the installed version
 * if invoked elsewhere.
 */

#ifdef SunArchitecture
      DEPAULIB = 
#if SystemV4	/* Solaris 2 */
/* 
 * Solaris 2.3 standard imake config files omits the -R$(USRLIBDIR) option, so 
 * supplying it here helps ease installation on such systems.
 */
 LOCAL_LDFLAGS = _AuUse(-L$(USRLIBDIR) -R$(USRLIBDIR), -L$(AUSRC) -R$(AUSRC) -L$(USRLIBDIR) -R$(USRLIBDIR))
         AULIB = -laudio
#else		/* SunOS 4 */
 LOCAL_LDFLAGS = _AuUse(-L$(USRLIBDIR), -L$(AUSRC) -L$(USRLIBDIR))
         AULIB = -laudio
#endif
#else /* SunArchitecture */

/* place #ifdef's for other architectures around these lines */
 LOCAL_LDFLAGS = _AuUse(-L$(USRLIBDIR), -L$(AUSRC) -L$(USRLIBDIR))
      DEPAULIB =
         AULIB = -laudio

#endif /* SunArchitecture */


#else /* SharedLibAudio */
 LOCAL_LDFLAGS =
      DEPAULIB = _AuUseCat($(USRLIBDIR),$(AUSRC),/Lib(audio))
         AULIB = LoaderLibPrefix _AuUse(-laudio,$(DEPAULIB))
#endif /* SharedLibAudio */

  AUDIODEPLIBS = $(DEPAULIB) $(DEPXTOOLLIB) $(DEPXLIB)
#ifndef WIN32
     AUDIOLIBS = $(AULIB) $(XTOOLLIB) $(XLIB) -lm
#else /* WIN32 */
     AUDIOLIBS = $(AULIB)
#endif /* WIN32 */
  BUILDINCROOT = $(TOP)/include
   BUILDINCDIR = $(BUILDINCROOT)
   BUILDINCTOP = ..
EXTRA_INCLUDES = -I$(BUILDINCROOT)
    INCLUDESRC = $(TOP)/include
        INCDIR = $(INCROOT)/audio
    WIDGET_DIR = $(TOP)/clients/audio/widgets
    WIDGET_LIB = $(WIDGET_DIR)/Lib(widgets)
    WIDGET_INC = -I$(WIDGET_DIR)


#if ProjectX < 5 	/* override search order for X11R4 */
   ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(TOP_INCLUDES) $(STD_INCLUDES)
     LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS) $(EXTRA_LDOPTIONS) $(LOCAL_LDFLAGS)

#ifndef XCOMM
#define XCOMM #
#endif
#endif

/* For HPUX - 10.20 (Klaus Dittrich)*/
#if defined(HPUXArchitecture) && OSMajorVersion >= 10 && !defined(HasGcc)
/* JET - this seems pretty system specific... */
CCOPTIONS= -Ae -Dhpux 
CDEBUGFLAGS= +O2 +Onolimit +DAportable
BINDIR = /usr/local/bin/ 
USRLIBDIR=/usr/local/lib/nas
XAPPLOADDIR = /usr/local/lib/X11/app-defaults
STD_INCLUDES = -I/usr/local/include/X11R6 -I/usr/include/X11R6
EXTRA_LDOPTIONS =  -L/usr/local/lib/X11R6 -L/usr/lib/X11R6
INCROOT = /usr/local/include/nas
IRULESRC=/opt/imake/config/
#endif

#if SystemV4 && !defined(SGIArchitecture) && !defined(SunArchitecture) && !defined(LabtamArchitecture)

# if defined(USLArchitecture) 
      SYSLIBS = -lresolv -lgen -lsocket
# else 
      SYSLIBS = -lc /usr/ucblib/libucb.a 
# endif
#endif

/*
 * Rules
 */

#ifndef WIN32
#define	AuInstallScript(program,dest)					    @@\
install:: program							    @@\
	MakeDir($(DESTDIR)dest)						    @@\
	$(INSTALL) -c $(INSTBINFLAGS) program $(DESTDIR)dest/program
#else /* WIN32 */
#define	AuInstallScript(program,dest)					    @@\
InstallNamedTarget(install,program,NullParameter,dest,program)
#endif /* WIN32 */

#define	AuInstallManPage(file,destdir) AuInstallManPageLong(file,destdir,file)

#define	AuInstallManPageLong(file,destdir,dest)				    @@\
install.man:: file.man							    @@\
	@(rel=`cat $(TOP)/RELEASE | \				     	    @@\
	  sed 's/Network Audio System Release //'`; \			    @@\
	  sed -f $(TOP)/config/mungeman \				    @@\
	       -e "s/_RELEASE_/$$rel/" < file.man > wibble.man; mv -f file.man tmp.man ; mv -f wibble.man file.man)                                        @@\
	InstallManPageLong(file,destdir,dest)                               @@\
	mv -f tmp.man file.man


#define SingleAudioProgram(program)					    @@\
	InstallProgram(program,$(BINDIR))				    @@\
	AuInstallManPage(program,$(MANDIR))				    @@\
	SingleProgramTarget(program, program.o, $(AUDIOLIBS), $(SYSLIBS))

#define SimpleAudioProgram(program)					    @@\
	AudioProgram(program, program.c, Obj(program))

#define	AuComplexProgramTarget(program)					    @@\
        PROGRAM = program						    @@\
									    @@\
AllTarget(Exe(program))							    @@\
									    @@\
Exe(program): $(OBJS) $(DEPLIBS)					    @@\
	RemoveTargetProgram($@)						    @@\
	$(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS) @@\
									    @@\
InstallProgram(program,$(BINDIR))					    @@\
AuInstallManPage(program,$(MANDIR))					    @@\
DependTarget()								    @@\
LintTarget()								    @@\
									    @@\
clean::									    @@\
	$(RM) $(PROGRAM)

#define AudioProgram(program, srcs, objs)				    @@\
        DEPLIBS = $(AUDIODEPLIBS)					    @@\
LOCAL_LIBRARIES = $(AUDIOLIBS)						    @@\
  SYS_LIBRARIES = $(SYSLIBS) 						    @@\
           SRCS = srcs							    @@\
           OBJS = objs							    @@\
									    @@\
AuComplexProgramTarget(program)

#define SimpleAudioXtProgram(program)					    @@\
	AudioXtProgram(program, program.c, Obj(program))

#define AudioXtProgram(program, srcs, objs)				    @@\
        DEPLIBS = $(AUDIODEPLIBS) $(WIDGET_LIB) XawClientDepLibs	    @@\
LOCAL_LIBRARIES = $(AUDIOLIBS) $(WIDGET_LIB) XawClientLibs		    @@\
  SYS_LIBRARIES = $(SYSLIBS) 						    @@\
       INCLUDES = $(WIDGET_INC)						    @@\
           SRCS = srcs							    @@\
           OBJS = objs							    @@\
									    @@\
AuComplexProgramTarget(program)

#ifndef WIN32
#define BuildReleaseHeader()						    @@\
release.h: $(TOP)/RELEASE				    		    @@\
	@echo "static char *release = \"@(#)`cat $(TOP)/RELEASE`\";" > $@   @@\
						    			    @@\
depend:: release.h				    			    @@\
						    			    @@\
clean::			    			    			    @@\
	$(RM) release.h
#else /* WIN32 */
#define BuildReleaseHeader()						    @@\
release.h: $(TOP)/RELEASE				    		    @@\
	@echo static char *release = "Windows NT"; > $@   		    @@\
						    			    @@\
depend:: release.h				    			    @@\
						    			    @@\
clean::			    			    			    @@\
	$(RM) release.h
#endif /* WIN32 */


/* Some useful rules for those missing them */
#ifndef YaccFile
#define YaccFile(file,flags)                                            @@\
depend:: file.c                                                         @@\
                                                                        @@\
file.h file.c: file.y                                                   @@\
        ClearmakeOSName \
        $(YACC) flags file.y                                            @@\
        $(MV) y.tab.c file.c                                            @@\
        @if [ -f y.tab.h ]; then set -x; $(MV) y.tab.h file.h; \        @@\
        else exit 0; fi                                                 @@\
                                                                        @@\
clean::                                                                 @@\
        RemoveFiles(y.tab.c y.tab.h file.h file.c)
#endif /* YaccFile */

#ifndef YaccFileNoFlags
#define YaccFileNoFlags(file)                                           @@\
depend:: file.c                                                         @@\
                                                                        @@\
file.c: file.y                                                          @@\
        ClearmakeOSName \
        $(YACC) file.y                                                  @@\
        $(MV) y.tab.c file.c                                            @@\
                                                                        @@\
clean::                                                                 @@\
        RemoveFiles(y.tab.c file.c)
#endif /* YaccFileNoFlags */

#ifndef LexFileExplicit
#if HasClearmake                /* provide a place to hang ClearmakeOSName */
#define LexFileExplicit(file)                                           @@\
file.c: file.l                                                          @@\
        ClearmakeOSName \
        $(LEX) $(LFLAGS) file.l                                         @@\
        $(MV) lex.yy.c file.c
#else
#define LexFileExplicit(file) /* the default rule is fine */
#endif
#endif

#ifndef LexFile
#define LexFile(file)                                                   @@\
LexFileExplicit(file)                                                   @@\
                                                                        @@\
depend:: file.c                                                         @@\
                                                                        @@\
clean::                                                                 @@\
        RemoveFiles(lex.yy.c file.c)
#endif /* LexFile */

#ifndef RemoveFile
#define RemoveFile(file) $(RM) file
#endif /* RemoveFile */

#ifndef RemoveFiles
#define RemoveFiles(files) $(RM) files
#endif /* RemoveFiles */

#ifndef ClearmakeOSName
# if HasClearmake
#  define ClearmakeOSName @ XCOMM $(OSNAME) @@
# else
#  define ClearmakeOSName /**/
# endif
#endif