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