head	1.7;
access;
symbols;
locks; strict;
comment	@# @;


1.7
date	97.01.04.20.34.15;	author morgan;	state Exp;
branches;
next	1.6;

1.6
date	96.11.10.20.13.54;	author morgan;	state Exp;
branches;
next	1.5;

1.5
date	96.09.05.06.28.22;	author morgan;	state Exp;
branches;
next	1.4;

1.4
date	96.05.26.15.49.13;	author morgan;	state Exp;
branches;
next	1.3;

1.3
date	96.05.26.04.04.08;	author morgan;	state Exp;
branches;
next	1.2;

1.2
date	96.05.21.05.42.26;	author morgan;	state Exp;
branches;
next	1.1;

1.1
date	96.05.21.04.55.00;	author morgan;	state Exp;
branches;
next	;


desc
@@


1.7
log
@conditional compilation exclude solaris
@
text
@# This Makefile controls a build process of the pam_passwd+ modules
# for Linux-PAM.

ifeq ($(OS),solaris)
include ../dont_makefile
else

LIBSESSSH =
LIBAUTHSH =
LIBPASSWDSH = pam_passwd+.so

ifdef STATIC
LIBSTATIC = libpam_passwd+.o
endif

LIBAUTHOBJ =
LIBAUTHSRC =
LIBSESSOBJ =
LIBSESSSRC =
LIBPASSWDSRC = load.c log.c pattern.c prog.c util.c verify.c \
		pam_passwd+.c test.y passwd.h sys.h
LIBPASSWDOBJ = load.o log.o pattern.o prog.o util.o verify.o \
		test.o pam_passwd+.o
LIBOBJ = $(LIBAUTHOBJ) $(LIBSESSOBJ) $(LIBPASSWDOBJ)
LIBSRC = $(LIBAUTHSRC) $(LIBSESSSRC) $(LIBPASSWDSRC)
LIBOBJD = $(addprefix dynamic/,$(LIBOBJ))
LIBOBJS = $(addprefix static/,$(LIBOBJ))

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

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


# when the other pieces are written, uncomment them
ifdef DYNAMIC
LIBSHARED = $(LIBPASSWDSH) # $(LIBSESSSH) $(LIBAUTHSH) 
endif

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

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

register:
ifdef STATIC
	( cd .. ; ./register_static pam_passwdPLUS pam_passwd+/$(LIBSTATIC) )
endif

ifdef DYNAMIC
$(LIBOBJD): $(LIBSRC)
endif

ifdef DYNAMIC
$(LIBSHARED):	$(LIBOBJD)
		$(LD_D) -o $@@ $(LIBOBJD)
endif

ifdef STATIC
$(LIBOBJS): $(LIBSRC)
endif

ifdef STATIC
$(LIBSTATIC): $(LIBOBJS)
	$(LD) -r -o $@@ $(LIBOBJS)
endif

install: all
	$(MKDIR) $(SECUREDIR)
ifdef DYNAMIC
	$(INSTALL) -m 644 $(LIBSHARED) $(SECUREDIR)
endif

remove:
	cd $(SECUREDIR) && rm -f $(LIBPASSWDSH) $(LIBSESSSH) $(LIBAUTHSH)

clean:
	rm -f $(LIBOBJD) $(LIBOBJS) a.out core *~

extraclean: clean
	rm -f *.a *.out *.o *.so *.bak

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

# This is a list of the local include files so that Makefile will work properly
load.o:			load.c passwd.h sys.h extdecs.h
log.o:			log.c passwd.h sys.h extdecs.h
pam_passwd+_passwd.o:	pam_passwd+_passwd.c extdecs.h
pattern.o:		pattern.c passwd.h sys.h extdecs.h
prog.o:			prog.c passwd.h sys.h extdecs.h
util.o:			util.c passwd.h sys.h extdecs.h
verify.o:		verify.c passwd.h sys.h extdecs.h

# The 'sed' execution corrects a flaw in the bison.simple file
test.c:		test.y passwd.h sys.h extdecs.h
	bison -y test.y
	sed -e 's/yyparse (void)/yyparse (void *)/' <y.tab.c >test.c
	rm y.tab.c

test.o:	test.c

endif@


1.6
log
@cross platform support
@
text
@d4 4
d108 2
@


1.5
log
@ld --> gcc
@
text
@a36 9
WARNINGS =  -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual \
	-Wcast-align -Wtraditional -Wstrict-prototypes -Wmissing-prototypes \
	-Wnested-externs -Winline -Wshadow -pedantic

AR = ar -cr

CFLAGS = -DLINUX -ansi -D_POSIX_SOURCE -g -pipe $(WARNINGS) \
	 -I../../include -fPIC

d41 1
a41 1
	mkdir -p ./dynamic
d44 1
a44 1
	mkdir -p ./static
d71 1
a71 1
	mkdir -p $(SECUREDIR)
d73 1
a73 1
	install -m644 $(LIBSHARED) $(SECUREDIR)
@


1.4
log
@make dynamic and static dirs
@
text
@d67 1
a67 1
		$(LD) -x --shared -o $@@ $(LIBOBJD)
@


1.3
log
@automated static support
@
text
@d46 9
a54 1
all:	$(LIBSHARED) $(LIBSTATIC) register
@


1.2
log
@added remove option
@
text
@d7 4
a10 1
LIBSTATIC = libpam_passwd+.a
d22 8
d31 5
a35 1
LIBSHARED = $(LIBSESSSH) $(LIBAUTHSH) $(LIBPASSWDSH)
d46 1
a46 5
all:	$(LIBPASSWDSH) $(LIBSTATIC)

$(LIBSTATIC): $(LIBOBJ)
	$(AR) $@@ $(LIBOBJ)
	ranlib $@@
d48 22
a69 2
$(LIBPASSWDSH):	$(LIBOBJ)
	$(LD) -x --shared -o $@@ $(LIBOBJ)
d73 1
d75 1
d78 1
a78 1
	cd $(SECUREDIR) && rm -f $(LIBSHARED)
d81 1
a81 1
	rm -f $(LIBSHARED) $(LIBSTATIC) $(LIBOBJ) a.out core *~
@


1.1
log
@Initial revision
@
text
@d44 3
@
