introduce-autoconf-for-openafs-20010628
[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 RXGEN=${SRCDIR}bin/rxgen
14 COMPILE_ET = ${SRCDIR}bin/compile_et
15 MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
16
17 CFLAGS = $(DBUG) -I${TOP_SRCDIR}/config -I${SRCDIR}include ${XCFLAGS}
18 INCLS=${SRCDIR}include/ubik.h \
19         ${SRCDIR}include/lock.h  \
20         ${SRCDIR}include/lwp.h \
21         ${SRCDIR}include/rx/rx.h \
22         ${SRCDIR}include/rx/xdr.h \
23         ${SRCDIR}include/afs/keys.h \
24         ${SRCDIR}include/afs/cellconfig.h \
25         ptserver.h ptclient.h ptint.h ptopcodes.h pterror.h
26
27 LINCLS=${SRCDIR}include/ubik.h \
28         ${SRCDIR}include/lock.h \
29         ${SRCDIR}include/rx/rx.h \
30         ${SRCDIR}include/rx/xdr.h  \
31         ${SRCDIR}include/rx/rxkad.h \
32         ${SRCDIR}include/afs/auth.h \
33         ${SRCDIR}include/afs/cellconfig.h \
34         ptclient.h ptint.h pterror.h
35
36 LIBS =  ${SRCDIR}lib/libubik.a \
37         ${SRCDIR}lib/afs/libauth.a \
38         ${SRCDIR}lib/librxkad.a \
39         ${SRCDIR}lib/librxstat.a \
40         ${SRCDIR}lib/librx.a \
41         ${SRCDIR}lib/liblwp.a \
42         ${SRCDIR}lib/libdes.a \
43         ${SRCDIR}lib/afs/libcom_err.a \
44         ${SRCDIR}lib/afs/util.a \
45         ${SRCDIR}lib/afs/libsys.a 
46
47 auditlib=${SRCDIR}lib/afs/libaudit.a
48
49 LIBOBJS=ptuser.o pterror.o ptint.cs.o ptint.xdr.o
50  
51 UKSRCS=ptuser.c ptclient.h pterror.c pterror.h ptserver.h
52
53 include ../config/Makefile.version
54
55
56 clean:
57         $(RM) -f *.o ptserver ptint.cs.c ptint.ss.c ptclient ptint.xdr.c ptint.h \
58         libprot.a  pts readgroup readpwd db_verify testpt pt_util pterror.h pterror.c \
59          core  AFS_component_version_number.c Kptint.cs.c Kptint.h Kptint.xdr.c
60
61 ptserver: ptserver.o ptutils.o ptprocs.o ptint.ss.o ptint.xdr.o utils.o $(LIBS) ${auditlib}
62         $(CC) ${CFLAGS} -o ptserver ptserver.o ptutils.o ptprocs.o  ptint.ss.o ptint.xdr.o utils.o $(LIBS) ${XLIBS} ${auditlib}
63
64 ptserver.o: ptserver.c ${INCLS} AFS_component_version_number.c
65
66 ptutils.o: ptutils.c ${INCLS}
67
68 ptprocs.o: ptprocs.c ${INCLS}
69
70 utils.o: utils.c ${INCLS} 
71
72 ptint.ss.o: ptint.ss.c ptint.xdr.c ptint.xg
73 ptint.cs.o: ptint.cs.c ptint.xdr.c ptint.xg
74 ptint.xdr.o: ptint.xdr.c ptint.h ptint.xg
75
76 ptint.ss.c ptint.cs.c ptint.xdr.c ptint.h: ptint.xg
77         ${RXGEN} -x ptint.xg
78
79 Kptint.cs.c: ptint.xg Kptint.h
80         ${RXGEN} -x -k -C -o Kptint.cs.c ptint.xg
81  
82 Kptint.xdr.c: ptint.xg
83         ${RXGEN} -x -k -c -o Kptint.xdr.c ptint.xg
84  
85 Kptint.h: ptint.xg
86         ${RXGEN}  -x -k -h -o Kptint.h ptint.xg
87
88 display.o: display.c ${INCLS}
89
90 db_verify.o: db_verify.c ${INCLS} AFS_component_version_number.c
91
92 db_verify: db_verify.o pterror.o display.o $(LIBS)
93         $(CC) ${CFLAGS} -o db_verify db_verify.o display.o pterror.o $(LIBS) ${XLIBS} ${SRCDIR}lib/afs/libcmd.a
94
95 ptclient: ptclient.o display.o libprot.a $(LIBS)
96         $(CC) ${CFLAGS} -o ptclient ptclient.o display.o libprot.a $(LIBS) ${XLIBS}
97
98 ptclient.o: ptclient.c ${INCLS} AFS_component_version_number.c
99
100 ptuser.o: ptuser.c ${LINCLS}
101
102 pterror.h pterror.c: pterror.et
103         $(RM) -f pterror.h pterror.c; ${COMPILE_ET} pterror
104
105 libprot.a: ${LIBOBJS} AFS_component_version_number.o
106         $(RM) -f libprot.a
107         $(AR) r libprot.a ${LIBOBJS} AFS_component_version_number.o
108         $(RANLIB) libprot.a
109
110 pts: pts.o libprot.a ${SRCDIR}lib/afs/libcmd.a $(LIBS)
111         $(CC) ${CFLAGS} -o pts pts.o ${SRCDIR}lib/afs/libcmd.a libprot.a ${LIBS} ${XLIBS}
112
113 pts.o: pts.c ${LINCLS} ${SRCDIR}include/afs/cmd.h AFS_component_version_number.c
114
115 readgroup: readgroup.o libprot.a $(LIBS)
116         $(CC) ${CFLAGS} -o readgroup readgroup.o libprot.a ${LIBS} ${XLIBS}
117
118 readgroup.o: readgroup.c ${LINCLS} AFS_component_version_number.c
119
120 readpwd: readpwd.o libprot.a $(LIBS)
121         $(CC) ${CFLAGS} -o readpwd readpwd.o libprot.a ${LIBS} ${XLIBS}
122
123 readpwd.o: readpwd.c ${LINCLS} AFS_component_version_number.c
124
125 testpt: testpt.o libprot.a ${SRCDIR}lib/afs/libcmd.a $(LIBS)
126         case "$(SYS_NAME)" in \
127         ppc_darwin_12 ) \
128                 $(CC) ${CFLAGS} -o testpt testpt.o ${SRCDIR}lib/afs/libcmd.a libprot.a $(LIBS) ;; \
129         * ) \
130                 $(CC) ${CFLAGS} -o testpt testpt.o -lm ${SRCDIR}lib/afs/libcmd.a libprot.a $(LIBS) ${XLIBS} ;; \
131         esac
132
133 testpt.o: testpt.c ${INCLS} ${SRCDIR}include/afs/cmd.h AFS_component_version_number.c
134
135 pt_util: pt_util.o ptutils.o ubik.o utils.o libprot.a $(LIBS)
136         $(CC) ${CFLAGS} -o pt_util pt_util.o ptutils.o ubik.o utils.o libprot.a $(LIBS) ${XLIBS}
137
138 ubik.o: ubik.c ${INCLS}
139
140 system: install
141
142 kinstall:
143         @echo No $@ source here.
144
145 ukinstall webinstall: ${UKSRCS} Kptint.h Kptint.cs.c Kptint.xdr.c
146         set ${UKERNELDIR}afs; $(MKDIR_IF_NEEDED)
147         ${INSTALL} Kptint.h ${UKERNELDIR}afsint/ptint.h
148         ${INSTALL} Kptint.cs.c ${UKERNELDIR}afsint/ptint.cs.c
149         ${INSTALL} Kptint.xdr.c ${UKERNELDIR}afsint/ptint.xdr.c
150         ${INSTALL} ${UKSRCS} ${UKERNELDIR}afs
151
152 all: ptclient libprot.a pts db_verify readgroup readpwd testpt pt_util
153
154 ${DESTDIR}root.server/usr/afs/bin/ptserver: ptserver
155         ${INSTALL} $? $@
156
157 ${DESTDIR}bin/pts ${DESTDIR}root.server/usr/afs/bin/pts: pts
158         ${INSTALL} $? $@
159
160 ${DESTDIR}root.server/usr/afs/bin/pt_util: pt_util
161         ${INSTALL} $? $@
162
163 ${DESTDIR}lib/afs/libprot.a: libprot.a
164         ${INSTALL}   $? $@
165
166
167 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 ${DESTDIR}root.server/usr/afs/bin/pt_util
168         ${INSTALL} libprot.a ${DESTDIR}lib/afs/libprot.a
169         ${INSTALL} ptserver.h ptint.h pterror.h ptclient.h ${DESTDIR}include/afs
170         ${INSTALL} ptserver.h ${DESTDIR}include/afs/prserver.h
171         ${INSTALL} ptint.h ${DESTDIR}include/afs/print.h
172         ${INSTALL} pterror.h ${DESTDIR}include/afs/prerror.h
173         ${INSTALL} ptclient.h ${DESTDIR}include/afs/prclient.h
174         ${INSTALL} -f db_verify ${DESTDIR}etc/prdb_check
175         echo '#define ERROR_TABLE_BASE_pr ERROR_TABLE_BASE_pt' >> ${DESTDIR}include/afs/prerror.h
176
177 libinstall: ${DESTDIR}lib/afs/libprot.a
178         ${INSTALL} libprot.a ${DESTDIR}lib/afs/libprot.a
179         ${INSTALL} ptserver.h ptint.h pterror.h ptclient.h ${DESTDIR}include/afs
180         ${INSTALL} ptserver.h ${DESTDIR}include/afs/prserver.h
181         ${INSTALL} ptint.h ${DESTDIR}include/afs/print.h
182         ${INSTALL} pterror.h ${DESTDIR}include/afs/prerror.h
183         ${INSTALL} ptclient.h ${DESTDIR}include/afs/prclient.h
184