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