summaryrefslogtreecommitdiff
path: root/libcap/RCS/Makefile,v
blob: 098675e0094d43e00fa8193926e89a2a06d33b4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
head	1.5;
access;
symbols;
locks; strict;
comment	@# @;


1.5
date	98.05.24.22.54.09;	author morgan;	state Exp;
branches;
next	1.4;

1.4
date	97.05.14.05.17.13;	author morgan;	state Exp;
branches;
next	1.3;

1.3
date	97.05.04.05.34.59;	author morgan;	state Exp;
branches;
next	1.2;

1.2
date	97.04.28.00.57.11;	author morgan;	state Exp;
branches;
next	1.1;

1.1
date	97.04.21.04.33.29;	author morgan;	state Exp;
branches;
next	;


desc
@first take
@


1.5
log
@updated for 2.1.104
@
text
@##
## $Log: Makefile,v $
## Revision 1.4  1997/05/14 05:17:13  morgan
## autoconf rearrangement from Zefram
##
## Revision 1.3  1997/05/04 05:34:59  morgan
## cleaner
##
## Revision 1.2  1997/04/28 00:57:11  morgan
## fixes and zefram's patches
##
## Revision 1.1  1997/04/21 04:33:29  morgan
## Initial revision
##
##
##

#
# defines
#
topdir=$(shell pwd)/..
include ../Make.Rules
#
# Library version
#
LIBNAME=libcap.so
#

FILES=cap_alloc cap_proc cap_extint cap_flag cap_text cap_sys

# for later when there is filesystem support for cap's:
#FILES += cap_file 

INCLS=libcap.h cap_names.h $(INCS)
OBJS=$(addsuffix .o, $(FILES))
MAJLIBNAME=$(LIBNAME).$(VERSION)
MINLIBNAME=$(MAJLIBNAME).$(MINOR)

all: $(MINLIBNAME)

_makenames: _makenames.c cap_names.sed
	$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@@

cap_names.h: _makenames
	./_makenames > cap_names.h

cap_names.sed: Makefile /usr/include/linux/capability.h
	@@echo "=> making cap_names.c from <linux/capability.h>"
	@@sed -ne '/^#define[ \t]CAP[_A-Z]\+[ \t]\+[0-9]\+/{s/^#define \([^ \t]*\)[ \t]*\([^ \t]*\)/  \{ \2, \"\1\" \},/;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;p;}' < /usr/include/linux/capability.h | fgrep -v 0x > cap_names.sed
#	@@sed -ne '/^#define[ \t]CAP[_A-Z]\+[ \t]\+[0-9]\+/{s/^#define CAP_\([^ \t]*\)[ \t]*\([^ \t]*\)/  \{ \2, \"\1\" \},/;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;p;}' < /usr/include/linux/capability.h | fgrep -v 0x > cap_names.sed

$(MINLIBNAME): $(OBJS)
	$(LD) -soname $(MAJLIBNAME) -x -shared -o $@@ $(OBJS)
	ln -sf $(MINLIBNAME) $(MAJLIBNAME)
	ln -sf $(MAJLIBNAME) $(LIBNAME)

%.o: %.c $(INCLS)
	$(CC) $(CFLAGS) -c $< -o $@@

install: all
	mkdir -p -m 0755 $(INCDIR)/sys
	install -m 0644 include/sys/capability.h $(INCDIR)/sys
	mkdir -p -m 0755 $(LIBDIR)
	install -m 0644 $(MINLIBNAME) $(LIBDIR)/$(MINLIBNAME)
	ln -sf $(MINLIBNAME) $(LIBDIR)/$(MAJLIBNAME)
	ln -sf $(MAJLIBNAME) $(LIBDIR)/$(LIBNAME)
	-/sbin/ldconfig

clean:
	$(LOCALCLEAN)
	rm -f $(OBJS) $(LIBNAME)*
	rm -f cap_names.h cap_names.sed _makenames
	cd include/sys && $(LOCALCLEAN)

@


1.4
log
@autoconf rearrangement from Zefram
@
text
@d3 3
d29 4
a32 2
FILES=cap_alloc cap_file cap_proc cap_extint cap_flag cap_text cap_sys \
	cap_names
d34 1
a34 1
INCLS=libcap.h $(INCS)
d44 2
a45 2
cap_names.c: _makenames
	./_makenames > cap_names.c
d49 2
a50 1
	@@sed -ne '/^#define CAP_/{s/^#define \([^    ]*\)[   ]*\([^  ]*\)/  \{ \2, \"\1\" \},/;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;p;}' < /usr/include/linux/capability.h > cap_names.sed
d72 1
a72 1
	rm -f cap_names.c cap_names.sed _makenames
@


1.3
log
@cleaner
@
text
@d3 3
d18 1
a18 1
topdir=..
d29 1
a29 1
INCS=libcap.h include/sys/capability.h
d34 1
a34 1
all: $(LIBNAME)
d37 1
a37 1
	$(CC) $(CFLAGS) $< -o $@@
d46 1
a46 1
$(LIBNAME): $(OBJS)
d48 2
d51 1
a51 1
%.o: %.c $(INCS)
d55 5
a59 6
	mkdir -p $(INCDIR)/sys
	install -g root -o root -m 0644 include/sys/capability.h $(INCDIR)/sys
	mkdir -p $(LIBDIR)
	install -g root -o root -m 0444 $(LIBNAME) $(LIBDIR)/$(MINLIBNAME)
	rm -f $(LIBDIR)/$(LIBNAME)
	/sbin/ldconfig -nN $(LIBDIR)
d61 1
d65 2
a66 1
	rm -f $(OBJS) $(LIBNAME) cap_names.c cap_names.sed _makenames
@


1.2
log
@fixes and zefram's patches
@
text
@d3 3
d33 9
a41 12
cap_names.c: _makenames /usr/include/linux/capability.h
	@@echo -e "\n=> making cap_names.c from <linux/capability.h>\n"
	@@( \
	echo '/** cap_names.c                             **'; \
	echo ' ** automatically generated -- DO NOT EDIT! **/'; \
	echo; \
	echo '#include "libcap.h"'; \
	echo; \
	echo 'char const *_cap_names[__CAP_BITS] = {'; \
	sed -ne '/^#define CAP_/{s/^#define \([^    ]*\)[   ]*\([^  ]*\)/   \2\/\1/;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;p;}' < /usr/include/linux/capability.h | ./_makenames; \
	echo '};'; \
	) > $@@
d55 2
a56 2
	/sbin/ldconfig
	cd $(LIBDIR) && ln -sf $(MAJLIBNAME) $(LIBNAME)
d60 1
a60 1
	rm -f $(OBJS) $(LIBNAME) cap_names.c _makenames
@


1.1
log
@Initial revision
@
text
@d3 3
d10 1
a10 1
# flags
d12 2
a13 5
IPATH=-I./include
WARNINGS = -ansi -D_POSIX_SOURCE -Wall -Wwrite-strings \
        -Wpointer-arith -Wcast-qual -Wcast-align \
        -Wtraditional -Wstrict-prototypes -Wmissing-prototypes \
        -Wnested-externs -Winline -Wshadow -pedantic
a17 2
VERSION=0
MINOR=01
d20 3
a22 1
FILES=cap_alloc cap_file cap_proc cap_extint cap_flag cap_text cap_sys
d28 1
a28 1
export CFLAGS =-Dlinux $(WARNINGS) $(DEBUG) $(COPTFLAG) $(IPATH)
d30 12
a41 1
all: $(LIBNAME)
d50 5
a54 4
	mkdir -p $(FAKEROOT)/usr/include/sys
	install -g root -o root -m 0644 include/sys/capability.h $(FAKEROOT)/usr/include/sys
	mkdir -p $(FAKEROOT)/lib
	install -g root -o root -m 0444 $(LIBNAME) $(FAKEROOT)/lib/$(MINLIBNAME)
d56 1
d59 3
a61 2
	rm -f *~ core $(OBJS) $(LIBNAME)
	cd include/sys && rm -f *~ core
@