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