Initial import from FreeBSD RELENG_4:
[dragonfly.git] / contrib / libpam / modules / pam_deny / Makefile
1 #
2 # $Id: Makefile,v 1.7 1997/04/05 06:43:41 morgan Exp morgan $
3 # $FreeBSD: src/contrib/libpam/modules/pam_deny/Makefile,v 1.3.4.2 2001/06/11 15:28:17 markm Exp $
4 #
5 # This Makefile controls a build process of $(TITLE) module for
6 # Linux-PAM. You should not modify this Makefile (unless you know
7 # what you are doing!).
8 #
9 # $Log: Makefile,v $
10 # Revision 1.7  1997/04/05 06:43:41  morgan
11 # full-source-tree and fakeroot
12 #
13 # Revision 1.6  1997/02/15 19:04:27  morgan
14 # fixed email
15 #
16 # Revision 1.5  1996/11/10 20:11:48  morgan
17 # crossplatform support
18 #
19 # Revision 1.4  1996/09/05 06:50:12  morgan
20 # ld --> gcc
21 #
22 # Revision 1.3  1996/05/26 15:48:38  morgan
23 # make dynamic and static dirs
24 #
25 # Revision 1.2  1996/05/26 04:00:16  morgan
26 # changes for automated static/dynamic modules
27 #
28 # Revision 1.1  1996/03/16 17:47:36  morgan
29 # Initial revision
30 #
31 #
32 # Created by Andrew Morgan <morgan@parc.power.net> 1996/3/11
33 #
34
35 # Convenient defaults for compiling independently of the full source
36 # tree.
37 ifndef FULL_LINUX_PAM_SOURCE_TREE
38 export DYNAMIC=-DPAM_DYNAMIC
39 export CC=gcc
40 export CFLAGS=-O2 -Dlinux -DLINUX_PAM \
41        -ansi -D_POSIX_SOURCE -Wall -Wwrite-strings \
42        -Wpointer-arith -Wcast-qual -Wcast-align -Wtraditional \
43        -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline \
44        -Wshadow -pedantic -fPIC
45 export MKDIR=mkdir -p
46 export LD_D=gcc -shared -Xlinker -x
47 endif
48
49 #
50
51 TITLE=pam_deny
52
53 #
54
55 LIBSRC = $(TITLE).c
56 LIBOBJ = $(TITLE).o
57 LIBOBJD = $(addprefix dynamic/,$(LIBOBJ))
58 LIBOBJS = $(addprefix static/,$(LIBOBJ))
59
60 dynamic/%.o : %.c
61         $(CC) $(CFLAGS) $(DYNAMIC) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
62
63 static/%.o : %.c
64         $(CC) $(CFLAGS) $(STATIC) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
65
66
67 ifdef DYNAMIC
68 LIBSHARED = $(TITLE).so
69 endif
70 ifdef STATIC
71 LIBSTATIC = lib$(TITLE).o
72 endif
73
74 ####################### don't edit below #######################
75
76 dummy:
77         @echo "**** This is not a top-level Makefile "
78         exit
79
80 all: dirs $(LIBSHARED) $(LIBSTATIC) register
81
82 dirs:
83 ifdef DYNAMIC
84         $(MKDIR) ./dynamic
85 endif
86 ifdef STATIC
87         $(MKDIR) ./static
88 endif
89
90 register:
91 ifdef STATIC
92         ( cd .. ; ./register_static $(TITLE) $(TITLE)/$(LIBSTATIC) )
93 endif
94
95 ifdef DYNAMIC
96 $(LIBOBJD): $(LIBSRC)
97
98 $(LIBSHARED):   $(LIBOBJD)
99                 $(LD_D) -o $@ $(LIBOBJD)
100 endif
101
102 ifdef STATIC
103 $(LIBOBJS): $(LIBSRC)
104
105 $(LIBSTATIC): $(LIBOBJS)
106         $(LD) -r -o $@ $(LIBOBJS)
107 endif
108
109 install: all
110         $(MKDIR) $(FAKEROOT)$(SECUREDIR)
111 ifdef DYNAMIC
112         $(INSTALL) -m $(SHLIBMODE) $(LIBSHARED) $(FAKEROOT)$(SECUREDIR)
113 endif
114
115 remove:
116         rm -f $(FAKEROOT)$(SECUREDIR)/$(TITLE).so
117
118 clean:
119         rm -f $(LIBOBJD) $(LIBOBJS) core *~
120
121 extraclean: clean
122         rm -f *.a *.o *.so *.bak
123
124 .c.o:   
125         $(CC) $(CFLAGS) -c $<
126