#
# This Makefile controls a build process of $(TITLE) module for
# Linux-PAM. You should not modify this Makefile (unless you know
# what you are doing!).
#
# Created by Cristian Gafton <gafton@redhat.com> 1996/09/10
#
# STATIC modules are not supported
#

include ../../Make.Rules

TITLE:=pam_adsap2
CONFD:=$(CONFIGED)/security
export CONFD

LIBSRC := $(TITLE).c
LIBOBJ := $(TITLE).o

LIBOBJD := $(addprefix dynamic/,$(LIBOBJ))

LIBS := $(ADSAP2_DIR)/libadsap2.a

CPPFLAGS += -I$(ADSAP2_DIR)

dynamic/%.o : %.c
	$(CC) $(CFLAGS) $(DYNAMIC) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@

ifdef DYNAMIC
LIBSHARED := $(TITLE).so
endif

####################### don't edit below #######################

all: dirs $(LIBSHARED) $(LIBSTATIC) register

dirs:
ifdef DYNAMIC
	$(MKDIR) ./dynamic
endif

register:

ifdef DYNAMIC
$(LIBOBJD): $(LIBSRC)

$(LIBSHARED):	$(LIBOBJD) $(LIBS)
	$(LD_D) -o $@ $(LIBOBJD) $(LIBS)

endif

install: all
ifdef DYNAMIC
	$(INSTALL) -m $(SHLIBMODE) $(LIBSHARED) $(FAKEROOT)$(SECUREDIR)
endif

remove:
	rm -f $(FAKEROOT)$(SECUREDIR)/$(TITLE).so

clean:
	rm -f $(LIBOBJD) $(LIBOBJS) core *~
	rm -f *.a *.o *.so *.bak dynamic/* static/*
	rm -rf dynamic static

.c.o:	
	$(CC) $(CFLAGS) -c $<

