4dfd8284de7643f5e2452a67b9932236328d192b
[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 # This is required so sgi_64+ does not try to build this file.
31 process.s:
32         echo Nothing to be done for process.s
33
34 # Making process.o for $(SYS_NAME)
35 process.o       : process.s process.i386.s process.c
36         @case "$(SYS_NAME)" in \
37         pmax_he1) \
38                 $(CCOBJ) ${LWP_DBG} ${LWP_OPTMZ} -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* ) \
40                 /usr/ccs/lib/cpp -P -I${TOP_INCDIR} ${srcdir}/process.s process.ss; \
41                 ${AS} process.ss -o process.o; \
42                         $(RM) process.ss ;; \
43         sgi_5* ) \
44                 $(CCOBJ) ${LWP_DBG} ${LWP_OPTMZ} -c -I${TOP_INCDIR} -KPIC -G0  ${srcdir}/process.s;; \
45         sgi_61 | sgi_62 | sgi_63 ) \
46                 $(CCOBJ) ${LWP_DBG} ${LWP_OPTMZ} -c ${XCFLAGS} -I${TOP_INCDIR} -KPIC -G0  ${srcdir}/process.s;; \
47         s390_*) \
48                 /lib/cpp -P -I${TOP_INCDIR} ${srcdir}/process.s390.s >process.ss; \
49                 ${AS} -ahlns process.ss -o process.o >process.lst; \
50                 $(RM) process.ss ;; \
51         s390x_*) \
52                 /lib/cpp -P -I${TOP_INCDIR} ${srcdir}/process.s390x.s >process.ss; \
53                 ${AS} -ahlns process.ss -o process.o >process.lst; \
54                 $(RM) process.ss ;; \
55         ppc_darwin* ) \
56                 $(CC) ${LWP_DBG} ${LWP_OPTMZ} -c ${XCFLAGS} -I${TOP_INCDIR} ${srcdir}/process.s;; \
57         x86_darwin*) \
58                 /usr/bin/cpp -P -I${TOP_INCDIR} -I${srcdir} ${srcdir}/process.i386.s process.ss; \
59                 ${AS} process.ss -o process.o; \
60                 $(RM) process.ss ;; \
61         i386_*bsd*) \
62                 cp ${srcdir}/process.i386.s process.S ; \
63                 ${CCOBJ} -DIGNORE_STDS_H -E -I${srcdir} -I${TOP_INCDIR} process.S > process.ss ; \
64                 ${AS} process.ss -o process.o ;  \
65                 $(RM) -f process.S ;;\
66         amd64_*bsd*) \
67                 cp ${srcdir}/process.amd64.s process.S ; \
68                 ${CCOBJ} -DIGNORE_STDS_H -E -I${srcdir} -I${TOP_INCDIR} process.S > process.ss ; \
69                 ${AS} process.ss -o process.o ;  \
70                 $(RM) -f process.S ;;\
71         ncrx86_* | sunx86_*) \
72                 /usr/ccs/lib/cpp -P -D__sun -D__i386 -DIGNORE_STDS_H -I${TOP_INCDIR} -I${srcdir} ${srcdir}/process.i386.s process.ss; \
73                 ${AS} -o process.o process.ss; \
74                 $(RM) process.ss ;; \
75         alpha_nbsd* ) \
76                 /usr/bin/cpp -DASSEMBLER -P -I${TOP_INCDIR} ${srcdir}/process.s > process.ss; \
77                 ${AS} -o process.o process.ss; \
78                 $(RM) process.ss ;; \
79         hp* | *_linux* | *_umlinux* | sgi_64 | sgi_65 ) \
80                 ${CCOBJ} ${CFLAGS} -c ${srcdir}/process.c;; \
81         alpha_osf1 | alpha_osf20 |  alpha_osf30 | alpha_osf32 | alpha_osf32c | alpha_dux?? ) \
82                 ${AS} -v  -P -DOSF -I${TOP_INCDIR} -DASSEMBLER ${srcdir}/process.s; \
83                 ${AS} -v process.i -o process.o;; \
84         ia64_hpux11* | hp_ux11* ) \
85                 ${CC} ${CFLAGS} -c ${srcdir}/process.c;; \
86         i386_*) \
87                 /lib/cpp -P -I${TOP_INCDIR} -I${srcdir} ${srcdir}/process.i386.s process.ss; \
88                 ${AS} process.ss -o process.o; \
89                 $(RM) process.ss ;; \
90         *) \
91                 /lib/cpp -P -I${TOP_INCDIR} ${srcdir}/process.s process.ss; \
92                 ${AS} process.ss -o process.o; \
93                 $(RM) process.ss ;; \
94         esac
95
96 iomgr.o         : iomgr.c lwp.h timer.h
97                 ${CCOBJ} -c ${CFLAGS} ${srcdir}/iomgr.c
98
99 preempt.o       : preempt.c lwp.h preempt.h
100 lwp.o           : lwp.c lwp.h
101         case "$(SYS_NAME)" in \
102                 rs_aix*) \
103                         $(CCOBJ) ${LWP_DBG} ${LWP_OPTMZ} -I${srcdir} -I. -I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} -c ${srcdir}/lwp.c;; \
104                 *)  \
105                         $(CCOBJ) ${CFLAGS} -c ${srcdir}/lwp.c;; \
106                 esac
107 lock.o          : lock.c lock.h lwp.h
108 timer.o         : timer.c
109 fasttime.o      : fasttime.c
110 threadname.o    : threadname.c
111
112 exc_handling.o  : exc_handling.c
113
114 #
115 # tests
116 #
117 rw: rw.o liblwp.a $(TOP_LIBDIR)/util.a
118         ${CC} ${CFLAGS} -o rw rw.o liblwp.a $(TOP_LIBDIR)/util.a
119
120 rw.o: rw.c
121         ${CC} ${CFLAGS} -c ${srcdir}/rw.c
122
123
124 #
125 # Install targets
126 #
127 install: ${DESTDIR}${libdir}/liblwp.a ${DESTDIR}${includedir}/lock.h ${DESTDIR}${includedir}/lwp.h ${DESTDIR}${includedir}/preempt.h ${DESTDIR}${includedir}/timer.h
128
129 ${DEST}/lib/liblwp.a: liblwp.a
130         ${INSTALL} $? $@
131
132 ${DEST}/include/lock.h: lock.h
133         ${INSTALL} $? $@
134
135 ${DEST}/include/lwp.h: lwp.h
136         ${INSTALL} $? $@
137
138 ${DEST}/include/preempt.h: preempt.h
139         ${INSTALL} $? $@
140
141 ${DEST}/include/timer.h: timer.h
142         ${INSTALL} $? $@
143
144 #
145 # Misc. targets
146 #
147 clean:
148         $(RM) -f *.o *.a core AFS_component_version_number.c
149
150 include ../config/Makefile.version
151 ${DESTDIR}${libdir}/liblwp.a: liblwp.a
152         ${INSTALL} $? $@
153
154 ${TOP_LIBDIR}/liblwp.a: liblwp.a
155         ${INSTALL} $? $@
156
157 ${DESTDIR}${includedir}/lock.h: lock.h
158         ${INSTALL} $? $@
159
160 ${TOP_INCDIR}/lock.h: lock.h
161         ${INSTALL} $? $@
162
163 ${DESTDIR}${includedir}/lwp.h: lwp.h
164         ${INSTALL} $? $@
165
166 ${TOP_INCDIR}/lwp.h: lwp.h
167         ${INSTALL} $? $@
168
169 ${DESTDIR}${includedir}/preempt.h: preempt.h
170         ${INSTALL} $? $@
171
172 ${TOP_INCDIR}/preempt.h: preempt.h
173         ${INSTALL} $? $@
174
175 ${DESTDIR}${includedir}/timer.h: timer.h
176         ${INSTALL} $? $@
177
178 ${TOP_INCDIR}/timer.h: timer.h
179         ${INSTALL} $? $@
180
181 dest: ${DEST}/lib/liblwp.a ${DEST}/include/lock.h ${DEST}/include/lwp.h ${DEST}/include/preempt.h ${DEST}/include/timer.h
182