make-install-support-for-transarc-and-prefix-style-universes-20010907
[openafs.git] / src / lwp / Makefile.in
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 DEST=@DEST@
9 TOP_INCDIR=@TOP_INCDIR@
10 TOP_LIBDIR=@TOP_LIBDIR@
11 prefix=@prefix@
12 exec_prefix=@exec_prefix@
13 bindir=@bindir@
14 sbindir=@sbindir@
15 libexecdir=@libexecdir@
16 libdir=@libdir@
17 includedir=@includedir@
18 mandir=@mandir@
19 afssrvbindir=@afssrvbindir@
20 afssrvsbindir=@afssrvsbindir@
21 afssrvlibexecdir=@afssrvlibexecdir@
22 COMPILE_ET=${TOP_SRCDIR}/comerr/compile_et
23 RXGEN=${TOP_SRCDIR}/rxgen/rxgen
24 TOP_SRCDIR=@TOP_SRCDIR@
25 SYS_NAME=@AFS_SYSNAME@
26
27 SHELL = /bin/sh
28
29 include ../config/Makefile.${SYS_NAME}
30
31 # this is important code, so let's optimize it.  The optimizer aggravates any
32 # subtle bugs that may have been introduced in process.s, be warned!
33 OPTIMIZE=${LWP_OPTMZ}
34
35 CFLAGS=${OPTIMIZE} -I${TOP_SRCDIR}/config -I${TOP_INCDIR} ${XCFLAGS}
36
37 LIBOBJS=lwp.o process.o lock.o iomgr.o timer.o fasttime.o preempt.o \
38         waitkey.o threadname.o AFS_component_version_number.o
39
40 all: ${TOP_LIBDIR}/liblwp.a ${TOP_INCDIR}/lock.h ${TOP_INCDIR}/lwp.h ${TOP_INCDIR}/preempt.h ${TOP_INCDIR}/timer.h
41
42 #
43 # Build rules
44 #
45 liblwp.a: ${LIBOBJS}
46         -$(RM) -f $@
47         $(AR) crv $@ ${LIBOBJS}
48         $(RANLIB) $@
49
50 process.s:
51         echo Nothing to be done for process.s
52         # This is required so sgi_64+ does not try to build this file.
53
54 process.o       : process.s process.c
55         @case "$(SYS_NAME)" in \
56         pmax_he1) \
57                 $(CC) -c -I${TOP_INCDIR} process.s;; \
58         sun4c_51 | sun4c_52 | sun4m_51 | sun4m_52 | sun4c_53 | sun4m_53  | sun4_53 | sun4_52 | sun4_54 | sun4c_54 | sun4m_54 | sun4x_5? | sunx86_54) \
59                 /usr/ccs/lib/cpp -P -I${TOP_INCDIR} process.s process.ss; \
60                 ${AS} process.ss -o process.o; \
61                         $(RM) process.ss ;; \
62         sgi_5* ) \
63                 $(CC) -c -I${TOP_INCDIR} -KPIC -G0  process.s;; \
64         sgi_61 | sgi_62 | sgi_63 ) \
65                 $(CC) -c ${XCFLAGS} -I${TOP_INCDIR} -KPIC -G0  process.s;; \
66         s390*) \
67                 /lib/cpp -P -I${TOP_INCDIR} process.s >process.ss; \
68                 ${AS} -ahlns process.ss -o process.o >process.lst; \
69                 $(RM) process.ss ;; \
70         ppc_darwin* ) \
71                 $(CC) -c ${XCFLAGS} -I${TOP_INCDIR} process.s;; \
72         i386_fbsd* ) \
73                 /usr/bin/cpp -P process.fbsd.s > process.ss; \
74                 ${AS} -o process.o process.ss; \
75                 $(RM) process.ss ;; \
76         hp* | *_linux* | sgi_64 | sgi_65 ) \
77                 ${CC} ${CFLAGS} -c process.c;; \
78         ncrx86_*) \
79                 /usr/ccs/lib/cpp -P -I${TOP_INCDIR} process.s process.ss; \
80                 ${AS} -o process.o process.ss; \
81                 $(RM) process.ss ;; \
82         alpha_osf1 | alpha_osf20 |  alpha_osf30 | alpha_osf32 | alpha_osf32c | alpha_dux?? ) \
83                 ${AS} -v  -P -DOSF -I${TOP_INCDIR} -DASSEMBLER process.s; \
84                 ${AS} -v process.i -o process.o;; \
85         hp_ux110 ) \
86                 ${CC} ${CFLAGS} -c process.c;; \
87         *) \
88                 /lib/cpp -P -I${TOP_INCDIR} process.s process.ss; \
89                 ${AS} process.ss -o process.o; \
90                 $(RM) process.ss ;; \
91         esac
92
93 iomgr.o         : iomgr.c lwp.h timer.h
94                 ${CC} -c ${CFLAGS} iomgr.c
95
96 preempt.o       : preempt.c lwp.h preempt.h
97 lwp.o           : lwp.c lwp.h
98         case "$(SYS_NAME)" in \
99                 rs_aix*) \
100                         $(CC) -I${TOP_SRCDIR}/config -I${TOP_INCDIR} -c lwp.c;; \
101                 *)  \
102                         $(CC) ${CFLAGS} -c lwp.c;; \
103                 esac
104 lock.o          : lock.c lock.h lwp.h
105 timer.o         : timer.c
106 fasttime.o      : fasttime.c
107 threadname.o    : threadname.c
108
109 exc_handling.o  : exc_handling.c
110
111 #
112 # tests
113 #
114 rw: rw.o liblwp.a $(TOP_LIBDIR)/util.a
115         ${CC} ${CFLAGS} -o rw rw.o liblwp.a $(TOP_LIBDIR)/util.a
116
117 rw.o: rw.c
118         ${CC} ${CFLAGS} -c rw.c
119
120
121 #
122 # Install targets
123 #
124 install: ${DESTDIR}${libdir}/liblwp.a ${DESTDIR}${includedir}/lock.h ${DESTDIR}${includedir}/lwp.h ${DESTDIR}${includedir}/preempt.h ${DESTDIR}${includedir}/timer.h
125
126 ${DEST}/lib/liblwp.a: liblwp.a
127         ${INSTALL} $? $@
128
129 ${DEST}/include/lock.h: lock.h
130         ${INSTALL} $? $@
131
132 ${DEST}/include/lwp.h: lwp.h
133         ${INSTALL} $? $@
134
135 ${DEST}/include/preempt.h: preempt.h
136         ${INSTALL} $? $@
137
138 ${DEST}/include/timer.h: timer.h
139         ${INSTALL} $? $@
140
141 #
142 # Misc. targets
143 #
144 clean:
145         $(RM) -f *.o *.a core AFS_component_version_number.c
146
147 include ../config/Makefile.version
148 ${DESTDIR}${libdir}/liblwp.a: liblwp.a
149         ${INSTALL} $? $@
150
151 ${TOP_LIBDIR}/liblwp.a: liblwp.a
152         ${INSTALL} $? $@
153
154 ${DESTDIR}${includedir}/lock.h: lock.h
155         ${INSTALL} $? $@
156
157 ${TOP_INCDIR}/lock.h: lock.h
158         ${INSTALL} $? $@
159
160 ${DESTDIR}${includedir}/lwp.h: lwp.h
161         ${INSTALL} $? $@
162
163 ${TOP_INCDIR}/lwp.h: lwp.h
164         ${INSTALL} $? $@
165
166 ${DESTDIR}${includedir}/preempt.h: preempt.h
167         ${INSTALL} $? $@
168
169 ${TOP_INCDIR}/preempt.h: preempt.h
170         ${INSTALL} $? $@
171
172 ${DESTDIR}${includedir}/timer.h: timer.h
173         ${INSTALL} $? $@
174
175 ${TOP_INCDIR}/timer.h: timer.h
176         ${INSTALL} $? $@
177
178 dest: ${DEST}/lib/liblwp.a ${DEST}/include/lock.h ${DEST}/include/lwp.h ${DEST}/include/preempt.h ${DEST}/include/timer.h
179