sun-x86-20030623
[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.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_obsd31 | i386_obsd32 | i386_obsd33 ) \
51                 cp ${srcdir}/process.i386.s process.S ; \
52                 ${CC} -E -I${TOP_INCDIR} process.S >process.ss ; \
53                 ${AS} process.ss -o process.o ;  \
54                 $(RM) -f process.S ;;\
55         i386_*bsd* ) \
56                 /usr/bin/cpp -P ${srcdir}/process.i386.s > process.ss; \
57                 ${AS} -o process.o process.ss; \
58                 $(RM) process.ss ;; \
59         ncrx86_* | sunx86_*) \
60                 /usr/ccs/lib/cpp -P -I${TOP_INCDIR} ${srcdir}/process.i386.s process.ss; \
61                 ${AS} -o process.o process.ss; \
62                 $(RM) process.ss ;; \
63         alpha_nbsd* ) \
64                 /usr/bin/cpp -DASSEMBLER -P -I${TOP_INCDIR} ${srcdir}/process.s > process.ss; \
65                 ${AS} -o process.o process.ss; \
66                 $(RM) process.ss ;; \
67         hp* | *_linux* | *_umlinux* | sgi_64 | sgi_65 ) \
68                 ${CC} ${CFLAGS} -c ${srcdir}/process.c;; \
69         alpha_osf1 | alpha_osf20 |  alpha_osf30 | alpha_osf32 | alpha_osf32c | alpha_dux?? ) \
70                 ${AS} -v  -P -DOSF -I${TOP_INCDIR} -DASSEMBLER ${srcdir}/process.s; \
71                 ${AS} -v process.i -o process.o;; \
72         ia64_hpux11* | hp_ux11* ) \
73                 ${CC} ${CFLAGS} -c ${srcdir}/process.c;; \
74         i386_*) \
75                 /lib/cpp -P -I${TOP_INCDIR} ${srcdir}/process.i386.s process.ss; \
76                 ${AS} process.ss -o process.o; \
77                 $(RM) process.ss ;; \
78         *) \
79                 /lib/cpp -P -I${TOP_INCDIR} ${srcdir}/process.s process.ss; \
80                 ${AS} process.ss -o process.o; \
81                 $(RM) process.ss ;; \
82         esac
83
84 iomgr.o         : iomgr.c lwp.h timer.h
85                 ${CC} -c ${CFLAGS} ${srcdir}/iomgr.c
86
87 preempt.o       : preempt.c lwp.h preempt.h
88 lwp.o           : lwp.c lwp.h
89         case "$(SYS_NAME)" in \
90                 rs_aix*) \
91                         $(CC) ${LWP_DBG} ${LWP_OPTMZ} -I${srcdir} -I. -I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} -c ${srcdir}/lwp.c;; \
92                 *)  \
93                         $(CC) ${CFLAGS} -c ${srcdir}/lwp.c;; \
94                 esac
95 lock.o          : lock.c lock.h lwp.h
96 timer.o         : timer.c
97 fasttime.o      : fasttime.c
98 threadname.o    : threadname.c
99
100 exc_handling.o  : exc_handling.c
101
102 #
103 # tests
104 #
105 rw: rw.o liblwp.a $(TOP_LIBDIR)/util.a
106         ${CC} ${CFLAGS} -o rw rw.o liblwp.a $(TOP_LIBDIR)/util.a
107
108 rw.o: rw.c
109         ${CC} ${CFLAGS} -c ${srcdir}/rw.c
110
111
112 #
113 # Install targets
114 #
115 install: ${DESTDIR}${libdir}/liblwp.a ${DESTDIR}${includedir}/lock.h ${DESTDIR}${includedir}/lwp.h ${DESTDIR}${includedir}/preempt.h ${DESTDIR}${includedir}/timer.h
116
117 ${DEST}/lib/liblwp.a: liblwp.a
118         ${INSTALL} $? $@
119
120 ${DEST}/include/lock.h: lock.h
121         ${INSTALL} $? $@
122
123 ${DEST}/include/lwp.h: lwp.h
124         ${INSTALL} $? $@
125
126 ${DEST}/include/preempt.h: preempt.h
127         ${INSTALL} $? $@
128
129 ${DEST}/include/timer.h: timer.h
130         ${INSTALL} $? $@
131
132 #
133 # Misc. targets
134 #
135 clean:
136         $(RM) -f *.o *.a core AFS_component_version_number.c
137
138 include ../config/Makefile.version
139 ${DESTDIR}${libdir}/liblwp.a: liblwp.a
140         ${INSTALL} $? $@
141
142 ${TOP_LIBDIR}/liblwp.a: liblwp.a
143         ${INSTALL} $? $@
144
145 ${DESTDIR}${includedir}/lock.h: lock.h
146         ${INSTALL} $? $@
147
148 ${TOP_INCDIR}/lock.h: lock.h
149         ${INSTALL} $? $@
150
151 ${DESTDIR}${includedir}/lwp.h: lwp.h
152         ${INSTALL} $? $@
153
154 ${TOP_INCDIR}/lwp.h: lwp.h
155         ${INSTALL} $? $@
156
157 ${DESTDIR}${includedir}/preempt.h: preempt.h
158         ${INSTALL} $? $@
159
160 ${TOP_INCDIR}/preempt.h: preempt.h
161         ${INSTALL} $? $@
162
163 ${DESTDIR}${includedir}/timer.h: timer.h
164         ${INSTALL} $? $@
165
166 ${TOP_INCDIR}/timer.h: timer.h
167         ${INSTALL} $? $@
168
169 dest: ${DEST}/lib/liblwp.a ${DEST}/include/lock.h ${DEST}/include/lwp.h ${DEST}/include/preempt.h ${DEST}/include/timer.h
170