8 # need to tell libpam about the default directory for PAMs
9 MOREFLAGS=-D"DEFAULT_MODULE_PATH=\"$(SECUREDIR)/\""
11 ifeq ($(WITH_LIBDEBUG),yes)
17 MODIFICATION=.$(MINOR_REL)
19 # ---------------------------------------------
21 dummy: ../Make.Rules all
23 # ---------------------------------------------
25 CFLAGS += $(DYNAMIC) $(STATIC) $(MOREFLAGS) \
26 -DLIBPAM_VERSION_MAJOR=$(MAJOR_REL) \
27 -DLIBPAM_VERSION_MINOR=$(MINOR_REL)
29 # dynamic library names
31 LIBPAM = $(LIBNAME).$(DYNTYPE)
32 LIBPAMNAME = $(LIBPAM)$(VERSION)
33 LIBPAMFULL = $(LIBPAMNAME)$(MODIFICATION)
37 LIBPAMSTATIC = $(LIBNAME).a
40 @echo Did you mean to set STATIC\?
41 MODULES = $(shell cat ../modules/_static_module_objects)
42 STATICOBJ = pam_static.o
48 EXTRAS += pam_malloc.o
51 LIBOBJECTS = pam_item.o pam_strerror.o pam_end.o pam_start.o pam_data.o \
52 pam_delay.o pam_dispatch.o pam_handlers.o pam_misc.o \
53 pam_account.o pam_auth.o pam_session.o pam_password.o \
54 pam_env.o pam_log.o $(EXTRAS)
56 ifeq ($(DYNAMIC_LIBPAM),yes)
57 # libpam.so needs -ldl, too.
58 DLIBOBJECTS = $(addprefix dynamic/,$(LIBOBJECTS) $(STATICOBJ))
59 ifeq ($(STATICOBJ),yes)
60 dynamic/pam_static.o: pam_static.c ../modules/_static_module_objects
61 $(CC) $(CFLAGS) -c pam_static.c -o $@
65 ifeq ($(STATIC_LIBPAM),yes)
66 SLIBOBJECTS = $(addprefix static/,$(LIBOBJECTS) $(STATICOBJ))
68 static/pam_static.o: pam_static.c ../modules/_static_module_objects
69 $(CC) $(CFLAGS) -c pam_static.c -o $@
73 # ---------------------------------------------
76 all: dirs $(LIBPAM) $(LIBPAMSTATIC) ../Make.Rules
79 ifeq ($(DYNAMIC_LIBPAM),yes)
82 ifeq ($(STATIC_LIBPAM),yes)
87 $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
90 $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
92 $(LIBPAM): $(DLIBOBJECTS)
93 ifeq ($(DYNAMIC_LIBPAM),yes)
94 ifeq ($(USESONAME),yes)
95 $(LD_L) $(SOSWITCH) $(LIBPAMNAME) -o $@ $(DLIBOBJECTS) \
96 $(MODULES) $(LINKLIBS)
98 $(LD_L) -o $@ $(DLIBOBJECTS) $(MODULES) $(LINKLIBS)
100 ifeq ($(NEEDSONAME),yes)
102 ln -sf $(LIBPAM) $(LIBPAMFULL)
104 ln -sf $(LIBPAM) $(LIBPAMNAME)
108 $(LIBPAMSTATIC): $(SLIBOBJECTS)
109 ifeq ($(STATIC_LIBPAM),yes)
110 ar cr $@ $(SLIBOBJECTS) $(MODULES)
115 $(MKDIR) $(FAKEROOT)$(INCLUDED) $(FAKEROOT)$(libdir)
116 $(INSTALL) -m 644 include/security/pam_appl.h $(FAKEROOT)$(INCLUDED)
117 $(INSTALL) -m 644 include/security/pam_modules.h $(FAKEROOT)$(INCLUDED)
118 $(INSTALL) -m 644 include/security/_pam_macros.h $(FAKEROOT)$(INCLUDED)
119 $(INSTALL) -m 644 include/security/_pam_types.h $(FAKEROOT)$(INCLUDED)
120 $(INSTALL) -m 644 include/security/_pam_compat.h $(FAKEROOT)$(INCLUDED)
122 $(INSTALL) -m 644 include/security/pam_malloc.h $(FAKEROOT)$(INCLUDED)
124 ifeq ($(DYNAMIC_LIBPAM),yes)
125 $(INSTALL) -m $(SHLIBMODE) $(LIBPAM) $(FAKEROOT)$(libdir)/$(LIBPAMFULL)
127 ifneq ($(DYNTYPE),"sl")
128 ( cd $(FAKEROOT)$(libdir) ; rm -f $(LIBPAM) ; \
129 ln -sf $(LIBPAMNAME) $(LIBPAM) )
132 ifeq ($(STATIC_LIBPAM),yes)
133 $(INSTALL) -m 644 $(LIBPAMSTATIC) $(FAKEROOT)$(libdir)
137 rm -f $(FAKEROOT)$(INCLUDED)/_pam_types.h
138 rm -f $(FAKEROOT)$(INCLUDED)/_pam_macros.h
139 rm -f $(FAKEROOT)$(INCLUDED)/pam_appl.h
140 rm -f $(FAKEROOT)$(INCLUDED)/pam_modules.h
141 rm -f $(FAKEROOT)$(INCLUDED)/pam_malloc.h
142 rm -f $(FAKEROOT)$(libdir)/$(LIBPAM).*
143 rm -f $(FAKEROOT)$(libdir)/$(LIBPAM)
145 rm -f $(FAKEROOT)$(libdir)/$(LIBPAMSTATIC)
148 rm -f a.out core *~ static/*.o dynamic/*.o
149 rm -f *.a *.o *.so ./include/security/*~
150 if [ -d dynamic ]; then rmdir dynamic ; fi
151 if [ -d static ]; then rmdir static ; fi