]> granicus.if.org Git - linux-pam/blobdiff - libpam/Makefile
Relevant BUGIDs: 565470
[linux-pam] / libpam / Makefile
index b734dfa421c91b8d0e3bba93012110605e011a95..cf49f6276ec9d43f9487f92230d7f7b8e8f9c0ca 100644 (file)
@@ -22,7 +22,9 @@ dummy: ../Make.Rules all
 
 # ---------------------------------------------
 
-CFLAGS += $(DYNAMIC) $(STATIC) $(MOREFLAGS)
+CFLAGS += $(DYNAMIC) $(STATIC) $(MOREFLAGS) \
+  -DLIBPAM_VERSION_MAJOR=$(MAJOR_REL) \
+  -DLIBPAM_VERSION_MINOR=$(MINOR_REL)
 
 # dynamic library names
 
@@ -38,9 +40,11 @@ ifdef STATIC
 @echo Did you mean to set STATIC\?
 MODULES = $(shell cat ../modules/_static_module_objects)
 STATICOBJ = pam_static.o
+else
+MODULES =
 endif
 
-ifdef MEMORY_DEBUG
+ifeq ($(WITH_MEMORY_DEBUG),yes)
 EXTRAS += pam_malloc.o
 endif
 
@@ -95,15 +99,15 @@ ifeq ($(DYNAMIC_LIBPAM),yes)
     endif
     ifeq ($(NEEDSONAME),yes)
        rm -f $(LIBPAMFULL)
-       ln -s $(LIBPAM) $(LIBPAMFULL)
+       ln -sf $(LIBPAM) $(LIBPAMFULL)
        rm -f $(LIBPAMNAME)
-       ln -s $(LIBPAM) $(LIBPAMNAME)
+       ln -sf $(LIBPAM) $(LIBPAMNAME)
     endif
 endif
 
 $(LIBPAMSTATIC): $(SLIBOBJECTS)
 ifeq ($(STATIC_LIBPAM),yes)
-       $(AR) $@ $(SLIBOBJECTS) $(MODULES)
+       ar cr $@ $(SLIBOBJECTS) $(MODULES)
        $(RANLIB) $@
 endif
 
@@ -122,7 +126,7 @@ ifeq ($(DYNAMIC_LIBPAM),yes)
        $(LDCONFIG)
   ifneq ($(DYNTYPE),"sl")
        ( cd $(FAKEROOT)$(libdir) ; rm -f $(LIBPAM) ; \
-         ln -s $(LIBPAMNAME) $(LIBPAM) )
+         ln -sf $(LIBPAMNAME) $(LIBPAM) )
   endif
 endif
 ifeq ($(STATIC_LIBPAM),yes)