Build system: Move install definitions to include
[openafs.git] / src / roken / Makefile.in
1 # A roken library for AFS
2
3 LIBMAJOR=1
4 LIBMINOR=1
5
6 srcdir=@srcdir@
7 include @TOP_OBJDIR@/src/config/Makefile.config
8 include @TOP_OBJDIR@/src/config/Makefile.shared
9
10
11 HEADERS = ${TOP_INCDIR}/base64.h \
12           ${TOP_INCDIR}/roken.h \
13           ${TOP_INCDIR}/roken-common.h
14
15 UPSTREAM = $(TOP_SRCDIR)/external/heimdal/roken
16
17 SHLIBOBJ = librokenafs.${SHLIB_SUFFIX}.${LIBMAJOR}.${LIBMINOR}
18
19 all: $(ROKEN_HEADERS) $(HEADERS) \
20         $(TOP_LIBDIR)/$(SHLIBOBJ) \
21         $(TOP_LIBDIR)/librokenafs.a
22
23 install: librokenafs.a $(SHLIBOBJ)
24         $(TOP_OBJDIR)/src/config/shlib-install -d $(DESTDIR)$(libdir) \
25                 -l librokenafs -M $(LIBMAJOR) -m $(LIBMINOR)
26         $(INSTALL_DATA) librokenafs.a $(DESTDIR)$(libdir)/librokenafs.a
27
28 dest: librokenafs.a $(SHLIBOBJ)
29         $(TOP_OBJDIR)/src/config/shlib-install -d $(DEST)/lib \
30                 -l librokenafs -M $(LIBMAJOR) -m $(LIBMINOR)
31         $(INSTALL_DATA) librokenafs.a $(DEST)/lib/librokenafs.a
32
33 clean:
34         $(RM) -f $(OBJECTS) $(SHLIBOBJ) librokenafs.a librokenafs.exp \
35                 err.h
36
37 OBJECTS = $(ROKEN_LIBOBJS) \
38           base64.o \
39           cloexec.o ct.o hex.o issuid.o net_read.o net_write.o socket.o \
40           snprintf.o warnerr.o
41
42 $(TOP_LIBDIR)/$(SHLIBOBJ): $(SHLIBOBJ)
43         $(TOP_OBJDIR)/src/config/shlib-install -d $(TOP_LIBDIR) \
44                 -l librokenafs -M $(LIBMAJOR) -m $(LIBMINOR)
45
46 $(SHLIBOBJ): $(OBJECTS) librokenafs.map
47         $(TOP_OBJDIR)/src/config/shlib-build -i -d $(srcdir) -l librokenafs \
48                 -M $(LIBMAJOR) -m $(LIBMINOR) -- \
49                 $(OBJECTS) $(MT_LIBS)
50
51 $(TOP_LIBDIR)/librokenafs.a: librokenafs.a
52         $(INSTALL_DATA) $? $@
53
54 librokenafs.a: $(OBJECTS)
55         $(RM) -f $@
56         $(AR) crv $@ $(OBJECTS)
57         $(RANLIB) $@
58
59 $(TOP_INCDIR)/base64.h: ${UPSTREAM}/base64.h
60         $(INSTALL_DATA) $? $@
61
62 $(TOP_INCDIR)/err.h: ${UPSTREAM}/err.hin
63         cp $? $@
64
65 $(TOP_INCDIR)/roken.h: $(UPSTREAM)/roken.h.in
66         $(INSTALL_DATA) $? $@
67
68 $(TOP_INCDIR)/roken-common.h: $(UPSTREAM)/roken-common.h
69         $(INSTALL_DATA) $? $@
70
71 err.h: ${UPSTREAM}/err.hin
72         cp $? $@
73
74 base64.o: $(UPSTREAM)/base64.c
75         $(AFS_CCRULE) $(UPSTREAM)/base64.c
76
77 cloexec.o: ${UPSTREAM}/cloexec.c
78         $(AFS_CCRULE) $(UPSTREAM)/cloexec.c
79
80 ct.o: ${UPSTREAM}/ct.c
81         $(AFS_CCRULE) $(UPSTREAM)/ct.c
82
83 daemon.o: ${UPSTREAM}/daemon.c
84         $(AFS_CCRULE) $(UPSTREAM)/daemon.c
85
86 ecalloc.o: ${UPSTREAM}/ecalloc.c
87         $(AFS_CCRULE) $(UPSTREAM)/ecalloc.c
88
89 emalloc.o: ${UPSTREAM}/emalloc.c
90         $(AFS_CCRULE) $(UPSTREAM)/emalloc.c
91
92 erealloc.o: ${UPSTREAM}/erealloc.c
93         $(AFS_CCRULE) $(UPSTREAM)/erealloc.c
94
95 err.o: ${UPSTREAM}/err.c err.h
96         $(AFS_CCRULE) $(UPSTREAM)/err.c
97
98 errx.o: ${UPSTREAM}/errx.c err.h
99         $(AFS_CCRULE) $(UPSTREAM)/errx.c
100
101 flock.o: ${UPSTREAM}/flock.c
102         $(AFS_CCRULE) $(UPSTREAM)/flock.c
103
104 getopt.o: ${UPSTREAM}/getopt.c
105         $(AFS_CCRULE) $(UPSTREAM)/getopt.c
106
107 getprogname.o: ${UPSTREAM}/getprogname.c
108         $(AFS_CCRULE) $(UPSTREAM)/getprogname.c
109
110 hex.o: ${UPSTREAM}/hex.c
111         $(AFS_CCRULE) $(UPSTREAM)/hex.c
112
113 issuid.o: ${UPSTREAM}/issuid.c
114         $(AFS_CCRULE) $(UPSTREAM)/issuid.c
115
116 mkstemp.o: ${UPSTREAM}/mkstemp.c
117         $(AFS_CCRULE) $(UPSTREAM)/mkstemp.c
118
119 net_read.o: ${UPSTREAM}/net_read.c
120         $(AFS_CCRULE) $(UPSTREAM)/net_read.c
121
122 net_write.o: ${UPSTREAM}/net_write.c
123         $(AFS_CCRULE) $(UPSTREAM)/net_write.c
124
125 socket.o: ${UPSTREAM}/socket.c
126         $(AFS_CCRULE) $(UPSTREAM)/socket.c
127
128 # The upstream snprintf.c has some pointer warnings in it
129 CFLAGS_snprintf.o = @CFLAGS_NOERROR@
130
131 snprintf.o: ${UPSTREAM}/snprintf.c
132         $(AFS_CCRULE) $(UPSTREAM)/snprintf.c
133
134 strlcat.o: ${UPSTREAM}/strlcat.c
135         $(AFS_CCRULE) $(UPSTREAM)/strlcat.c
136
137 strlcpy.o: ${UPSTREAM}/strlcpy.c
138         $(AFS_CCRULE) $(UPSTREAM)/strlcpy.c
139
140 strnlen.o: ${UPSTREAM}/strnlen.c
141         $(AFS_CCRULE) $(UPSTREAM)/strnlen.c
142
143 strsep.o: ${UPSTREAM}/strsep.c
144         $(AFS_CCRULE) $(UPSTREAM)/strsep.c
145
146 verr.o: ${UPSTREAM}/verr.c err.h
147         $(AFS_CCRULE) $(UPSTREAM)/verr.c
148
149 verrx.o: ${UPSTREAM}/verrx.c err.h
150         $(AFS_CCRULE) $(UPSTREAM)/verrx.c
151
152 vsyslog.o: ${UPSTREAM}/vsyslog.c
153         $(AFS_CCRULE) $(UPSTREAM)/vsyslog.c
154
155 vwarn.o: ${UPSTREAM}/vwarn.c err.h
156         $(AFS_CCRULE) $(UPSTREAM)/vwarn.c
157
158 vwarnx.o: ${UPSTREAM}/vwarnx.c err.h
159         $(AFS_CCRULE) $(UPSTREAM)/vwarnx.c
160
161 warn.o: ${UPSTREAM}/warn.c err.h
162         $(AFS_CCRULE) $(UPSTREAM)/warn.c
163
164 warnerr.o: ${UPSTREAM}/warnerr.c err.h
165         $(AFS_CCRULE) $(UPSTREAM)/warnerr.c
166
167 warnx.o: ${UPSTREAM}/warnx.c err.h
168         $(AFS_CCRULE) $(UPSTREAM)/warnx.c