fix-lwp-20031010
[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 srcdir=@srcdir@
9 include @TOP_OBJDIR@/src/config/Makefile.config
10
11 CFLAGS=${LWP_DBG} ${LWP_OPTMZ} ${XCFLAGS} ${COMMON_INCL}
12
13 LIBOBJS=lwp.o process.o lock.o iomgr.o timer.o fasttime.o preempt.o \
14         waitkey.o threadname.o AFS_component_version_number.o
15
16 all: ${TOP_LIBDIR}/liblwp.a ${TOP_INCDIR}/lock.h ${TOP_INCDIR}/lwp.h ${TOP_INCDIR}/preempt.h ${TOP_INCDIR}/timer.h
17
18 depinstall: ${TOP_INCDIR}/lock.h ${TOP_INCDIR}/lwp.h ${TOP_INCDIR}/preempt.h ${TOP_INCDIR}/timer.h
19
20 #
21 # Build rules
22 #
23 liblwp.a: ${LIBOBJS}
24         -$(RM) -f $@
25         $(AR) crv $@ ${LIBOBJS}
26         $(RANLIB) $@
27
28 process.s:
29         echo Nothing to be done for process.s
30         # This is required so sgi_64+ does not try to build this file.
31
32 process.o       : process.s process.i386.s process.c
33         @case "$(SYS_NAME)" in \
34         pmax_he1) \
35                 $(CC) ${LWP_DBG} ${LWP_OPTMZ} -c -I${TOP_INCDIR} process.s;; \
36         sun4c_51 | sun4c_52 | sun4m_51 | sun4m_52 | sun4c_53 | sun4m_53  | sun4_53 | sun4_52 | sun4_54 | sun4c_54 | sun4m_54 | sun4x_5?) \
37                 /usr/ccs/lib/cpp -P -I${TOP_INCDIR} ${srcdir}/process.s process.ss; \
38                 ${AS} process.ss -o process.o; \
39                         $(RM) process.ss ;; \
40         sgi_5* ) \
41                 $(CC) ${LWP_DBG} ${LWP_OPTMZ} -c -I${TOP_INCDIR} -KPIC -G0  ${srcdir}/process.s;; \
42         sgi_61 | sgi_62 | sgi_63 ) \
43                 $(CC) ${LWP_DBG} ${LWP_OPTMZ} -c ${XCFLAGS} -I${TOP_INCDIR} -KPIC -G0  ${srcdir}/process.s;; \
44         s390*) \
45                 /lib/cpp -P -I${TOP_INCDIR} ${srcdir}/process.s >process.ss; \
46                 ${AS} -ahlns process.ss -o process.o >process.lst; \
47                 $(RM) process.ss ;; \
48         ppc_darwin* ) \
49                 $(CC) ${LWP_DBG} ${LWP_OPTMZ} -c ${XCFLAGS} -I${TOP_INCDIR} ${srcdir}/process.s;; \
50         i386_*bsd*) \
51                 echo foo ; \
52                 cp ${srcdir}/process.i386.s process.S ; \
53                 ${CC} -E -I${srcdir} -I${TOP_INCDIR} process.S >process.ss ; \
54                 ${AS} process.ss -o process.o ;  \
55                 $(RM) -f process.S ;;\
56         ncrx86_* | sunx86_*) \
57                 /usr/ccs/lib/cpp -P -I${TOP_INCDIR} ${srcdir}/process.i386.s process.ss; \
58                 ${AS} -o process.o process.ss; \
59                 $(RM) process.ss ;; \
60         alpha_nbsd* ) \
61                 /usr/bin/cpp -DASSEMBLER -P -I${TOP_INCDIR} ${srcdir}/process.s > process.ss; \
62                 ${AS} -o process.o process.ss; \
63                 $(RM) process.ss ;; \
64         hp* | *_linux* | *_umlinux* | sgi_64 | sgi_65 ) \
65                 ${CC} ${CFLAGS} -c ${srcdir}/process.c;; \
66         alpha_osf1 | alpha_osf20 |  alpha_osf30 | alpha_osf32 | alpha_osf32c | alpha_dux?? ) \
67                 ${AS} -v  -P -DOSF -I${TOP_INCDIR} -DASSEMBLER ${srcdir}/process.s; \
68                 ${AS} -v process.i -o process.o;; \
69         ia64_hpux11* | hp_ux11* ) \
70                 ${CC} ${CFLAGS} -c ${srcdir}/process.c;; \
71         i386_*) \
72                 /lib/cpp -P -I${TOP_INCDIR} ${srcdir}/process.i386.s process.ss; \
73                 ${AS} process.ss -o process.o; \
74                 $(RM) process.ss ;; \
75         *) \
76                 /lib/cpp -P -I${TOP_INCDIR} ${srcdir}/process.s process.ss; \
77                 ${AS} process.ss -o process.o; \
78                 $(RM) process.ss ;; \
79         esac
80
81 iomgr.o         : iomgr.c lwp.h timer.h
82                 ${CC} -c ${CFLAGS} ${srcdir}/iomgr.c
83
84 preempt.o       : preempt.c lwp.h preempt.h
85 lwp.o           : lwp.c lwp.h
86         case "$(SYS_NAME)" in \
87                 rs_aix*) \
88                         $(CC) ${LWP_DBG} ${LWP_OPTMZ} -I${srcdir} -I. -I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} -c ${srcdir}/lwp.c;; \
89                 *)  \
90                         $(CC) ${CFLAGS} -c ${srcdir}/lwp.c;; \
91                 esac
92 lock.o          : lock.c lock.h lwp.h
93 timer.o         : timer.c
94 fasttime.o      : fasttime.c
95 threadname.o    : threadname.c
96
97 exc_handling.o  : exc_handling.c
98
99 #
100 # tests
101 #
102 rw: rw.o liblwp.a $(TOP_LIBDIR)/util.a
103         ${CC} ${CFLAGS} -o rw rw.o liblwp.a $(TOP_LIBDIR)/util.a
104
105 rw.o: rw.c
106         ${CC} ${CFLAGS} -c ${srcdir}/rw.c
107
108
109 #
110 # Install targets
111 #
112 install: ${DESTDIR}${libdir}/liblwp.a ${DESTDIR}${includedir}/lock.h ${DESTDIR}${includedir}/lwp.h ${DESTDIR}${includedir}/preempt.h ${DESTDIR}${includedir}/timer.h
113
114 ${DEST}/lib/liblwp.a: liblwp.a
115         ${INSTALL} $? $@
116
117 ${DEST}/include/lock.h: lock.h
118         ${INSTALL} $? $@
119
120 ${DEST}/include/lwp.h: lwp.h
121         ${INSTALL} $? $@
122
123 ${DEST}/include/preempt.h: preempt.h
124         ${INSTALL} $? $@
125
126 ${DEST}/include/timer.h: timer.h
127         ${INSTALL} $? $@
128
129 #
130 # Misc. targets
131 #
132 clean:
133         $(RM) -f *.o *.a core AFS_component_version_number.c
134
135 include ../config/Makefile.version
136 ${DESTDIR}${libdir}/liblwp.a: liblwp.a
137         ${INSTALL} $? $@
138
139 ${TOP_LIBDIR}/liblwp.a: liblwp.a
140         ${INSTALL} $? $@
141
142 ${DESTDIR}${includedir}/lock.h: lock.h
143         ${INSTALL} $? $@
144
145 ${TOP_INCDIR}/lock.h: lock.h
146         ${INSTALL} $? $@
147
148 ${DESTDIR}${includedir}/lwp.h: lwp.h
149         ${INSTALL} $? $@
150
151 ${TOP_INCDIR}/lwp.h: lwp.h
152         ${INSTALL} $? $@
153
154 ${DESTDIR}${includedir}/preempt.h: preempt.h
155         ${INSTALL} $? $@
156
157 ${TOP_INCDIR}/preempt.h: preempt.h
158         ${INSTALL} $? $@
159
160 ${DESTDIR}${includedir}/timer.h: timer.h
161         ${INSTALL} $? $@
162
163 ${TOP_INCDIR}/timer.h: timer.h
164         ${INSTALL} $? $@
165
166 dest: ${DEST}/lib/liblwp.a ${DEST}/include/lock.h ${DEST}/include/lwp.h ${DEST}/include/preempt.h ${DEST}/include/timer.h
167