source: TI12-security/trunk/NDGSecurity/C/Makefile @ 6630

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/NDGSecurity/C/Makefile@6630
Revision 6630, 1.8 KB checked in by pjkersha, 10 years ago (diff)

Keep a record of work on this PAM plugin for Oracle - May be required for MyProxy? CA deployments where Oracle is the native user db.

Line 
1# Convenient defaults for compiling independently of the full source
2# tree.
3ifndef FULL_LINUX_PAM_SOURCE_TREE
4export DYNAMIC=-DPAM_DYNAMIC
5export CC=gcc
6export CFLAGS=-O2 -Dlinux -DLINUX_PAM \
7       -ansi -D_POSIX_SOURCE -Wall -Wwrite-strings \
8       -Wpointer-arith -Wcast-qual -Wcast-align -Wtraditional \
9       -Wnested-externs -Winline \
10       -Wshadow -pedantic -fPIC
11export MKDIR=mkdir -p
12export LD_D=gcc -shared -Xlinker -x -L/usr/lib/mysql -L/u01/app/oracle/product/8.1.7/lib -Wl,-R/u01/app/oracle/product/8.1.7/lib -lsqlora8
13endif
14
15#
16#
17
18TITLE=pam_oci8
19
20#
21
22LIBSRC = $(TITLE).c
23LIBOBJ = $(TITLE).o
24LIBOBJD = $(addprefix dynamic/,$(LIBOBJ))
25LIBOBJS = $(addprefix static/,$(LIBOBJ))
26
27ifdef DYNAMIC
28LIBSHARED = $(TITLE).so
29endif
30
31ifdef STATIC
32LIBSTATIC = lib$(TITLE).o
33endif
34
35####################### don't edit below #######################
36
37all: dirs $(LIBSHARED) $(LIBSTATIC) register
38
39dynamic/%.o : %.c
40        $(CC) $(CFLAGS) $(DYNAMIC) $(TARGET_ARCH) -c $< -o $@
41
42static/%.o : %.c
43        $(CC) $(CFLAGS) $(STATIC) $(TARGET_ARCH) -c $< -o $@
44
45dirs:
46ifdef DYNAMIC
47        $(MKDIR) ./dynamic
48endif
49ifdef STATIC
50        $(MKDIR) ./static
51endif
52
53register:
54ifdef STATIC
55        ( cd .. ; ./register_static $(TITLE) $(TITLE)/$(LIBSTATIC) )
56endif
57
58ifdef DYNAMIC
59$(LIBOBJD): $(LIBSRC)
60endif
61
62ifdef DYNAMIC
63$(LIBSHARED):   $(LIBOBJD)
64                $(LD_D) -o $@ $(LIBOBJD)  -lmysqlclient -lcrypt
65#               cp pam_mysql.so /lib/security/pam_mysql.so
66endif
67
68ifdef STATIC
69$(LIBOBJS): $(LIBSRC)
70endif
71
72ifdef STATIC
73$(LIBSTATIC): $(LIBOBJS)
74        $(LD) -r -o $@ $(LIBOBJS)  -lmysqlclient -lcrypt
75endif
76
77install: all
78        $(MKDIR) $(FAKEROOT)$(SECUREDIR)
79ifdef DYNAMIC
80        $(INSTALL) -m $(SHLIBMODE) $(LIBSHARED) $(FAKEROOT)$(SECUREDIR)
81endif
82
83remove:
84        rm -f $(FAKEROOT)$(SECUREDIR)/$(TITLE).so
85
86clean:
87        rm -f $(LIBOBJD) $(LIBOBJS) core *~
88
89extraclean: clean
90        rm -f *.a *.o *.so *.bak
91
92.c.o:   
93        $(CC) $(CFLAGS) -c $<
94
Note: See TracBrowser for help on using the repository browser.