3fa42800c9a334f366f65cb0f241421212a8c41b
[openafs.git] / src / ptserver / Makefile
1 # Copyright 2000, International Business Machines Corporation and others.
2 # All Rights Reserved.
3
4 # This software has been released under the terms of the IBM Public
5 # License.  For details, see the LICENSE file in the top-level source
6 # directory or online at http://www.openafs.org/dl/license10.html
7
8 SHELL = /bin/sh
9 COMPONENT=ptserver
10 include ../config/Makefile.${SYS_NAME}
11
12 UKERNELDIR=../libuafs/
13 INSTALL=${SRCDIR}bin/install
14 RXGEN=${SRCDIR}bin/rxgen
15 COMPILE_ET = ${SRCDIR}bin/compile_et
16 MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
17
18 CFLAGS = $(DBUG) -I${SRCDIR}include ${XCFLAGS}
19 PE = ../permit_xprt.h
20 INCLS=${SRCDIR}include/ubik.h \
21         ${SRCDIR}include/lock.h  \
22         ${SRCDIR}include/lwp.h \
23         ${SRCDIR}include/rx/rx.h \
24         ${SRCDIR}include/rx/xdr.h \
25         ${SRCDIR}include/afs/keys.h \
26         ${SRCDIR}include/afs/cellconfig.h \
27         ptserver.h ptclient.h ptint.h ptopcodes.h pterror.h
28
29 LINCLS=${SRCDIR}include/ubik.h \
30         ${SRCDIR}include/lock.h \
31         ${SRCDIR}include/rx/rx.h \
32         ${SRCDIR}include/rx/xdr.h  \
33         ${SRCDIR}include/rx/rxkad.h \
34         ${SRCDIR}include/afs/auth.h \
35         ${SRCDIR}include/afs/cellconfig.h \
36         ptclient.h ptint.h pterror.h
37
38 LIBS =  ${SRCDIR}lib/libubik.a \
39         ${SRCDIR}lib/afs/libauth.a \
40         ${SRCDIR}lib/librxkad.a \
41         ${SRCDIR}lib/librxstat.a \
42         ${SRCDIR}lib/librx.a \
43         ${SRCDIR}lib/liblwp.a \
44         ${SRCDIR}lib/libdes.a \
45         ${SRCDIR}lib/afs/libcom_err.a \
46         ${SRCDIR}lib/afs/util.a \
47         ${SRCDIR}lib/afs/libsys.a 
48
49 auditlib=${SRCDIR}lib/afs/libaudit.a
50
51 LIBOBJS=ptuser.o pterror.o ptint.cs.o ptint.xdr.o
52  
53 UKSRCS=ptuser.c ptclient.h pterror.c pterror.h ptserver.h
54
55 include ../config/Makefile.version
56
57
58 clean:
59         $(RM) -f *.o ptserver ptint.cs.c ptint.ss.c ptclient ptint.xdr.c ptint.h \
60         libprot.a  pts readgroup readpwd db_verify testpt pterror.h pterror.c \
61          core  AFS_component_version_number.c
62
63 ptserver: ptserver.o ptutils.o ptprocs.o ptint.ss.o ptint.xdr.o utils.o $(LIBS) ${auditlib}
64         $(CC) ${CFLAGS} -o ptserver ptserver.o ptutils.o ptprocs.o  ptint.ss.o ptint.xdr.o utils.o $(LIBS) ${XLIBS} ${auditlib}
65
66 ptserver.o: ptserver.c ${INCLS} AFS_component_version_number.c
67
68 ptutils.o: ptutils.c ${INCLS}
69
70 ptprocs.o: ptprocs.c ${INCLS}
71
72 utils.o: utils.c ${INCLS} 
73
74 ptint.ss.o: ptint.ss.c ptint.xdr.c ptint.xg
75 ptint.cs.o: ptint.cs.c ptint.xdr.c ptint.xg
76 ptint.xdr.o: ptint.xdr.c ptint.h ptint.xg
77
78 ptint.ss.c ptint.cs.c ptint.xdr.c ptint.h: ptint.xg
79         ${RXGEN} -x ptint.xg
80
81 Kptint.cs.c: ptint.xg Kptint.h
82         ${RXGEN} -x -k -C -o Kptint.cs.c ptint.xg
83  
84 Kptint.xdr.c: ptint.xg
85         ${RXGEN} -x -k -c -o Kptint.xdr.c ptint.xg
86  
87 Kptint.h: ptint.xg
88         ${RXGEN}  -x -k -h -o Kptint.h ptint.xg
89
90 display.o: display.c ${INCLS}
91
92 db_verify.o: db_verify.c ${INCLS} AFS_component_version_number.c
93
94 db_verify: db_verify.o pterror.o display.o $(LIBS)
95         $(CC) ${CFLAGS} -o db_verify db_verify.o display.o pterror.o $(LIBS) ${XLIBS} ${SRCDIR}lib/afs/libcmd.a
96
97 ptclient: ptclient.o display.o libprot.a $(LIBS)
98         $(CC) ${CFLAGS} -o ptclient ptclient.o display.o libprot.a $(LIBS) ${XLIBS}
99
100 ptclient.o: ptclient.c ${INCLS} AFS_component_version_number.c
101
102 ptuser.o: ptuser.c ${LINCLS} ${PE}
103
104 pterror.h pterror.c: pterror.et
105         $(RM) -f pterror.h pterror.c; ${COMPILE_ET} pterror
106
107 libprot.a: ${LIBOBJS} AFS_component_version_number.o
108         $(RM) -f libprot.a
109         $(AR) r libprot.a ${LIBOBJS} AFS_component_version_number.o
110         $(RANLIB) libprot.a
111                 
112
113 pts: pts.o libprot.a ${SRCDIR}lib/afs/libcmd.a $(LIBS)
114         $(CC) ${CFLAGS} -o pts pts.o ${SRCDIR}lib/afs/libcmd.a libprot.a ${LIBS} ${XLIBS}
115
116 pts.o: pts.c ${LINCLS} ${SRCDIR}include/afs/cmd.h AFS_component_version_number.c
117
118 readgroup: readgroup.o libprot.a $(LIBS)
119         $(CC) ${CFLAGS} -o readgroup readgroup.o libprot.a ${LIBS} ${XLIBS}
120
121 readgroup.o: readgroup.c ${LINCLS} AFS_component_version_number.c
122
123 readpwd: readpwd.o libprot.a $(LIBS)
124         $(CC) ${CFLAGS} -o readpwd readpwd.o libprot.a ${LIBS} ${XLIBS}
125
126 readpwd.o: readpwd.c ${LINCLS} AFS_component_version_number.c
127
128 testpt: testpt.o libprot.a ${SRCDIR}lib/afs/libcmd.a $(LIBS)
129         $(CC) ${CFLAGS} -o testpt testpt.o -lm ${SRCDIR}lib/afs/libcmd.a libprot.a $(LIBS) ${XLIBS}
130
131 testpt.o: testpt.c ${INCLS} ${SRCDIR}include/afs/cmd.h AFS_component_version_number.c
132
133
134 system: install
135
136 kinstall:
137         @echo No $@ source here.
138
139 ukinstall webinstall: ${UKSRCS} Kptint.h Kptint.cs.c Kptint.xdr.c
140         set ${UKERNELDIR}afs; $(MKDIR_IF_NEEDED)
141         ${INSTALL} Kptint.h ${UKERNELDIR}afsint/ptint.h
142         ${INSTALL} Kptint.cs.c ${UKERNELDIR}afsint/ptint.cs.c
143         ${INSTALL} Kptint.xdr.c ${UKERNELDIR}afsint/ptint.xdr.c
144         ${INSTALL} ${UKSRCS} ${UKERNELDIR}afs
145
146 all: ptclient libprot.a pts db_verify readgroup readpwd testpt
147
148 ${DESTDIR}root.server/usr/afs/bin/ptserver: ptserver
149         ${INSTALL} $? $@
150
151 ${DESTDIR}bin/pts ${DESTDIR}root.server/usr/afs/bin/pts: pts
152         ${INSTALL} $? $@
153
154 ${DESTDIR}lib/afs/libprot.a: libprot.a
155         ${INSTALL}   $? $@
156
157
158 install: all ukinstall ${DESTDIR}root.server/usr/afs/bin/ptserver ${DESTDIR}root.server/usr/afs/bin/pts ${DESTDIR}bin/pts ${DESTDIR}lib/afs/libprot.a
159         ${INSTALL} libprot.a ${DESTDIR}lib/afs/libprot.a
160         ${INSTALL} ptserver.h ptint.h pterror.h ptclient.h ${DESTDIR}include/afs
161         ${INSTALL} ptserver.h ${DESTDIR}include/afs/prserver.h
162         ${INSTALL} ptint.h ${DESTDIR}include/afs/print.h
163         ${INSTALL} pterror.h ${DESTDIR}include/afs/prerror.h
164         ${INSTALL} ptclient.h ${DESTDIR}include/afs/prclient.h
165         ${INSTALL} -f db_verify ${DESTDIR}etc/prdb_check
166         echo '#define ERROR_TABLE_BASE_pr ERROR_TABLE_BASE_pt' >> ${DESTDIR}include/afs/prerror.h