s390: desupport 32-bit Linux kernels on s390/s390x
[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 # Portions Copyright (c) 2003 Apple Computer, Inc.
9
10 srcdir=@srcdir@
11 include @TOP_OBJDIR@/src/config/Makefile.config
12 include @TOP_OBJDIR@/src/config/Makefile.lwp
13 include @TOP_OBJDIR@/src/config/Makefile.lwptool
14
15 DBG=${LWP_DBG}
16 OPTMZ=${LWP_OPTMZ}
17
18 LIBOBJS=lwp.o process.o iomgr.o timer.o \
19         threadname.o AFS_component_version_number.o
20
21 LT_objs = waitkey.lo fasttime.lo lock.lo
22 LT_deps = $(top_builddir)/src/opr/liboafs_opr.la
23 LT_libs = $(MT_LIBS)
24
25 all: liboafs_lwpcompat.la liblwpcompat_pic.la \
26         ${TOP_LIBDIR}/liblwp.a depinstall
27
28 depinstall: ${TOP_INCDIR}/lock.h ${TOP_INCDIR}/lwp.h ${TOP_INCDIR}/timer.h
29
30 ${TOP_LIBDIR}/liblwp.a: liblwp.a
31         ${INSTALL_DATA} $? $@
32
33 ${TOP_INCDIR}/lock.h: lock.h
34         ${INSTALL_DATA} $? $@
35
36 ${TOP_INCDIR}/lwp.h: lwp.h
37         ${INSTALL_DATA} $? $@
38
39 ${TOP_INCDIR}/timer.h: timer.h
40         ${INSTALL_DATA} $? $@
41
42 #
43 # Build rules
44 #
45 liblwp.a: ${LIBOBJS} $(LT_objs)
46         -$(RM) -f $@
47         $(AR) crv $@ ${LIBOBJS} .lwp/waitkey.o .lwp/fasttime.o .lwp/lock.o
48         $(RANLIB) $@
49
50 liboafs_lwpcompat.la: liboafs_lwpcompat.la.sym $(LT_objs) $(LT_deps)
51         $(LT_LDLIB_shlib) $(LT_objs) $(LT_deps) $(LT_libs)
52
53 liblwpcompat_pic.la: $(LT_objs)
54         $(LT_LDLIB_pic) $(LT_objs)
55
56 # This is required so sgi_64+ does not try to build this file.
57 process.default.s:
58         @echo Nothing to be done for process.default.s
59
60 # Making process.o for $(SYS_NAME)
61 # The files "process.s" and "process.S" may be used internally,
62 # but will be removed after building the .o
63 process.o       : process.default.s process.i386.s process.amd64.s process.c lwp.o
64         @set -x; case "$(SYS_NAME)" in \
65         sun4c_51 | sun4c_52 | sun4m_51 | sun4m_52 | sun4c_53 | sun4m_53  | sun4_53 | sun4_52 | sun4_54 | sun4c_54 | sun4m_54 | sun4x_5* | arm_linux* ) \
66                 $(PATH_CPP) -P -I${TOP_INCDIR} ${srcdir}/process.default.s > process.s; \
67                 ${AS} process.s -o process.o; \
68                         $(RM) process.s ;; \
69         sgi_5* ) \
70                 cp ${srcdir}/process.default.s process.s ; \
71                 $(CCOBJ) ${LWP_DBG} ${LWP_OPTMZ} -c -I${TOP_INCDIR} -KPIC -G0  process.s; \
72                 $(RM) -f process.s ;;\
73         sgi_61 | sgi_62 | sgi_63 ) \
74                 cp ${srcdir}/process.default.s process.s ; \
75                 $(CCOBJ) ${LWP_DBG} ${LWP_OPTMZ} -c ${XCFLAGS} ${ARCHFLAGS} -I${TOP_INCDIR} -KPIC -G0  process.s; \
76                 $(RM) -f process.s ;;\
77         *_darwin* ) \
78                 $(RM) -f process.o ; \
79                 CURRENTBUILDARCH="${ARCHFLAGS}"; \
80                 if [ -z "$${CURRENTBUILDARCH}" ] ; then \
81                     CURRENTBUILDARCH=`$(CC) -dM -E -xc /dev/null | grep 'ppc\|i386\|x86_64\|arm'`; \
82                 fi; \
83                 ppc=`echo $${CURRENTBUILDARCH} | grep -q ppc && echo process.ppc.o` ; \
84                 i386=`echo $${CURRENTBUILDARCH} | grep -q i386 && echo process.i386.o` ; \
85                 amd64=`echo $${CURRENTBUILDARCH} | grep -q x86_64 && echo process.amd64.o` ; \
86                 armv6=`echo $${CURRENTBUILDARCH} | grep -q armv6 && echo process.armv6.o` ; \
87                 armv7=`echo $${CURRENTBUILDARCH} | grep -q armv7 && echo process.armv7.o` ; \
88                 if [ -z "$${ppc}" -a -z "$${i386}" -a -z "$${amd64}" -a -z "$${armv6}" -a -z "$${armv7}" ] ; then \
89                         if [ `arch` = ppc ] ; then \
90                                 ppc=yes ; \
91                         else \
92                                 i386=yes ; \
93                         fi ; \
94                 fi ; \
95                 if [ -n "$${armv6}" ] ; then \
96                         $(CC) -x assembler-with-cpp -c -arch armv6 -I${TOP_INCDIR} -I${srcdir} ${srcdir}/process.default.s -o "$${armv6}" ; \
97                         if [ -z "$${i386}" -a -z "$${amd64}" -a -z "$${ppc}" -a -z "$${armv7}" ] ; then \
98                                 ${MV} "$${armv6}" process.o ; \
99                         fi ; \
100                 fi ; \
101                 if [ -n "$${armv7}" ] ; then \
102                         $(CC) -x assembler-with-cpp -c -arch armv7 -I${TOP_INCDIR} -I${srcdir} ${srcdir}/process.default.s -o "$${armv7}" ; \
103                         if [ -z "$${i386}" -a -z "$${amd64}" -a -z "$${ppc}" -a -z "$${armv6}" ] ; then \
104                                 ${MV} "$${armv7}" process.o ; \
105                         fi ; \
106                 fi ; \
107                 if [ -n "$${ppc}" ] ; then \
108                         $(CC) ${LWP_DBG} ${LWP_OPTMZ} -c -arch ppc -I${TOP_INCDIR} ${srcdir}/process.default.s -o "$${ppc}" ; \
109                         if [ -z "$${i386}" -a -z "$${amd64}" -a -z "$${armv6}" -a -z "$${armv7}" ] ; then \
110                                 ${MV} "$${ppc}" process.o ; \
111                         fi ; \
112                 fi ; \
113                 if [ -n "$${i386}" ] ; then \
114                         $(CC) -x assembler-with-cpp -c -arch i386 -I${TOP_INCDIR} -I${srcdir} ${srcdir}/process.i386.s -o "$${i386}" ; \
115                         if [ -z "$${ppc}" -a -z "$${amd64}" -a -z "$${armv6}" -a -z "$${armv7}" ] ; then \
116                                 ${MV} "$${i386}" process.o ; \
117                         fi ; \
118                 fi ; \
119                 if [ -n "$${amd64}" ] ; then \
120                         $(CC) -x assembler-with-cpp -c -arch x86_64 -I${TOP_INCDIR} -I${srcdir} ${srcdir}/process.amd64.s -o "$${amd64}" ; \
121                         if [ -z "$${ppc}" -a -z "$${i386}" -a -z "$${armv6}" -a -z "$${armv7}" ] ; then \
122                                 ${MV} "$${amd64}" process.o ; \
123                         fi ; \
124                 fi ; \
125                 if [ ! -f process.o ] ; then \
126                         lipo -create $${amd64} $${i386} $${ppc} $${armv6} $${armv7} -output process.o ;\
127                 fi ;; \
128         i386_*bsd*) \
129                 cp ${srcdir}/process.i386.s process.S ; \
130                 ${CCOBJ} -DIGNORE_STDS_H -E -I${srcdir} -I${TOP_INCDIR} process.S > process.s ; \
131                 ${AS} process.s -o process.o ;  \
132                 $(RM) -f process.s process.S ;;\
133         amd64_*bsd*) \
134                 cp ${srcdir}/process.amd64.s process.S ; \
135                 ${CCOBJ} -DIGNORE_STDS_H -E -I${srcdir} -I${TOP_INCDIR} process.S > process.s ; \
136                 ${AS} process.s -o process.o ;  \
137                 $(RM) -f process.s process.S ;;\
138         ncrx86_* | sunx86_58 | sunx86_59 ) \
139                 $(PATH_CPP) -P -D__sun -D__i386 -DIGNORE_STDS_H -I${TOP_INCDIR} -I${srcdir} ${srcdir}/process.i386.s > process.s; \
140                 ${AS} -o process.o process.s; \
141                 $(RM) process.s ;; \
142         sunx86_510 | sunx86_511) \
143                 if [ "${ASFLAGS}" = "-m64" ] ; then \
144                         CURRENTBUILDARCH=amd64 ; \
145                 else \
146                         XCPPFLAGS="-D__i386" ; \
147                         CURRENTBUILDARCH=i386 ; \
148                 fi ; \
149                 $(PATH_CPP) $${XCPPFLAGS} -P -D__sun -DIGNORE_STDS_H -I${TOP_INCDIR} -I${srcdir} ${srcdir}/process.$${CURRENTBUILDARCH}.s > process.s ; \
150                 ${AS} ${ASFLAGS} -o process.o process.s ; \
151                 $(RM) process.s ;; \
152         alpha_nbsd* ) \
153                 $(PATH_CPP) -DASSEMBLER -P -I${TOP_INCDIR} ${srcdir}/process.default.s > process.s; \
154                 ${AS} -o process.o process.s; \
155                 $(RM) process.s ;; \
156         hp* | *_linux* | *_umlinux* | sgi_64 | sgi_65 ) \
157                 $(AFS_CCRULE_NOQ) -c ${srcdir}/process.c;; \
158         alpha_osf1 | alpha_osf20 |  alpha_osf30 | alpha_osf32 | alpha_osf32c | alpha_dux?? ) \
159                 ${AS} -v  -P -DOSF -I${TOP_INCDIR} -DASSEMBLER ${srcdir}/process.default.s; \
160                 ${AS} -v process.i -o process.o;; \
161         ia64_hpux11* | hp_ux11* ) \
162                 $(AFS_CCRULE_NOQ) -c ${srcdir}/process.c;; \
163         i386_*) \
164                 $(PATH_CPP) -P -I${TOP_INCDIR} -I${srcdir} ${srcdir}/process.i386.s > process.s; \
165                 ${AS} process.s -o process.o; \
166                 $(RM) process.s ;; \
167         *) \
168                 $(PATH_CPP) -P -I${TOP_INCDIR} ${srcdir}/process.default.s > process.s; \
169                 ${AS} process.s -o process.o; \
170                 $(RM) process.s ;; \
171         esac
172
173 iomgr.o         : iomgr.c lwp.h timer.h
174 lwp.o           : lwp.c lwp.h
175         case "$(SYS_NAME)" in \
176                 rs_aix*) \
177                         $(CCOBJ) ${LWP_DBG} ${LWP_OPTMZ} -I${srcdir} -I. -I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} -c ${srcdir}/lwp.c;; \
178                 *)  \
179                         $(AFS_CCRULE_NOQ) ${srcdir}/lwp.c;; \
180                 esac
181 lock.lo         : lock.c lock.h lwp.h
182 timer.o         : timer.c
183 fasttime.lo     : fasttime.c
184 threadname.o    : threadname.c
185
186 exc_handling.o  : exc_handling.c
187
188 #
189 # tests
190 #
191 rw: rw.o liblwp.a $(TOP_LIBDIR)/util.a $(TOP_LIBDIR)/libopr.a
192         $(AFS_LDRULE) rw.o liblwp.a $(TOP_LIBDIR)/util.a $(TOP_LIBDIR)/libopr.a
193
194 #
195 # Install targets
196 #
197 install: liblwp.a lock.h lwp.h timer.h
198         ${INSTALL} -d ${DESTDIR}${libdir}
199         ${INSTALL} -d ${DESTDIR}${includedir}
200         ${INSTALL_DATA} liblwp.a ${DESTDIR}${libdir}/liblwp.a
201         ${INSTALL_DATA} ${srcdir}/lock.h ${DESTDIR}${includedir}/lock.h
202         ${INSTALL_DATA} ${srcdir}/lwp.h ${DESTDIR}${includedir}/lwp.h
203         ${INSTALL_DATA} ${srcdir}/timer.h ${DESTDIR}${includedir}/timer.h
204
205 dest: liblwp.a lock.h lwp.h timer.h
206         ${INSTALL} -d ${DEST}/lib
207         ${INSTALL} -d ${DEST}/include
208         ${INSTALL_DATA} liblwp.a ${DEST}/lib/liblwp.a
209         ${INSTALL_DATA} ${srcdir}/lock.h ${DEST}/include/lock.h
210         ${INSTALL_DATA} ${srcdir}/lwp.h ${DEST}/include/lwp.h
211         ${INSTALL_DATA} ${srcdir}/timer.h ${DEST}/include/timer.h
212
213 buildtools: ${TOP_LIBDIR}/liblwp.a depinstall
214
215 #
216 # Misc. targets
217 #
218 clean:
219         $(LT_CLEAN)
220         $(RM) -f *.o *.a core AFS_component_version_number.c
221
222 include ../config/Makefile.version