Initial import from FreeBSD RELENG_4:
[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 #
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.8  1997/04/05 06:33:25  morgan
11 # fakeroot
12 #
13 # Revision 1.7  1997/02/15 19:02:27  morgan
14 # updated email address
15 #
16 # Revision 1.6  1996/11/10 20:14:34  morgan
17 # cross platform support
18 #
19 # Revision 1.5  1996/09/05 06:32:45  morgan
20 # ld --> gcc
21 #
22 # Revision 1.4  1996/05/26 15:49:25  morgan
23 # make dynamic and static dirs
24 #
25 # Revision 1.3  1996/05/26 04:04:26  morgan
26 # automated static support
27 #
28 # Revision 1.2  1996/03/16 17:56:38  morgan
29 # tidied up
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
52 TITLE=pam_permit
53
54 #
55
56 LIBSRC = $(TITLE).c
57 LIBOBJ = $(TITLE).o
58 LIBOBJD = $(addprefix dynamic/,$(LIBOBJ))
59 LIBOBJS = $(addprefix static/,$(LIBOBJ))
60
61 ifdef DYNAMIC
62 LIBSHARED = $(TITLE).so
63 endif
64
65 ifdef STATIC
66 LIBSTATIC = lib$(TITLE).o
67 endif
68
69 ####################### don't edit below #######################
70
71 all: dirs $(LIBSHARED) $(LIBSTATIC) register
72
73 dynamic/%.o : %.c
74         $(CC) $(CFLAGS) $(DYNAMIC) $(TARGET_ARCH) -c $< -o $@
75
76 static/%.o : %.c
77         $(CC) $(CFLAGS) $(STATIC) $(TARGET_ARCH) -c $< -o $@
78
79 dirs:
80 ifdef DYNAMIC
81         $(MKDIR) ./dynamic
82 endif
83 ifdef STATIC
84         $(MKDIR) ./static
85 endif
86
87 register:
88 ifdef STATIC
89         ( cd .. ; ./register_static $(TITLE) $(TITLE)/$(LIBSTATIC) )
90 endif
91
92 ifdef DYNAMIC
93 $(LIBOBJD): $(LIBSRC)
94 endif
95
96 ifdef DYNAMIC
97 $(LIBSHARED):   $(LIBOBJD)
98                 $(LD_D) -o $@ $(LIBOBJD)
99 endif
100
101 ifdef STATIC
102 $(LIBOBJS): $(LIBSRC)
103 endif
104
105 ifdef STATIC
106 $(LIBSTATIC): $(LIBOBJS)
107         $(LD) -r -o $@ $(LIBOBJS)
108 endif
109
110 install: all
111         $(MKDIR) $(FAKEROOT)$(SECUREDIR)
112 ifdef DYNAMIC
113         $(INSTALL) -m $(SHLIBMODE) $(LIBSHARED) $(FAKEROOT)$(SECUREDIR)
114 endif
115
116 remove:
117         rm -f $(FAKEROOT)$(SECUREDIR)/$(TITLE).so
118
119 clean:
120         rm -f $(LIBOBJD) $(LIBOBJS) core *~
121
122 extraclean: clean
123         rm -f *.a *.o *.so *.bak
124
125 .c.o:   
126         $(CC) $(CFLAGS) -c $<
127