blob: 6052e96e9f1ce48e6689437db27f7d7bd272130f (
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
|
#
# $Id$
#
# lots of debugging information goes to /tmp/pam-debug.log
#MOREFLAGS += -D"DEBUG"
ifeq ($(DEBUG_REL),yes)
LIBNAME=libpamcd
else
LIBNAME=libpamc
endif
VERSION=.$(MAJOR_REL)
MODIFICATION=.$(MINOR_REL)
# ---------------------------------------------
dummy:
@echo "*** This is not a top-level Makefile!"
# ---------------------------------------------
CFLAGS += $(DYNAMIC) $(STATIC) $(MOREFLAGS)
# dynamic library names
LIBPAMC = $(LIBNAME).$(DYNTYPE)
LIBPAMCNAME = $(LIBPAMC)$(VERSION)
LIBPAMCFULL = $(LIBPAMCNAME)$(MODIFICATION)
# static library name
LIBPAMCSTATIC = $(LIBNAME).a
LIBOBJECTS = pamc_client.o pamc_converse.o pamc_load.o
ifdef DYNAMIC_LIBPAM
DLIBOBJECTS = $(addprefix dynamic/,$(LIBOBJECTS))
endif
ifdef STATIC_LIBPAM
SLIBOBJECTS = $(addprefix static/,$(LIBOBJECTS))
endif
# ---------------------------------------------
## rules
all: dirs $(LIBPAMC) $(LIBPAMCSTATIC)
dirs:
ifdef DYNAMIC_LIBPAM
mkdir -p dynamic
endif
ifdef STATIC_LIBPAM
mkdir -p static
endif
dynamic/%.o : %.c
$(CC) $(CFLAGS) $(DYNAMIC) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
static/%.o : %.c
$(CC) $(CFLAGS) $(STATIC) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
$(LIBPAMC): $(DLIBOBJECTS)
ifdef DYNAMIC_LIBPAM
ifeq ($(USESONAME),yes)
$(LD_L) $(SOSWITCH) $(LIBPAMCNAME) -o $@ $(DLIBOBJECTS) $(MODULES) $(LINKLIBS)
else
$(LD_L) -o $@ $(DLIBOBJECTS) $(MODULES)
endif
ifeq ($(NEEDSONAME),yes)
rm -f $(LIBPAMCFULL)
ln -s $(LIBPAMC) $(LIBPAMCFULL)
rm -f $(LIBPAMCNAME)
ln -s $(LIBPAMC) $(LIBPAMCNAME)
endif
endif
$(LIBPAMCSTATIC): $(SLIBOBJECTS)
ifdef STATIC_LIBPAM
$(AR) $@ $(SLIBOBJECTS) $(MODULES)
$(RANLIB) $@
endif
install: all
$(MKDIR) $(FAKEROOT)$(INCLUDED)
$(INSTALL) -m 644 include/security/pam_client.h $(FAKEROOT)$(INCLUDED)
ifdef DYNAMIC_LIBPAM
$(INSTALL) -m $(SHLIBMODE) $(LIBPAMC) $(FAKEROOT)$(LIBDIR)/$(LIBPAMCFULL)
$(LDCONFIG)
ifneq ($(DYNTYPE),"sl")
( cd $(FAKEROOT)$(LIBDIR) ; rm -f $(LIBPAMC) ; ln -s $(LIBPAMCNAME) $(LIBPAMC) )
endif
endif
ifdef STATIC_LIBPAM
$(INSTALL) -m 644 $(LIBPAMCSTATIC) $(FAKEROOT)$(LIBDIR)
endif
remove:
rm -f $(FAKEROOT)$(INCLUDED)/pam_client.h
$(LDCONFIG)
rm -f $(FAKEROOT)$(LIBDIR)/$(LIBPAMCSTATIC)
clean:
rm -f a.out core *~ static/*.o dynamic/*.o
extraclean: clean
rm -f *.a *.out *.o *.so ./include/security/*~
if [ -d dynamic ]; then rmdir dynamic ; fi
if [ -d static ]; then rmdir static ; fi
|