]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/libpam/modules/pam_env/Makefile
Initial import of virgin Linux-PAM 0.65, slightly stripped down.
[FreeBSD/FreeBSD.git] / contrib / libpam / modules / pam_env / Makefile
1 #
2 # $Id: Makefile,v 1.1 1997/04/05 06:42:35 morgan Exp morgan $
3 #
4 # This Makefile controls a build process of $(TITLE) module for
5 # Linux-PAM. You should not modify this Makefile (unless you know
6 # what you are doing!).
7 #
8 # $Log: Makefile,v $
9 # Revision 1.1  1997/04/05 06:42:35  morgan
10 # Initial revision
11 #
12 # Revision 1.1  1997/01/04 20:32:52  morgan
13 # Initial revision
14 #
15 # Created by Andrew Morgan <morgan@parc.power.net> 1996/12/8
16 # Adaptations by Dave Kinclea and Cristian Gafton
17 #
18
19 TITLE=pam_env
20
21 CONFD=$(CONFIGED)/security
22 export CONFD
23 CONFILE=$(CONFD)/pam_env.conf
24 export CONFILE
25
26 #ifeq ($(HAVE_PWDBLIB),yes)
27 #CFLAGS += -DWANT_PWDB
28 #EXTRALIB = -lpwdb
29 #endif
30
31 #
32
33 LIBSRC = $(TITLE).c
34 LIBOBJ = $(TITLE).o
35 LIBOBJD = $(addprefix dynamic/,$(LIBOBJ))
36 LIBOBJS = $(addprefix static/,$(LIBOBJ))
37
38 ifdef DYNAMIC
39 LIBSHARED = $(TITLE).so
40 endif
41
42 dynamic/%.o : %.c
43         $(CC) $(CFLAGS) $(DYNAMIC) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
44
45 ifdef STATIC
46 LIBSTATIC = lib$(TITLE).o
47 endif
48
49 static/%.o : %.c
50         $(CC) $(CFLAGS) $(STATIC) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
51
52 ####################### don't edit below #######################
53
54 dummy:
55
56         @echo "**** This is not a top-level Makefile "
57         exit
58
59 all: dirs $(LIBSHARED) $(LIBSTATIC) register
60
61 dirs:
62 ifdef DYNAMIC
63         $(MKDIR) ./dynamic
64 endif
65 ifdef STATIC
66         $(MKDIR) ./static
67 endif
68
69 register:
70 ifdef STATIC
71         ( cd .. ; ./register_static $(TITLE) $(TITLE)/$(LIBSTATIC) )
72 endif
73
74 ifdef DYNAMIC
75 $(LIBOBJD): $(LIBSRC)
76
77 $(LIBSHARED):   $(LIBOBJD)
78         $(LD_D) -o $@ $(LIBOBJD) $(EXTRALIB)
79 endif
80
81 ifdef STATIC
82 $(LIBOBJS): $(LIBSRC)
83
84 $(LIBSTATIC): $(LIBOBJS)
85         $(LD) -r -o $@ $(LIBOBJS) $(EXTRALIB)
86 endif
87
88 install: all
89 ifdef DYNAMIC
90         $(MKDIR) $(FAKEROOT)$(SECUREDIR)
91         $(INSTALL) -m $(SHLIBMODE) $(LIBSHARED) $(FAKEROOT)$(SECUREDIR)
92 endif
93         $(MKDIR) $(FAKEROOT)$(SCONFIGED)
94         bash -f ./install_conf
95
96 remove:
97         rm -f $(FAKEROOT)$(SECUREDIR)/$(TITLE).so
98
99 clean:
100         rm -f $(LIBOBJD) $(LIBOBJS) core *~
101
102 extraclean: clean
103         rm -f *.a *.o *.so *.bak dynamic/* static/*
104
105 .c.o:   
106         $(CC) $(CFLAGS) -c $<
107