5 # lots of debugging information goes to /tmp/pam-debug.log
6 #MOREFLAGS += -D"DEBUG"
10 ifeq ($(DEBUG_REL),yes)
16 MODIFICATION=.$(MINOR_REL)
18 CFLAGS += $(MOREFLAGS) $(DYNAMIC) $(STATIC)
20 # dynamic library names
22 LIBNAMED = $(LIBNAME).$(DYNTYPE)
23 LIBNAMEDNAME = $(LIBNAMED)$(VERSION)
24 LIBNAMEDFULL = $(LIBNAMEDNAME)$(MODIFICATION)
28 LIBNAMEDSTATIC = $(LIBNAME).a
30 LIBOBJECTS = help_env.o misc_conv.o
32 ifeq ($(DYNAMIC_LIBPAM),yes)
33 DLIBOBJECTS = $(addprefix dynamic/,$(LIBOBJECTS))
36 ifeq ($(STATIC_LIBPAM),yes)
37 SLIBOBJECTS = $(addprefix static/,$(LIBOBJECTS))
40 # ---------------------------------------------
43 all: dirs $(LIBNAMED) $(LIBNAMEDSTATIC)
46 ifeq ($(DYNAMIC_LIBPAM),yes)
49 ifeq ($(STATIC_LIBPAM),yes)
54 $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
57 $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
59 $(LIBNAMED): $(DLIBOBJECTS)
60 ifeq ($(DYNAMIC_LIBPAM),yes)
61 ifeq ($(USESONAME),yes)
62 $(LD_L) $(SOSWITCH) $(LIBNAMEDNAME) -o $@ $(DLIBOBJECTS) $(MODULES) $(LINKLIBS)
64 $(LD_L) -o $@ $(DLIBOBJECTS) $(MODULES)
66 ifeq ($(NEEDSONAME),yes)
68 ln -s $(LIBNAMED) $(LIBNAMEDFULL)
70 ln -s $(LIBNAMED) $(LIBNAMEDNAME)
74 $(LIBNAMEDSTATIC): $(SLIBOBJECTS)
75 ifeq ($(STATIC_LIBPAM),yes)
76 $(AR) $@ $(SLIBOBJECTS) $(MODULES)
81 $(MKDIR) $(FAKEROOT)$(INCLUDED)
82 $(INSTALL) -m 644 include/security/pam_misc.h $(FAKEROOT)$(INCLUDED)
83 ifeq ($(DYNAMIC_LIBPAM),yes)
84 $(MKDIR) $(FAKEROOT)$(libdir)
85 $(INSTALL) -m $(SHLIBMODE) $(LIBNAMED) $(FAKEROOT)$(libdir)/$(LIBNAMEDFULL)
87 ifneq ($(DYNTYPE),"sl")
88 ( cd $(FAKEROOT)$(libdir) ; rm -f $(LIBNAMED) ; ln -s $(LIBNAMEDNAME) $(LIBNAMED) )
91 ifeq ($(STATIC_LIBPAM),yes)
92 $(INSTALL) -m 644 $(LIBNAMEDSTATIC) $(FAKEROOT)$(libdir)
96 rm -f $(FAKEROOT)$(INCLUDED)/pam_misc.h
97 rm -f $(FAKEROOT)$(libdir)/$(LIBNAMEDFULL)
98 rm -f $(FAKEROOT)$(libdir)/$(LIBNAMED)
100 rm -f $(FAKEROOT)$(libdir)/$(LIBNAMEDSTATIC)
103 rm -f a.out core *~ static/*.o dynamic/*.o
104 rm -f *.a *.out *.o *.so ./include/security/*~
105 if [ -d dynamic ]; then rmdir dynamic ; fi
106 if [ -d static ]; then rmdir static ; fi