libjuafs-target-20020611
[openafs.git] / src / libuafs / MakefileProto.LINUX.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 # MakefileProto for LINUX systems
12 # This Makefile generates two libraries: the standard libuafs and libjuafs,
13 # a libuafs variant that is designed to link with Java enabled libraries.
14 # The libjuafs library implements the AFS_WEB_ENHANCEMENTS definition, see
15 # the libuafs README for details.
16
17 # System specific build commands and flags
18 CC = gcc
19 DEFINES= -D_REENTRANT -DKERNEL -DUKERNEL
20 KOPTS=
21 CFLAGS=-I. -I.. -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBUG}
22 OPTF=-O
23 # WEBOPTS = -I../nsapi -DNETSCAPE_NSAPI -DNET_SSL -DXP_UNIX -DMCC_HTTPD
24
25 TEST_CFLAGS=-pthread -D_REENTRANT -DAFS_PTHREAD_ENV -DAFS_LINUX22_ENV
26 TEST_LDFLAGS=
27 TEST_LIBS=-lpthread
28
29 LIBUAFS = libuafs.a
30 LIBJUAFS = libjuafs.a
31 LIBAFSWEB = nsafs.so
32 LIBAFSWEBKRB = nsafs.krb.so
33
34 include Makefile.common
35
36 setup_common:
37         -$(RM) -f  h net netinet rpc ufs nfs  machine sys inet nsapi
38         -ln -s /usr/include/sys h
39         -ln -s /usr/include/net net
40         -ln -s /usr/include/netinet netinet
41         -ln -s /usr/include/rpc rpc
42         -ln -s /usr/include/sys sys
43         -ln -s /usr/include/nfs nfs
44         -ln -s /usr/include/inet inet
45         -ln -s /usr/include/ufs ufs
46         -ln -s $(NS_INCL) nsapi
47
48 setup_uafs: UAFS setup_common
49         -$(RM) -f UAFS/Makefile UAFS/Makefile.common
50         ln -s ../Makefile UAFS/Makefile
51         ln -s ../Makefile.common UAFS/Makefile.common
52
53 setup_juafs: JUAFS setup_common
54         -$(RM) -f JUAFS/Makefile JUAFS/Makefile.common
55         ln -s ../Makefile JUAFS/Makefile
56         ln -s ../Makefile.common JUAFS/Makefile.common
57
58 UAFS:
59         mkdir -p $@
60
61 JUAFS:
62         mkdir -p $@
63
64 setup_nsafs: AFSWEB setup_common
65         -$(RM) -f AFSWEB/Makefile AFSWEB/Makefile.common
66         ln -s ../Makefile AFSWEB/Makefile
67         ln -s ../Makefile.common AFSWEB/Makefile.common
68
69 AFSWEB:
70         mkdir -p $@
71
72 UAFS/$(LIBUAFS): setup_uafs
73         cd UAFS; \
74         export LIBJUAFS_FLAGS=; \
75         $(MAKE) $(LIBUAFS) DESTDIR=${DESTDIR}
76
77 JUAFS/$(LIBJUAFS): setup_juafs
78         cd JUAFS; \
79         export LIBJUAFS_FLAGS=-DAFS_WEB_ENHANCEMENTS; \
80         $(MAKE) $(LIBJUAFS) DESTDIR=${DESTDIR}
81
82 AFSWEB/$(LIBAFSWEB): setup_nsafs
83         cd AFSWEB; \
84         $(MAKE) $(LIBAFSWEB) DESTDIR=${DESTDIR}
85
86 AFSWEB/$(LIBAFSWEBKRB): setup_nsafs
87         cd AFSWEB; \
88         $(MAKE) $(LIBAFSWEBKRB) DESTDIR=${DESTDIR}
89
90 # Below this line are targets when in the COMMON directory:
91
92 $(LIBUAFS): $(UAFSOBJ)
93         -$(RM) -f $(LIBUAFS)
94         $(AR) $(ARFLAGS) $(LIBUAFS) $(UAFSOBJ)
95
96 $(LIBJUAFS): $(JUAFSOBJ)
97         -$(RM) -f $(LIBJUAFS)
98         $(AR) $(ARFLAGS) $(LIBJUAFS) $(JUAFSOBJ)
99
100 $(LIBAFSWEB): $(AFSWEBOBJ) ${DES}/libdes.a
101         -$(RM) -f $(LIBAFSWEB)
102         ld -b $(LIBAFSWEB) $(AFSWEBOBJ) ${DES}/libdes.a $(WEBLIBS)
103
104 $(LIBAFSWEBKRB): $(AFSWEBOBJKRB) ${DES}/libdes.a
105         -$(RM) -f $(LIBAFSWEBKRB)
106         ld -b $(LIBAFSWEBKRB) $(AFSWEBOBJKRB) ${DES}/libdes.a $(WEBLIBS)
107
108
109
110
111
112