]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/libpam/modules/pam_group/Makefile
Initial import of virgin Linux-PAM 0.65, slightly stripped down.
[FreeBSD/FreeBSD.git] / contrib / libpam / modules / pam_group / Makefile
1 #
2 # $Id: Makefile,v 1.6 1997/04/05 06:39:56 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.6  1997/04/05 06:39:56  morgan
10 # fakeroot
11 #
12 # Revision 1.5  1997/01/04 20:28:47  morgan
13 # compile with and without libpwdb
14 #
15 # Revision 1.4  1996/11/10 20:13:18  morgan
16 # cross platform support
17 #
18 # Created by Andrew Morgan <morgan@parc.power.net> 1996/6/11
19 #
20
21 TITLE=pam_group
22 CONFD=$(CONFIGED)/security
23 export CONFD
24 CONFILE=$(CONFD)/group.conf
25 export CONFILE
26
27 #
28
29 LIBSRC = $(TITLE).c
30 LIBOBJ = $(TITLE).o
31 LIBOBJD = $(addprefix dynamic/,$(LIBOBJ))
32 LIBOBJS = $(addprefix static/,$(LIBOBJ))
33
34 DEFS=-DCONFILE=\"$(CONFILE)\"
35 ifndef STATIC
36 ifeq ($(HAVE_PWDBLIB),yes)
37  DEFS+=-DWANT_PWDB
38  ELIBS=-lpwdb
39 endif
40 endif
41
42 CFLAGS += $(DEFS)
43
44 dynamic/%.o : %.c
45         $(CC) $(CFLAGS) $(DYNAMIC) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
46
47 static/%.o : %.c
48         $(CC) $(CFLAGS) $(STATIC) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
49
50
51 ifdef DYNAMIC
52 LIBSHARED = $(TITLE).so
53 endif
54 ifdef STATIC
55 LIBSTATIC = lib$(TITLE).o
56 endif
57
58 ####################### don't edit below #######################
59
60 dummy:
61         @echo "**** This is not a top-level Makefile "
62         exit
63
64 all: dirs $(LIBSHARED) $(LIBSTATIC) register
65
66 dirs:
67 ifdef DYNAMIC
68         $(MKDIR) ./dynamic
69 endif
70 ifdef STATIC
71         $(MKDIR) ./static
72 endif
73
74 register:
75 ifdef STATIC
76         ( cd .. ; ./register_static $(TITLE) $(TITLE)/$(LIBSTATIC) )
77 endif
78
79 ifdef DYNAMIC
80 $(LIBOBJD): $(LIBSRC)
81
82 $(LIBSHARED):   $(LIBOBJD)
83                 $(LD_D) -o $@ $(LIBOBJD) $(ELIBS)
84 endif
85
86 ifdef STATIC
87 $(LIBOBJS): $(LIBSRC)
88
89 $(LIBSTATIC): $(LIBOBJS)
90         $(LD) -r -o $@ $(LIBOBJS) $(ELIBS)
91 endif
92
93 install: all
94 ifdef DYNAMIC
95         $(MKDIR) $(FAKEROOT)$(SECUREDIR)
96         $(INSTALL) -m $(SHLIBMODE) $(LIBSHARED) $(FAKEROOT)$(SECUREDIR)
97 endif
98         $(MKDIR) $(FAKEROOT)$(SCONFIGED)
99         bash -f ./install_conf
100
101 remove:
102         rm -f $(FAKEROOT)$(SECUREDIR)/$(TITLE).so
103         rm -f $(FAKEROOT)$(CONFILE)
104
105 clean:
106         rm -f $(LIBOBJD) $(LIBOBJS) core *~
107         rm -f ./.ignore_age
108
109 extraclean: clean
110         rm -f *.a *.o *.so *.bak
111
112 .c.o:   
113         $(CC) $(CFLAGS) -c $<
114