]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/libpam/modules/pam_permit/Makefile
Initial import of virgin Linux-PAM 0.65, slightly stripped down.
[FreeBSD/FreeBSD.git] / contrib / libpam / modules / pam_permit / Makefile
1 #
2 # $Id: Makefile,v 1.8 1997/04/05 06:33:25 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.8  1997/04/05 06:33:25  morgan
10 # fakeroot
11 #
12 # Revision 1.7  1997/02/15 19:02:27  morgan
13 # updated email address
14 #
15 # Revision 1.6  1996/11/10 20:14:34  morgan
16 # cross platform support
17 #
18 # Revision 1.5  1996/09/05 06:32:45  morgan
19 # ld --> gcc
20 #
21 # Revision 1.4  1996/05/26 15:49:25  morgan
22 # make dynamic and static dirs
23 #
24 # Revision 1.3  1996/05/26 04:04:26  morgan
25 # automated static support
26 #
27 # Revision 1.2  1996/03/16 17:56:38  morgan
28 # tidied up
29 #
30 #
31 # Created by Andrew Morgan <morgan@parc.power.net> 1996/3/11
32 #
33
34 # Convenient defaults for compiling independently of the full source
35 # tree.
36 ifndef FULL_LINUX_PAM_SOURCE_TREE
37 export DYNAMIC=-DPAM_DYNAMIC
38 export CC=gcc
39 export CFLAGS=-O2 -Dlinux -DLINUX_PAM \
40        -ansi -D_POSIX_SOURCE -Wall -Wwrite-strings \
41        -Wpointer-arith -Wcast-qual -Wcast-align -Wtraditional \
42        -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline \
43        -Wshadow -pedantic -fPIC
44 export MKDIR=mkdir -p
45 export LD_D=gcc -shared -Xlinker -x
46 endif
47
48 #
49 #
50
51 TITLE=pam_permit
52
53 #
54
55 LIBSRC = $(TITLE).c
56 LIBOBJ = $(TITLE).o
57 LIBOBJD = $(addprefix dynamic/,$(LIBOBJ))
58 LIBOBJS = $(addprefix static/,$(LIBOBJ))
59
60 ifdef DYNAMIC
61 LIBSHARED = $(TITLE).so
62 endif
63
64 ifdef STATIC
65 LIBSTATIC = lib$(TITLE).o
66 endif
67
68 ####################### don't edit below #######################
69
70 all: dirs $(LIBSHARED) $(LIBSTATIC) register
71
72 dynamic/%.o : %.c
73         $(CC) $(CFLAGS) $(DYNAMIC) $(TARGET_ARCH) -c $< -o $@
74
75 static/%.o : %.c
76         $(CC) $(CFLAGS) $(STATIC) $(TARGET_ARCH) -c $< -o $@
77
78 dirs:
79 ifdef DYNAMIC
80         $(MKDIR) ./dynamic
81 endif
82 ifdef STATIC
83         $(MKDIR) ./static
84 endif
85
86 register:
87 ifdef STATIC
88         ( cd .. ; ./register_static $(TITLE) $(TITLE)/$(LIBSTATIC) )
89 endif
90
91 ifdef DYNAMIC
92 $(LIBOBJD): $(LIBSRC)
93 endif
94
95 ifdef DYNAMIC
96 $(LIBSHARED):   $(LIBOBJD)
97                 $(LD_D) -o $@ $(LIBOBJD)
98 endif
99
100 ifdef STATIC
101 $(LIBOBJS): $(LIBSRC)
102 endif
103
104 ifdef STATIC
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