File: Makefile

package info (click to toggle)
proftpd 1.2.0pre1-2
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 1,468 kB
  • ctags: 2,106
  • sloc: ansic: 19,206; sh: 1,640; makefile: 480; perl: 235
file content (38 lines) | stat: -rw-r--r-- 1,286 bytes parent folder | download
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
## This libcap (for proftpd) is originally from libcap-0.104,
## at ftp://linux.kernel.org/pub/libs/security/linux-privs.
## The interface in the orginally library is slightly buggy, and
## because capabilities are new to linux 2.1, the api may change
## before 2.0 comes out.  If this library stops working, please contact
## proftpd-l@evcom.net.

include ../../Make.rules
LIBNAME=libcap.a

CAP_FILES=cap_alloc cap_proc cap_extint cap_flag cap_text cap_sys

CAP_INCLS=libcap.h cap_names.h
CAP_OBJS=$(addsuffix .o, $(CAP_FILES))
CAP_HDR=/usr/src/linux/include/linux/capability.h

all: $(LIBNAME)

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

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

# !! NOTE: you must have 2.1 kernel headers in /usr/src/linux !!
cap_names.sed: Makefile $(CAP_HDR)
	@echo "=> making cap_names.h from <$(CAP_HDR)>"
	@sed -ne '/^#define[ \t]CAP[_A-Z]\+[ \t]\+[0-9]\+/{s/^#define \([^ \t]*\)[ \t]*\([^ \t]*\)/  \{ \2, \"\1\" \},/;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;p;}' < $(CAP_HDR) | fgrep -v 0x > cap_names.sed

$(LIBNAME): $(CAP_OBJS)
	ar rc $(LIBNAME) $(CAP_OBJS)

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

clean:
	rm -f $(CAP_OBJS) $(LIBNAME)
	rm -f cap_names.h cap_names.sed _makenames *~