summaryrefslogtreecommitdiff
path: root/libpamc
diff options
context:
space:
mode:
Diffstat (limited to 'libpamc')
-rw-r--r--libpamc/Makefile73
-rw-r--r--libpamc/libpamc.h2
2 files changed, 36 insertions, 39 deletions
diff --git a/libpamc/Makefile b/libpamc/Makefile
index 6052e96e..402f070f 100644
--- a/libpamc/Makefile
+++ b/libpamc/Makefile
@@ -5,6 +5,8 @@
# lots of debugging information goes to /tmp/pam-debug.log
#MOREFLAGS += -D"DEBUG"
+include ../Make.Rules
+
ifeq ($(DEBUG_REL),yes)
LIBNAME=libpamcd
else
@@ -13,71 +15,64 @@ endif
VERSION=.$(MAJOR_REL)
MODIFICATION=.$(MINOR_REL)
-# ---------------------------------------------
-
-dummy:
- @echo "*** This is not a top-level Makefile!"
-
-# ---------------------------------------------
-
-CFLAGS += $(DYNAMIC) $(STATIC) $(MOREFLAGS)
+CFLAGS += $(MOREFLAGS) $(DYNAMIC) $(STATIC)
# dynamic library names
-LIBPAMC = $(LIBNAME).$(DYNTYPE)
-LIBPAMCNAME = $(LIBPAMC)$(VERSION)
-LIBPAMCFULL = $(LIBPAMCNAME)$(MODIFICATION)
+LIBNAMED = $(LIBNAME).$(DYNTYPE)
+LIBNAMEDNAME = $(LIBNAMED)$(VERSION)
+LIBNAMEDFULL = $(LIBNAMEDNAME)$(MODIFICATION)
# static library name
-LIBPAMCSTATIC = $(LIBNAME).a
+LIBNAMEDSTATIC = $(LIBNAME).a
LIBOBJECTS = pamc_client.o pamc_converse.o pamc_load.o
-ifdef DYNAMIC_LIBPAM
+ifeq ($(DYNAMIC_LIBPAM),yes)
DLIBOBJECTS = $(addprefix dynamic/,$(LIBOBJECTS))
endif
-ifdef STATIC_LIBPAM
+ifeq ($(STATIC_LIBPAM),yes)
SLIBOBJECTS = $(addprefix static/,$(LIBOBJECTS))
endif
# ---------------------------------------------
## rules
-all: dirs $(LIBPAMC) $(LIBPAMCSTATIC)
+all: dirs $(LIBNAMED) $(LIBNAMEDSTATIC)
dirs:
-ifdef DYNAMIC_LIBPAM
- mkdir -p dynamic
+ifeq ($(DYNAMIC_LIBPAM),yes)
+ $(MKDIR) dynamic
endif
-ifdef STATIC_LIBPAM
- mkdir -p static
+ifeq ($(STATIC_LIBPAM),yes)
+ $(MKDIR) static
endif
dynamic/%.o : %.c
- $(CC) $(CFLAGS) $(DYNAMIC) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
static/%.o : %.c
- $(CC) $(CFLAGS) $(STATIC) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
-$(LIBPAMC): $(DLIBOBJECTS)
-ifdef DYNAMIC_LIBPAM
+$(LIBNAMED): $(DLIBOBJECTS)
+ifeq ($(DYNAMIC_LIBPAM),yes)
ifeq ($(USESONAME),yes)
- $(LD_L) $(SOSWITCH) $(LIBPAMCNAME) -o $@ $(DLIBOBJECTS) $(MODULES) $(LINKLIBS)
+ $(LD_L) $(SOSWITCH) $(LIBNAMEDNAME) -o $@ $(DLIBOBJECTS) $(MODULES) $(LINKLIBS)
else
$(LD_L) -o $@ $(DLIBOBJECTS) $(MODULES)
endif
ifeq ($(NEEDSONAME),yes)
- rm -f $(LIBPAMCFULL)
- ln -s $(LIBPAMC) $(LIBPAMCFULL)
- rm -f $(LIBPAMCNAME)
- ln -s $(LIBPAMC) $(LIBPAMCNAME)
+ rm -f $(LIBNAMEDFULL)
+ ln -s $(LIBNAMED) $(LIBNAMEDFULL)
+ rm -f $(LIBNAMEDNAME)
+ ln -s $(LIBNAMED) $(LIBNAMEDNAME)
endif
endif
-$(LIBPAMCSTATIC): $(SLIBOBJECTS)
-ifdef STATIC_LIBPAM
+$(LIBNAMEDSTATIC): $(SLIBOBJECTS)
+ifeq ($(STATIC_LIBPAM),yes)
$(AR) $@ $(SLIBOBJECTS) $(MODULES)
$(RANLIB) $@
endif
@@ -85,26 +80,28 @@ endif
install: all
$(MKDIR) $(FAKEROOT)$(INCLUDED)
$(INSTALL) -m 644 include/security/pam_client.h $(FAKEROOT)$(INCLUDED)
-ifdef DYNAMIC_LIBPAM
- $(INSTALL) -m $(SHLIBMODE) $(LIBPAMC) $(FAKEROOT)$(LIBDIR)/$(LIBPAMCFULL)
+ifeq ($(DYNAMIC_LIBPAM),yes)
+ $(MKDIR) $(FAKEROOT)$(libdir)
+ $(INSTALL) -m $(SHLIBMODE) $(LIBNAMED) $(FAKEROOT)$(libdir)/$(LIBNAMEDFULL)
$(LDCONFIG)
ifneq ($(DYNTYPE),"sl")
- ( cd $(FAKEROOT)$(LIBDIR) ; rm -f $(LIBPAMC) ; ln -s $(LIBPAMCNAME) $(LIBPAMC) )
+ ( cd $(FAKEROOT)$(libdir) ; rm -f $(LIBNAMED) ; ln -s $(LIBNAMEDNAME) $(LIBNAMED) )
endif
endif
-ifdef STATIC_LIBPAM
- $(INSTALL) -m 644 $(LIBPAMCSTATIC) $(FAKEROOT)$(LIBDIR)
+ifeq ($(STATIC_LIBPAM),yes)
+ $(INSTALL) -m 644 $(LIBNAMEDSTATIC) $(FAKEROOT)$(libdir)
endif
remove:
rm -f $(FAKEROOT)$(INCLUDED)/pam_client.h
+ rm -f $(FAKEROOT)$(libdir)/$(LIBNAMEDFULL)
+ rm -f $(FAKEROOT)$(libdir)/$(LIBNAMED)
$(LDCONFIG)
- rm -f $(FAKEROOT)$(LIBDIR)/$(LIBPAMCSTATIC)
+ rm -f $(FAKEROOT)$(libdir)/$(LIBNAMEDSTATIC)
clean:
rm -f a.out core *~ static/*.o dynamic/*.o
-
-extraclean: clean
rm -f *.a *.out *.o *.so ./include/security/*~
if [ -d dynamic ]; then rmdir dynamic ; fi
if [ -d static ]; then rmdir static ; fi
+
diff --git a/libpamc/libpamc.h b/libpamc/libpamc.h
index 15662cc3..93c833c6 100644
--- a/libpamc/libpamc.h
+++ b/libpamc/libpamc.h
@@ -9,7 +9,7 @@
#define LIBPAMC_H
#include <security/pam_client.h>
-#include <security/pam_misc.h>
+#include <security/_pam_macros.h>
#include <sys/stat.h>
#include <unistd.h>