3 # This Makefile controls a build process of the pam_unix modules
4 # for Linux-PAM. You should not modify this Makefile.
7 include ../../Make.Rules
9 ########################################################################
10 # some options... uncomment to take effect
11 ########################################################################
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"
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"
30 ifeq ($(HAVE_LIBNSL),yes)
34 ifeq ($(HAVE_LIBCRYPT),yes)
40 EXTRAS += -DCHKPWD_HELPER=\"$(SUPLEMENTED)/$(CHKPWD)\"
42 ########################################################################
44 CFLAGS += $(USE_CRACKLIB) $(USE_LCKPWDF) $(NEED_LCKPWDF) $(EXTRAS) \
45 -I../pammodutil/include
47 LDLIBS = $(EXTRALS) -L../pammodutil -lpammodutil
54 LIBOBJ = pam_unix_auth.o pam_unix_acct.o pam_unix_sess.o pam_unix_passwd.o \
56 LIBSRC = pam_unix_auth.c pam_unix_acct.c pam_unix_sess.c pam_unix_passwd.c \
58 LIBOBJD = $(addprefix dynamic/,$(LIBOBJ))
59 LIBOBJS = $(addprefix static/,$(LIBOBJ))
61 PLUS = md5_good.o md5_broken.o md5_crypt_good.o md5_crypt_broken.o \
62 yppasswd_xdr.o bigcrypt.o
65 LIBSHARED = pam_unix.so
68 LIBSTATIC = libpam_unix.o
72 ########################### don't edit below #######################
74 all: dirs info $(PLUS) $(LIBSHARED) $(LIBSTATIC) $(CHKPWD) register
77 $(CC) $(CFLAGS) $(DYNAMIC) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
80 $(CC) $(CFLAGS) $(STATIC) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
83 @echo "**** This is not a top-level Makefile "
88 @echo "*** Building pam-unix module of the framework..."
101 ( cd .. ; ./register_static pam_unix_auth pam_unix/$(LIBSTATIC) ; \
102 ./register_static pam_unix_acct "" ; \
103 ./register_static pam_unix_session "" ; \
104 ./register_static pam_unix_passwd "" ; \
109 $(LIBOBJD): $(LIBSRC)
111 $(LIBSHARED): $(LIBOBJD)
112 $(LD_D) -o $@ $(LIBOBJD) $(PLUS) $(CRACKLIB) $(LDLIBS) $(LIBNSL) $(LIBCRYPT) $(NEED_LINK_LIB_C) -L../../libpam -lpam
116 $(LIBOBJS): $(LIBSRC)
118 $(LIBSTATIC): $(LIBOBJS)
119 $(LD) -r -o $@ $(LIBOBJS) $(PLUS) $(CRACKLIB) $(LDLIBS) $(LIBNSL) $(LIBCRYPT)
122 $(CHKPWD): unix_chkpwd.o md5_good.o md5_broken.o \
123 md5_crypt_good.o md5_crypt_broken.o \
125 $(CC) -o $(CHKPWD) $^ $(LDLIBS) $(LIBCRYPT)
127 unix_chkpwd.o: unix_chkpwd.c
128 $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
131 $(CC) $(CFLAGS) $(CPPFLAGS) -DHIGHFIRST -D'MD5Name(x)=Good##x' \
132 $(TARGET_ARCH) -c $< -o $@
135 $(CC) $(CFLAGS) $(CPPFLAGS) -D'MD5Name(x)=Broken##x' \
136 $(TARGET_ARCH) -c $< -o $@
138 md5_crypt_good.o: md5_crypt.c
139 $(CC) $(CFLAGS) $(CPPFLAGS) -D'MD5Name(x)=Good##x' \
140 $(TARGET_ARCH) -c $< -o $@
142 md5_crypt_broken.o: md5_crypt.c
143 $(CC) $(CFLAGS) $(CPPFLAGS) -D'MD5Name(x)=Broken##x' \
144 $(TARGET_ARCH) -c $< -o $@
147 mkdir -p $(FAKEROOT)$(SECUREDIR)
149 install -m $(SHLIBMODE) $(LIBSHARED) $(FAKEROOT)$(SECUREDIR)
150 for x in pam_unix_auth pam_unix_acct pam_unix_passwd pam_unix_session;\
151 do ln -sf $(LIBSHARED) $(FAKEROOT)$(SECUREDIR)/$$x.so ; done
153 $(MKDIR) $(FAKEROOT)$(SUPLEMENTED)
154 install -m 4555 $(CHKPWD) $(FAKEROOT)$(SUPLEMENTED)
157 rm -f $(FAKEROOT)$(SECUREDIR)/$(LIBSHARED)
158 for x in pam_unix_auth pam_unix_acct pam_unix_passwd pam_unix_session;\
159 do rm -f $(FAKEROOT)$(SECUREDIR)/$$x.so ; done
160 rm -f $(FAKEROOT)$(SUPLEMENTED)/$(CHKPWD)
163 rm -f $(LIBOBJD) $(LIBOBJS) $(CHKPWD) *.o *.so core
164 rm -f *~ *.a *.out *.bak
165 rm -rf dynamic static
168 $(CC) -c $(CFLAGS) $<