solaris-x86-20020611
[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
12 # this is important code, so let's optimize it.  The optimizer aggravates any
13 # subtle bugs that may have been introduced in process.s, be warned!
14 OPTIMIZE=${LWP_OPTMZ}
15
16 CFLAGS=${OPTIMIZE} -I. -I${srcdir} -I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} ${XCFLAGS}
17
18 LIBOBJS=lwp.o process.o lock.o iomgr.o timer.o fasttime.o preempt.o \
19         waitkey.o threadname.o AFS_component_version_number.o
20
21 all: ${TOP_LIBDIR}/liblwp.a ${TOP_INCDIR}/lock.h ${TOP_INCDIR}/lwp.h ${TOP_INCDIR}/preempt.h ${TOP_INCDIR}/timer.h
22
23 #
24 # Build rules
25 #
26 liblwp.a: ${LIBOBJS}
27         -$(RM) -f $@
28         $(AR) crv $@ ${LIBOBJS}
29         $(RANLIB) $@
30
31 process.s:
32         echo Nothing to be done for process.s
33         # This is required so sgi_64+ does not try to build this file.
34
35 process.o       : process.s process.c
36         @case "$(SYS_NAME)" in \
37         pmax_he1) \
38                 $(CC) -c -I${TOP_INCDIR} process.s;; \
39         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_5?) \
40                 /usr/ccs/lib/cpp -P -I${TOP_INCDIR} process.s process.ss; \
41                 ${AS} process.ss -o process.o; \
42                         $(RM) process.ss ;; \
43         sgi_5* ) \
44                 $(CC) -c -I${TOP_INCDIR} -KPIC -G0  ${srcdir}/process.s;; \
45         sgi_61 | sgi_62 | sgi_63 ) \
46                 $(CC) -c ${XCFLAGS} -I${TOP_INCDIR} -KPIC -G0  ${srcdir}/process.s;; \
47         s390*) \
48                 /lib/cpp -P -I${TOP_INCDIR} ${srcdir}/process.s >process.ss; \
49                 ${AS} -ahlns process.ss -o process.o >process.lst; \
50                 $(RM) process.ss ;; \
51         ppc_darwin* ) \
52                 $(CC) -c ${XCFLAGS} -I${TOP_INCDIR} ${srcdir}/process.s;; \
53         i386_fbsd*|i386_nbsd* ) \
54                 /usr/bin/cpp -P ${srcdir}/process.fbsd.s > process.ss; \
55                 ${AS} -o process.o process.ss; \
56                 $(RM) process.ss ;; \
57         alpha_nbsd* ) \
58                 /usr/bin/cpp -DASSEMBLER -P -I${TOP_INCDIR} ${srcdir}/process.s > process.ss; \
59                 ${AS} -o process.o process.ss; \
60                 $(RM) process.ss ;; \
61         hp* | *_linux* | sgi_64 | sgi_65 ) \
62                 ${CC} ${CFLAGS} -c ${srcdir}/process.c;; \
63         ncrx86_*) \
64                 /usr/ccs/lib/cpp -P -I${TOP_INCDIR} ${srcdir}/process.s process.ss; \
65                 ${AS} -o process.o process.ss; \
66                 $(RM) process.ss ;; \
67         alpha_osf1 | alpha_osf20 |  alpha_osf30 | alpha_osf32 | alpha_osf32c | alpha_dux?? ) \
68                 ${AS} -v  -P -DOSF -I${TOP_INCDIR} -DASSEMBLER ${srcdir}/process.s; \
69                 ${AS} -v process.i -o process.o;; \
70         *_obsd* ) \
71                 cp ${srcdir}/process.s process.S ; \
72                 ${CC} -E -I${TOP_INCDIR} process.S >process.ss ; \
73                 ${AS} process.ss -o process.o ;  \
74                 $(RM) -f process.S ;;\
75         hp_ux110 ) \
76                 ${CC} ${CFLAGS} -c ${srcdir}/process.c;; \
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                 ${CC} -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                         $(CC) -I${srcdir} -I. -I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} -c ${srcdir}/lwp.c;; \
91                 *)  \
92                         $(CC) ${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