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