install-util-archive-also-as-libafsutil-20010327
[openafs.git] / src / util / 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=util
10 include ../config/Makefile.${SYS_NAME}
11
12 CFLAGS = ${OPTMZ} -I$(SRCDIR)include ${XCFLAGS}
13 LDFLAGS = ${OPTMZ} ${XLDFLAGS}
14
15 objects = assert.o base64.o casestrcpy.o ktime.o volparse.o hostparse.o \
16          hputil.o kreltime.o isathing.o get_krbrlm.o uuid.o serverLog.o \
17          dirpath.o fileutil.o netutils.o flipbase64.o \
18          afs_atomlist.o afs_lhash.o snprintf.o ${REGEX_OBJ}
19
20 headers = assert.h potpourri.h itc.h errors.h afsutil.h pthread_glock.h \
21           dirpath.h afs_atomlist.h afs_lhash.h
22
23 include ../config/Makefile.version
24
25 system noversion: install
26
27 all:    util.a sys
28
29 ${DESTDIR}bin/sys: sys
30         ${INSTALL} sys ${DESTDIR}bin/sys
31
32 install0: ${DESTDIR}include/afs/dirpath.h \
33         ${DESTDIR}include/afs/pthread_nosigs.h \
34         ${objects} util.a ${DESTDIR}bin/sys ${someheaders} doc 
35         ${INSTALL} util.a ${DESTDIR}lib/afs
36         ${INSTALL} util.a ${DESTDIR}lib/afs/libafsutil.a
37         ${INSTALL} assert.h errors.h vice.h remote.h ktime.h fileutil.h \
38                 netutils.h packages.h afsutil.h pthread_glock.h \
39                 afs_atomlist.h afs_lhash.h \
40                 ${DESTDIR}include/afs
41         ${INSTALL} itc.h potpourri.h ${DESTDIR}include
42
43 install: install0 kinstall ukinstall
44
45 kinstall:
46         ${INSTALL} vice.h ../libafs/afs
47         ${INSTALL} base64.c ../libafs/afs/afs_base64.c
48         ${INSTALL} uuid.c ../libafs/afs/afs_uuid.c
49         ${INSTALL} afs_atomlist.c ../libafs/afs
50         ${INSTALL} afs_atomlist.h ../libafs/afs
51         ${INSTALL} afs_lhash.c ../libafs/afs
52         ${INSTALL} afs_lhash.h ../libafs/afs
53
54 ukinstall webinstall: install0
55         ${INSTALL} pthread_glock.h vice.h errors.h afsutil.h dirpath.h fileutil.h netutils.h casestrcpy.c dirpath.c hostparse.c fileutil.c netutils.c ../libuafs/afs
56         ${INSTALL} uuid.c ../libuafs/afs/afs_uuid.c
57         ${INSTALL} afs_atomlist.c ../libuafs/afs
58         ${INSTALL} afs_atomlist.h ../libuafs/afs
59         ${INSTALL} afs_lhash.c ../libuafs/afs
60         ${INSTALL} afs_lhash.h ../libuafs/afs
61
62 ${DESTDIR}include/afs/dirpath.h: dirpath.h
63         ${INSTALL} dirpath.h  ${DESTDIR}include/afs
64
65 ${DESTDIR}include/afs/pthread_nosigs.h: pthread_nosigs.h
66         ${INSTALL} pthread_nosigs.h  ${DESTDIR}include/afs
67
68 doc:
69         echo no documents in this directory
70
71 util.a: ${objects} AFS_component_version_number.o
72         rm -f util.a
73         $(AR) r util.a ${objects} AFS_component_version_number.o
74         $(RANLIB) util.a
75
76 volparse.o: volparse.c
77         ${CC} ${CFLAGS} -c volparse.c
78
79 snprintf.o: snprintf.c
80         ${CC} ${CFLAGS} -c snprintf.c
81
82 base64.o: base64.c
83         ${CC} ${CFLAGS} -c base64.c
84
85 hostparse.o: hostparse.c afsutil.h
86         ${CC} ${CFLAGS} -c hostparse.c
87
88 ktime.o: ktime.c
89         ${CC} ${CFLAGS} -c ktime.c
90
91 kreltime.o: kreltime.c
92         ${CC} ${CFLAGS} -c kreltime.c
93
94 get_krbrlm.o: get_krbrlm.c
95         ${CC} ${CFLAGS} -c get_krbrlm.c
96
97 uuid.o: uuid.c
98         ${CC} ${CFLAGS} -c uuid.c
99
100 sys.o: sys.c ${SRCDIR}include/afs/param.h AFS_component_version_number.c
101         ${CC} ${CFLAGS} -c sys.c
102
103 sys: sys.o 
104         ${CC} ${LDFLAGS} -o sys sys.o
105
106 isathing.o: isathing.c
107         ${CC} ${CFLAGS} -c isathing.c
108
109 serverLog.o: serverLog.c
110         ${CC} ${CFLAGS} -c serverLog.c
111
112 dirpath.o: dirpath.c dirpath.h
113         ${CC} ${CFLAGS} -c dirpath.c
114
115 fileutil.o: fileutil.c fileutil.h
116         ${CC} ${CFLAGS} -c fileutil.c
117
118 netutils.o: netutils.c netutils.h
119         ${CC} ${CFLAGS} -c netutils.c
120
121 afs_atomlist.o: afs_atomlist.c afs_atomlist.h
122         ${CC} ${CFLAGS} -c afs_atomlist.c
123
124 afs_lhash.o: afs_lhash.c afs_lhash.h afs_atomlist.h
125         ${CC} ${CFLAGS} -c afs_lhash.c
126
127 clean:
128         rm -f ${objects} sys
129         rm -f util.a *.o core AFS_component_version_number.c
130
131 beancount:
132         wc -l *.c *.h
133
134 test:
135         cd test; $(MAKE)
136