summaryrefslogtreecommitdiffstats
path: root/src/config/Project.tmpl
blob: 2364510084785a65ea7786c6309073c826a88b51 (plain)
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
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
/**/# Kerberos version 5 Build Parameters
/**/#
/**/# $Source$
/**/# $Author$
/**/# $Id$

#define ProjectKRB		5

#ifndef TouchCmd
#define TouchCmd touch
#endif
#ifndef UnifdefCmd
#define UnifdefCmd unifdef
#endif
#ifndef CompileEtCmd
#define CompileEtCmd compile_et
#endif
#ifndef MkCmdsCmd
#define MkCmdsCmd mk_cmds
#endif
#ifndef DependCmd
#define DependCmd makedepend		/* assume BINDIR in path */
#endif
#ifndef ImakeCmd
#define ImakeCmd imake			/* assume BINDIR in path */
#endif
#ifndef SSLib
#define SSLib -lss
#endif
#ifndef ComErrLib
#define ComErrLib -lcom_err
#endif
#ifndef PepsyFlags
#define PepsyFlags -f -h0 -a -s -C
/* -h2 breaks pepsy, ARRGH! */
#endif
#ifndef PepsyCmd
#define PepsyCmd pepsy
#endif
#ifndef IsodeLib
#define	IsodeLib -lisode
#endif
#ifndef ArAddCmd
#define ArAddCmd ar cruv
#endif
#ifndef Krb4LibList
#define Krb4LibList -lkrb $(KLIBLOC) -l$(DES425LIB)
#endif
#ifndef Krb4DepList
#define Krb4DepList $(DES425DEPLIB)
#endif
#ifndef Krb4Includes
#define Krb4Includes -I$(TOP)/include/kerberosIV
#endif
#ifndef ExtraIncludes
#define ExtraIncludes /**/
#endif
#ifndef HesiodDefines
#define HesiodDefines /**/
#endif
#ifndef HesiodLibs
#define HesiodLibs /**/
#endif
#if 0
#ifndef ZephyrDefines
#define ZephyrDefines /**/
#endif
#ifndef ZephyrLibs
#define ZephyrLibs /**/
#endif
#endif
#ifndef DesDefines
#define DesDefines YouMustFigureOutYourDesDefines
#endif
#ifndef Krb5Root
#define Krb5Root	/krb5
#endif

#ifndef PepsyTarget
#define	PepsyTarget(basename)						@@\
.SUFFIXES:	.py							@@\
basename/**/_defs.h basename/**/_pre_defs.h basename-types.h basename/**/_tables.c: basename-asn.py					@@\
	@echo '***Ignore the warning message "Warning: Can'\''t find UNIV.ph failed"' @@\
	$(PEPSY) $(PSYFLAGS) basename-asn.py
#endif /* PepsyTarget */

#ifndef ErrorTableObjectRule

#define ErrorTableObjectRule()						@@\
.SUFFIXES: .et .h .c							@@\
									@@\
.et.h: 									@@\
	$(COMPILE_ET) $*.et						@@\
									@@\
.et.c: 									@@\
	$(COMPILE_ET) $*.et

#endif

#ifndef CmdTableObjectRule

#define CmdTableObjectRule()						@@\
.SUFFIXES: .ct								@@\
									@@\
.ct.c: 									@@\
	$(MK_CMDS) $*.ct

#endif

#ifdef LibraryRules
#include LibraryRules
#endif

/*
 * AdditiveLibraryTarget - generate rules to create a library from
 * several directories
 */
#ifndef AdditiveLibraryTarget
#define	AdditiveLibraryTarget(libname,objlist)				@@\
AllTarget(lib/**/libname.a)						@@\
AllTarget(foo/**/libname)						@@\
DependTarget()								@@\
									@@\
foo/**/libname: objlist							@@\
	$(ARADD) lib/**/libname.a objlist				@@\
	$(TOUCH) foo/**/libname						@@\
lib/**/libname.a: foo/**/libname					@@\
	$(RANLIB) $@							@@\
clean::									@@\
	$(RM_CMD) foo/**/libname lib/**/libname.a
#endif /* AdditiveLibraryTarget */

#ifndef RanlibLibraryTarget
#define	RanlibLibraryTarget(libname)					@@\
AllTarget(lib/**/libname.a)						@@\
foo2/**/libname: foo/**/libname						@@\
	$(TOUCH) $@							@@\
lib/**/libname.a: foo2/**/libname					@@\
	$(RANLIB) $@							@@\
clean::									@@\
	$(RM_CMD) foo/**/libname foo2/**/libname lib/**/libname.a
#endif

/*
 * OtherdirLibraryTarget - generate rules to create a library in another
 * directory from object files here
 */
#ifndef OtherdirLibraryTarget
#define	OtherdirLibraryTarget(libdir,libname,objlist)			@@\
AllTarget(objlist)							@@\
AllTarget(libdir/lib/**/libname.a)					@@\
AllTarget(foo/**/libname)						@@\
									@@\
foo/**/libname: objlist							@@\
	$(ARADD) libdir/lib/**/libname.a objlist			@@\
	$(TOUCH) libdir/foo/**/libname					@@\
	$(TOUCH) foo/**/libname						@@\
libdir/lib/**/libname.a:						@@\
	$(ARADD) $@ objlist						@@\
	$(TOUCH) foo/**/libname						@@\
	$(TOUCH) libdir/foo/**/libname
/* The $(RANLIB) is done at the end by the directory itself */
#endif /* OtherdirLibraryTarget */

/*
 * CopyHeader - generate rule to copy a generated header file to an include
 * tree.
 */
#ifndef CopyHeaderNewName
#define CopyHeaderNewName(hfile,hdir,newname)				@@\
includes:: hfile							@@\
	-if cmp hfile hdir/newname >/dev/null 2>&1; then \		@@\
		echo ; \						@@\
	else \								@@\
		$(RM) hdir/newname ; \					@@\
		$(CP) hfile hdir/newname; \				@@\
	fi
#endif /* CopyHeaderNewName */

#ifndef CopyHeader
#define CopyHeader(hfile,hdir) CopyHeaderNewName(hfile,hdir,hfile)
#endif /* CopyHeader */

/* Run a header through a preprocessor to generate an architecture/environment
   specific header file.  note that unifdef's exit status will normally be 1,
   indicating some adjustment of the file took place. */
#ifndef ProcessStockHeader
#define ProcessStockHeader(stockname,newname)				@@\
newname: stockname Makefile						@@\
	-$(RM) newname.new						@@\
	-$(UNIFDEF) $(PROCESS_DEFINES) stockname >newname.new		@@\
	if cmp -s newname.new newname ; then true; \			@@\
	else $(RM) newname ; $(CP) newname.new newname ; fi
#endif /* ProcessStockHeader */

/*
 * Krb5LibraryTarget - generate rules to create a library, and link to it
 * in the library dir
 */
#ifndef Krb5LibraryTarget
#define	Krb5LibraryTarget(libname,objlist)				@@\
AllTarget(lib/**/libname.a)						@@\
DependTarget()								@@\
									@@\
lib/**/libname.a: objlist						@@\
	$(RM) $@							@@\
	$(AR) $@ objlist						@@\
	$(RANLIB) $@							@@\
	$(RM) $(TOPLIBD)/lib/**/libname.a				@@\
	$(LN) ../$(CURRENT_DIR)/lib/**/libname.a $(TOP)/lib/lib/**/libname.a
#endif /* Krb5LibraryTarget */

#ifndef Krb5InstallLibrary
#define	Krb5InstallLibrary(libname,destdir)				@@\
install:: lib/**/libname.a						@@\
	$(RM) destdir/lib/**/libname.a					@@\
	$(CP) lib/**/libname.a destdir/lib/**/libname.a
#endif

#ifndef Krb5InstallHeaders
#define	Krb5InstallHeaders(headers,destdir)				@@\
install:: headers							@@\
	@set -x; for f in headers ; \					@@\
	do $(INSTALL) -c $(INSTDATFLAGS) $$f destdir/$$f ; \		@@\
	done
#endif

/*
 * Krb5InstallManPage - generate rules to install the indicated manual page,
 * giving it an alternate suffix.
 */
#ifndef Krb5InstallManPage
#define	Krb5InstallManPage(file,destdir,suffix)				@@\
install.man:: file.M							@@\
	$(INSTALL) -c $(INSTMANFLAGS) file.M destdir/file.suffix
#endif /* Krb5InstallManPage */

/*
 * Krb5SimpleProgramTarget - generate rules for compiling and linking programs
 * that only have one C source file.  It should only be used in Imakefiles 
 * that describe a single program.
 * takes extra arguments beyond SimpleProgramTarget which specify where
 * to put manpages & binaries
 */
#ifndef Krb5SimpleProgramTarget
#define	Krb5SimpleProgramTarget(program,bindir,mandir,mansuffix)	@@\
           OBJS = program.o						@@\
           SRCS = program.c						@@\
									@@\
Krb5ComplexProgramTarget(program,bindir,mandir,mansuffix)
#endif /* Krb5SimpleProgramTarget */

#ifndef Krb5AdminProgramTarget
#define Krb5AdminProgramTarget(program)					@@\
Krb5SimpleProgramTarget(program,$(ADMIN_BINDIR),$(ADMIN_MANDIR),$(ADMIN_MANSUFFIX))
#endif /* Krb5AdminProgramTarget */

#ifndef Krb5ClientProgramTarget
#define Krb5ClientProgramTarget(program)				@@\
Krb5SimpleProgramTarget(program,$(CLIENT_BINDIR),$(CLIENT_MANDIR),$(CLIENT_MANSUFFIX))
#endif /* Krb5ClientProgramTarget */

#ifndef Krb5InstallAdminProgram
#define Krb5InstallAdminProgram(program)				@@\
InstallProgram(program,$(ADMIN_BINDIR))					@@\
Krb5InstallManPage(program,$(ADMIN_MANDIR),$(ADMIN_MANSUFFIX))
#endif /* Krb5InstallAdminProgram */

#ifndef Krb5InstallServerProgram
#define Krb5InstallServerProgram(program)				@@\
InstallProgram(program,$(SERVER_BINDIR))				@@\
Krb5InstallManPage(program,$(SERVER_MANDIR),$(SERVER_MANSUFFIX))
#endif /* Krb5InstallAdminProgram */

#ifndef Krb5InstallClientProgram
#define Krb5InstallClientProgram(program)				@@\
InstallProgram(program,$(CLIENT_BINDIR))				@@\
Krb5InstallManPage(program,$(CLIENT_MANDIR),$(CLIENT_MANSUFFIX))
#endif /* Krb5InstallAdminProgram */

/*
 * Krb5ComplexProgramTarget - generate rules for compiling and linking the 
 * program specified by $(OBJS) and $(SRCS), installing the program and its
 * man page, and generating dependencies.  It should only be used in 
 * Imakefiles that describe a single program.
 * Provides extra arguments to set manpage & binary locations
 */

#ifndef Krb5ComplexProgramTarget
#define	Krb5ComplexProgramTarget(program,bindir,mandir,mansuffix)	@@\
        PROGRAM = program						@@\
									@@\
AllTarget(program)							@@\
									@@\
program: $(OBJS) $(DEPLIBS)						@@\
	RemoveTargetProgram($@)						@@\
	$(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS) @@\
									@@\
SaberProgramTarget(program,$(SRCS),$(OBJS),$(LOCAL_LIBRARIES), /**/)	@@\
									@@\
InstallProgram(program,bindir)						@@\
Krb5InstallManPage(program,mandir,mansuffix)				@@\
DependTarget()								@@\
LintTarget()								@@\
									@@\
clean::									@@\
	$(RM) $(PROGRAM)
#endif /* Krb5ComplexProgramTarget */


/*
 * SimpleTestProgramTarget - generate rules for compiling and linking 
 * a test program, but don't include any install rules.
 * cf. SimpleProgramTarget, ComplexProgramTarget
 */
#ifndef SimpleTestProgramTarget
#define	SimpleTestProgramTarget(program)				@@\
AllTarget(program)							@@\
									@@\
program: program.o $(DEPLIBS)						@@\
	RemoveTargetProgram($@)						@@\
	$(CC) -o $@ program.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS) @@\
									@@\
SaberProgramTarget(program,program.c,program.o,$(LOCAL_LIBRARIES), /**/)@@\
									@@\
clean::									@@\
	$(RM) $(PROGRAM)
#endif /* ComplexProgramTarget */

#if HasPosixTermios
P_TERMIOS=-DHasPosixTermiosTrue
#else
P_TERMIOS=-UHasPosixTermiosTrue
#endif
#if HasPosixFileLocks
P_FLOCKS=-DHasPosixFileLocksTrue
#else
P_FLOCKS=-UHasPosixFileLocksTrue
#endif
#if HasPosixTypes
P_TYPES=-DHasPosixTypesTrue
#else
P_TYPES=-UHasPosixTypesTrue
#endif
#if HasVoidSignalReturn
P_SIGTYPE=-DHasVoidSignalReturnTrue
#else
P_SIGTYPE=-UHasVoidSignalReturnTrue
#endif
#if HasStringH
P_STRINGH=-DHasStringHTrue
#else
P_STRINGH=-UHasStringHTrue
#endif
#ifdef Bitsize16
P_BITSIZE=-DBitsize16 -UBitsize32 -UBitsize64
#endif
#ifdef Bitsize32
P_BITSIZE=-DBitsize32 -UBitsize16 -UBitsize64
#endif
#ifdef Bitsize64
P_BITSIZE=-DBitsize64 -UBitsize16 -UBitsize32
#endif
#if HasNdbm
P_DBM=-DHasNdbmTrue
#else
P_DBM=-UHasNdbmTrue
#endif
#if HasInet
P_INET=-DHasInetTrue
#else
P_INET=-UHasInetTrue
#endif
/* If HasStdlibH > 1, include <stdlib.h> even if __STDC__ is not defined. */
#if HasStdlibH > 1
P_STDLIBH=-DHasStdlibHTrue -DForceStdlibH
#else
#if HasStdlibH
P_STDLIBH=-DHasStdlibHTrue -UForceStdlibH
#else
P_STDLIBH=-UHasStdlibHTrue -UForceStdlibH
#endif
#endif
#if !defined(UseTimeH) && !defined(UseSysTimeH)
/* Override system defaults for <time.h> vs <sys/time.h> */
#ifdef OS_BSD
#define	UseSysTimeH
#else
#define	UseTimeH
#endif
#endif
#ifdef UseTimeH
#ifdef UseSysTimeH
P_TIME_DEFS=-DUseTimeH -DUseSysTimeH
#else
P_TIME_DEFS=-DUseTimeH -UUseSysTimeH
#endif
#else
P_TIME_DEFS=-DUseSysTimeH -UUseTimeH
#endif
#if WantPrototypes
P_PROTOS=-DProvidePrototypes
#else
P_PROTOS=-UProvidePrototypes
#endif
#if NeedNarrowPrototypes
P_NPROTO=-DUseNarrowPrototypes
#else
P_NPROTO=-UUseNarrowPrototypes
#endif
#if UseStdarg
P_STDARG=-DUseStdarg
#else
P_STDARG=-UUseStdarg
#endif
#if HasAnsiStdio
P_ANSI_STDIO=-DHasAnsiStdio
#else
P_ANSI_STDIO=-UHasAnsiStdio
#endif
#if UseVoid
P_VOID=-DUseVoid
#else
P_VOID=-UUseVoid
#endif
#if UseConst
P_CONST=-DUseConst
#else
P_CONST=-UUseConst
#endif
#if UseVolatile
P_VOLATILE=-DUseVolatile
#else
P_VOLATILE=-UUseVolatile
#endif

/*
 * Default Definitions.
 */

            ARADD = ArAddCmd
#ifdef SourceTop
     TOP_INCLUDES = -I$(TOP)/include -I/**/SourceTop/include $(STDC_TOP_INCLUDES)
#else
     TOP_INCLUDES = -I$(TOP)/include $(STDC_TOP_INCLUDES)
#endif
        CONFIGSRC = $(TOP)/config
            ISODE = IsodeDir
         PSYFLAGS = PepsyFlags
            PEPSY = PepsyCmd
            TOUCH = TouchCmd
            IMAKE = ImakeCmd
           DEPEND = DependCmd
          UNIFDEF = UnifdefCmd
          HESDEFS = HesiodDefines
          HESLIBS = HesiodLibs
#if 0
         ZEPHDEFS = ZephyrDefines
         ZEPHLIBS = ZephyrLibs
#endif
         KRB5ROOT = Krb5Root

  PROCESS_DEFINES = $(P_TERMIOS) $(P_FLOCKS) $(P_TYPES) $(P_SIGTYPE) $(P_STRINGH) $(P_BITSIZE) $(P_DBM) $(P_INET) $(P_STDLIBH) $(P_TIME_DEFS) $(P_PROTOS) $(P_NPROTO) $(P_STDARG) $(P_ANSI_STDIO) $(P_VOID) $(P_CONST) $(P_VOLATILE) -DUnifdefRan
       DESDEFINES = DesDefines
          TOPLIBD = $(TOP)/lib
            OSLIB = os
         OSDEPLIB = $(TOPLIBD)/libos.a
           DESLIB = des5
        DESDEPLIB = $(TOPLIBD)/libdes5.a
        RSAMD4LIB = md4
     RSAMD4DEPLIB = $(TOPLIBD)/libmd4.a
          KRB5LIB = krb5
       KRB5DEPLIB = $(TOPLIBD)/libkrb5.a
           CRCLIB = crc32
        CRCDEPLIB = $(TOPLIBD)/libcrc32.a
         ISODELIB = IsodeLib

           DBMLIB = DbmLib
          DEPKLIB = $(KRB5DEPLIB) $(DESDEPLIB) $(OSDEPLIB)
          KLIBLOC = -L$(TOPLIBD)
             KLIB = $(KLIBLOC) -l$(KRB5LIB) -l$(DESLIB) $(ISODELIB) $(COMERRLIB) $(DBMLIB)
        KDBDEPLIB = $(TOPLIBD)/libkdb5.a
           KDBLIB = $(KLIBLOC) -lkdb5
     KRB425DEPLIB = $(TOPLIBD)/libkrb425.a
        KRB425LIB = krb425
     DES425DEPLIB = $(TOPLIBD)/libdes425.a
        DES425LIB = des425
          KRB4LIB = Krb4LibList
     KRB4INCLUDES = Krb4Includes
       KRB4DEPLIB = Krb4DepList

            SSLIB = SSLib
          MK_CMDS = MkCmdsCmd
        COMERRLIB = ComErrLib
       COMPILE_ET = CompileEtCmd

     ADMIN_BINDIR = AdminBindir
  ADMIN_MANSUFFIX = AdminManSuffix
     ADMIN_MANDIR = AdminMandir
    SERVER_BINDIR = ServerBindir
 SERVER_MANSUFFIX = ServerManSuffix
    SERVER_MANDIR = ServerMandir
    CLIENT_BINDIR = ClientBindir
 CLIENT_MANSUFFIX = ClientManSuffix
    CLIENT_MANDIR = ClientMandir
      KRB5_LIBDIR = Krb5Libdir
      KRB5_INCDIR = Krb5Incdir