freebsd-dev/contrib/libpam/libpam_misc/Makefile

107 lines
2.4 KiB
Makefile
Raw Normal View History

#
2001-05-03 09:36:08 +00:00
# $Id: Makefile,v 1.3 2001/02/10 07:17:53 agmorgan Exp $
#
2001-05-03 09:36:08 +00:00
# lots of debugging information goes to /tmp/pam-debug.log
#MOREFLAGS += -D"DEBUG"
2001-05-03 09:36:08 +00:00
include ../Make.Rules
2001-05-03 09:36:08 +00:00
ifeq ($(WITH_LIBDEBUG),yes)
LIBNAME=libpam_miscd
else
2001-05-03 09:36:08 +00:00
LIBNAME=libpam_misc
endif
2001-05-03 09:36:08 +00:00
VERSION=.$(MAJOR_REL)
MODIFICATION=.$(MINOR_REL)
2001-05-03 09:36:08 +00:00
CFLAGS += $(MOREFLAGS) $(DYNAMIC) $(STATIC)
2001-05-03 09:36:08 +00:00
# dynamic library names
2001-05-03 09:36:08 +00:00
LIBNAMED = $(LIBNAME).$(DYNTYPE)
LIBNAMEDNAME = $(LIBNAMED)$(VERSION)
LIBNAMEDFULL = $(LIBNAMEDNAME)$(MODIFICATION)
# static library name
2001-05-03 09:36:08 +00:00
LIBNAMEDSTATIC = $(LIBNAME).a
LIBOBJECTS = help_env.o misc_conv.o
2001-05-03 09:36:08 +00:00
ifeq ($(DYNAMIC_LIBPAM),yes)
DLIBOBJECTS = $(addprefix dynamic/,$(LIBOBJECTS))
endif
2001-05-03 09:36:08 +00:00
ifeq ($(STATIC_LIBPAM),yes)
SLIBOBJECTS = $(addprefix static/,$(LIBOBJECTS))
endif
2001-05-03 09:36:08 +00:00
# ---------------------------------------------
## rules
2001-05-03 09:36:08 +00:00
all: dirs $(LIBNAMED) $(LIBNAMEDSTATIC)
2001-05-03 09:36:08 +00:00
dirs:
ifeq ($(DYNAMIC_LIBPAM),yes)
$(MKDIR) dynamic
endif
ifeq ($(STATIC_LIBPAM),yes)
$(MKDIR) static
endif
dynamic/%.o : %.c
$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
static/%.o : %.c
$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
$(LIBNAMED): $(DLIBOBJECTS)
ifeq ($(DYNAMIC_LIBPAM),yes)
ifeq ($(USESONAME),yes)
2001-05-03 09:36:08 +00:00
$(LD_L) $(SOSWITCH) $(LIBNAMEDNAME) -o $@ $(DLIBOBJECTS) $(MODULES) $(LINKLIBS)
else
2001-05-03 09:36:08 +00:00
$(LD_L) -o $@ $(DLIBOBJECTS) $(MODULES)
endif
ifeq ($(NEEDSONAME),yes)
2001-05-03 09:36:08 +00:00
rm -f $(LIBNAMEDFULL)
ln -s $(LIBNAMED) $(LIBNAMEDFULL)
rm -f $(LIBNAMEDNAME)
ln -s $(LIBNAMED) $(LIBNAMEDNAME)
endif
endif
2001-05-03 09:36:08 +00:00
$(LIBNAMEDSTATIC): $(SLIBOBJECTS)
ifeq ($(STATIC_LIBPAM),yes)
$(AR) rc $@ $(SLIBOBJECTS) $(MODULES)
$(RANLIB) $@
2001-05-03 09:36:08 +00:00
endif
install: all
$(MKDIR) $(FAKEROOT)$(INCLUDED)
2001-05-03 09:36:08 +00:00
$(INSTALL) -m 644 include/security/pam_misc.h $(FAKEROOT)$(INCLUDED)
ifeq ($(DYNAMIC_LIBPAM),yes)
$(MKDIR) $(FAKEROOT)$(libdir)
$(INSTALL) -m $(SHLIBMODE) $(LIBNAMED) $(FAKEROOT)$(libdir)/$(LIBNAMEDFULL)
$(LDCONFIG)
ifneq ($(DYNTYPE),"sl")
2001-05-03 09:36:08 +00:00
( cd $(FAKEROOT)$(libdir) ; rm -f $(LIBNAMED) ; ln -s $(LIBNAMEDNAME) $(LIBNAMED) )
endif
endif
2001-05-03 09:36:08 +00:00
ifeq ($(STATIC_LIBPAM),yes)
$(INSTALL) -m 644 $(LIBNAMEDSTATIC) $(FAKEROOT)$(libdir)
endif
remove:
rm -f $(FAKEROOT)$(INCLUDED)/pam_misc.h
2001-05-03 09:36:08 +00:00
rm -f $(FAKEROOT)$(libdir)/$(LIBNAMEDFULL)
rm -f $(FAKEROOT)$(libdir)/$(LIBNAMED)
$(LDCONFIG)
2001-05-03 09:36:08 +00:00
rm -f $(FAKEROOT)$(libdir)/$(LIBNAMEDSTATIC)
2001-05-03 09:36:08 +00:00
clean:
rm -f a.out core *~ static/*.o dynamic/*.o
rm -f *.a *.out *.o *.so ./include/security/*~
if [ -d dynamic ]; then rmdir dynamic ; fi
if [ -d static ]; then rmdir static ; fi