~ubuntu-branches/ubuntu/breezy/pam/breezy

« back to all changes in this revision

Viewing changes to Linux-PAM/modules/pam_unix/Makefile

  • Committer: Bazaar Package Importer
  • Author(s): Sam Hartman
  • Date: 2004-06-28 14:28:08 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040628142808-adikk7vtfg3pzcjw
Tags: 0.76-22
* Add uploaders
* Document location of repository
* Fix options containing arguments in pam_unix, Closes: #254904

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# $Id: Makefile,v 1.12 2004/05/05 02:56:51 hartmans Exp $
 
2
#
 
3
# This Makefile controls a build process of the pam_unix modules
 
4
# for Linux-PAM. You should not modify this Makefile.
 
5
#
 
6
 
 
7
include ../../Make.Rules
 
8
 
 
9
########################################################################
 
10
# some options... uncomment to take effect
 
11
########################################################################
 
12
 
 
13
# Unless someone wants to work out how to make this work with the new
 
14
# autoconf stuff, you should use a separate module for this type of thing
 
15
# pam_cracklib perhaps..?
 
16
# do you want cracklib?
 
17
#ifeq ($(HAVE_CRACKLIB),yes)
 
18
#USE_CRACKLIB=-D"USE_CRACKLIB"
 
19
#endif
 
20
 
 
21
# do you want to use lckpwdf?
 
22
ifeq ($(WITH_LCKPWDF),yes)
 
23
USE_LCKPWDF=-D"USE_LCKPWDF"
 
24
# do you need to include the locking functions in the source?
 
25
ifeq ($(HAVE_LCKPWDF),no)
 
26
  NEED_LCKPWDF=-D"NEED_LCKPWDF"
 
27
endif
 
28
endif
 
29
 
 
30
ifeq ($(HAVE_LIBNSL),yes)
 
31
  LIBNSL = -lnsl
 
32
endif
 
33
 
 
34
ifeq ($(HAVE_LIBCRYPT),yes)
 
35
  LIBCRYPT=-lcrypt
 
36
endif
 
37
 
 
38
CHKPWD=unix_chkpwd
 
39
 
 
40
EXTRAS += -DCHKPWD_HELPER=\"$(SUPLEMENTED)/$(CHKPWD)\"
 
41
EXTRAS += -I../pammodutil/include
 
42
 
 
43
########################################################################
 
44
 
 
45
CFLAGS += $(USE_CRACKLIB) $(USE_LCKPWDF) $(NEED_LCKPWDF) $(EXTRAS)
 
46
LDLIBS = $(EXTRALS) -L../pammodutil -lpammodutil
 
47
 
 
48
ifdef USE_CRACKLIB
 
49
CRACKLIB = -lcrack
 
50
endif
 
51
 
 
52
 
 
53
LIBOBJ = pam_unix_auth.o pam_unix_acct.o pam_unix_sess.o pam_unix_passwd.o \
 
54
                support.o
 
55
LIBSRC = pam_unix_auth.c pam_unix_acct.c pam_unix_sess.c pam_unix_passwd.c \
 
56
                support.c
 
57
LIBOBJD = $(addprefix dynamic/,$(LIBOBJ))
 
58
LIBOBJS = $(addprefix static/,$(LIBOBJ))
 
59
 
 
60
PLUS = md5_good.o md5_broken.o md5_crypt_good.o md5_crypt_broken.o \
 
61
                yppasswd_xdr.o bigcrypt.o obscure.o
 
62
 
 
63
ifdef DYNAMIC
 
64
LIBSHARED = pam_unix.so
 
65
endif
 
66
ifdef STATIC
 
67
LIBSTATIC = libpam_unix.o
 
68
endif
 
69
 
 
70
 
 
71
########################### don't edit below #######################
 
72
 
 
73
all: dirs info $(PLUS) $(LIBSHARED) $(LIBSTATIC) $(CHKPWD) register
 
74
 
 
75
dynamic/%.o : %.c
 
76
        $(CC) $(CFLAGS) $(DYNAMIC) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
 
77
 
 
78
static/%.o: %.c
 
79
        $(CC) $(CFLAGS) $(STATIC) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
 
80
 
 
81
dummy:
 
82
        @echo "**** This is not a top-level Makefile "
 
83
        exit
 
84
 
 
85
info:
 
86
        @echo
 
87
        @echo "*** Building pam-unix module of the framework..."
 
88
        @echo
 
89
 
 
90
dirs:
 
91
ifdef DYNAMIC
 
92
        mkdir -p ./dynamic
 
93
endif
 
94
ifdef STATIC
 
95
        mkdir -p ./static
 
96
endif
 
97
 
 
98
register:
 
99
ifdef STATIC
 
100
        ( cd .. ; ./register_static pam_unix_auth pam_unix/$(LIBSTATIC) ; \
 
101
                ./register_static pam_unix_acct  "" ; \
 
102
                ./register_static pam_unix_session "" ; \
 
103
                ./register_static pam_unix_passwd "" ; \
 
104
        )
 
105
endif
 
106
 
 
107
ifdef DYNAMIC
 
108
$(LIBOBJD): $(LIBSRC)
 
109
 
 
110
$(LIBSHARED):   $(LIBOBJD)
 
111
        $(LD_D) -o $@ $(LIBOBJD) $(PLUS) $(CRACKLIB) $(LDLIBS) $(LIBNSL) $(LIBCRYPT) $(NEED_LINK_LIB_C) -L../../libpam -lpam
 
112
endif
 
113
 
 
114
ifdef STATIC
 
115
$(LIBOBJS): $(LIBSRC)
 
116
 
 
117
$(LIBSTATIC): $(LIBOBJS)
 
118
        $(LD) -r -o $@ $(LIBOBJS) $(PLUS) $(CRACKLIB) $(LDLIBS) $(LIBNSL) $(LIBCRYPT)
 
119
endif
 
120
 
 
121
$(CHKPWD): unix_chkpwd.o md5_good.o md5_broken.o \
 
122
                md5_crypt_good.o md5_crypt_broken.o \
 
123
                bigcrypt.o
 
124
        $(CC) -o $(CHKPWD) $^ $(LDLIBS) $(LIBCRYPT)
 
125
 
 
126
unix_chkpwd.o: unix_chkpwd.c
 
127
        $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
 
128
 
 
129
md5_good.o: md5.c
 
130
        $(CC) $(CFLAGS) $(CPPFLAGS) -DHIGHFIRST -D'MD5Name(x)=Good##x' \
 
131
                $(TARGET_ARCH) -c $< -o $@
 
132
 
 
133
md5_broken.o: md5.c
 
134
        $(CC) $(CFLAGS) $(CPPFLAGS) -D'MD5Name(x)=Broken##x' \
 
135
                $(TARGET_ARCH) -c $< -o $@
 
136
 
 
137
md5_crypt_good.o: md5_crypt.c
 
138
        $(CC) $(CFLAGS) $(CPPFLAGS) -D'MD5Name(x)=Good##x' \
 
139
                $(TARGET_ARCH) -c $< -o $@
 
140
 
 
141
md5_crypt_broken.o: md5_crypt.c
 
142
        $(CC) $(CFLAGS) $(CPPFLAGS) -D'MD5Name(x)=Broken##x' \
 
143
                $(TARGET_ARCH) -c $< -o $@
 
144
 
 
145
install: all
 
146
        mkdir -p $(FAKEROOT)$(SECUREDIR)
 
147
ifdef DYNAMIC
 
148
        install -m $(SHLIBMODE) $(LIBSHARED) $(FAKEROOT)$(SECUREDIR)
 
149
        for x in pam_unix_auth pam_unix_acct pam_unix_passwd pam_unix_session;\
 
150
                do ln -sf $(LIBSHARED) $(FAKEROOT)$(SECUREDIR)/$$x.so ; done
 
151
endif
 
152
        $(MKDIR) $(FAKEROOT)$(SUPLEMENTED)
 
153
        install -m 4555 $(CHKPWD) $(FAKEROOT)$(SUPLEMENTED)
 
154
 
 
155
remove:
 
156
        rm -f $(FAKEROOT)$(SECUREDIR)/$(LIBSHARED)
 
157
        for x in pam_unix_auth pam_unix_acct pam_unix_passwd pam_unix_session;\
 
158
                do rm -f $(FAKEROOT)$(SECUREDIR)/$$x.so ; done
 
159
        rm -f $(FAKEROOT)$(SUPLEMENTED)/$(CHKPWD)
 
160
 
 
161
clean:
 
162
        rm -f $(LIBOBJD) $(LIBOBJS) $(CHKPWD) *.o *.so core
 
163
        rm -f *~ *.a *.out *.bak
 
164
        rm -rf dynamic static
 
165
 
 
166
.c.o:   
 
167
        $(CC) -c $(CFLAGS) $<
 
168