summaryrefslogtreecommitdiffstats
path: root/sss_client/Makefile.in
blob: 37156e3d8bb12b37ebfb0baff17cc6ee25e164da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!gmake
#
# Makefile for nss client

CC = @CC@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
includedir = @includedir@
libdir = @libdir@
VPATH = @srcdir@
srcdir = @srcdir@
builddir = @builddir@
INSTALLCMD = @INSTALL@
CPPFLAGS = @CPPFLAGS@
CFLAGS := $(CPPFLAGS) @CFLAGS@ $(CFLAGS)
LDFLAGS = @LDFLAGS@
EXEEXT = @EXEEXT@
SHLD = @SHLD@
SHLD_FLAGS = @SHLD_FLAGS@
PACKAGE_VERSION = @PACKAGE_VERSION@
PICFLAG = @PICFLAG@
SHLIBEXT = @SHLIBEXT@
LIB_PATH_VAR = @LIB_PATH_VAR@

NSS_SSS_SOLIB = libnss_sss.$(SHLIBEXT)
NSS_SSS_SONAME = libnss_sss.$(SHLIBEXT).2

NSS_SSS_OBJS = common.o passwd.o group.o

PAM_SSS_SOLIB = pam_sss.$(SHLIBEXT)
PAM_SSS_OBJS = pam_sss.o common.o
PAM_LIBS = -lpam -lpam_misc
PAM_CFLAGS = -Wall -Werror

PAM_CLIENT = pam_test_client
PAM_CLIENT_OBJS = pam_test_client.o

default: all

showflags:
	@echo 'Compile flags:'
	@echo '  CFLAGS = $(CFLAGS)'
	@echo '  CPPFLAGS = $(CPPFLAGS)'
	@echo '  LDFLAGS = $(LDFLAGS)'
	@echo '  LIBS = $(LIBS)'

.SUFFIXES: .c .o

.c.o:
	@echo Compiling $*.c
	@$(CC) $(PICFLAG) $(CFLAGS) -c $< -o $@

$(NSS_SSS_SOLIB): $(NSS_SSS_OBJS)
	$(SHLD) $(SHLD_FLAGS) -o $@ $(NSS_SSS_OBJS) @SONAMEFLAG@$(NSS_SSS_SONAME)

$(NSS_SSS_SONAME): $(NSS_SSS_SOLIB)
	ln -fs $< $@

pam_sss.o: pam_sss.c
	@echo Compiling $*.c
	@$(CC) $(PICFLAG) $(CFLAGS) $(PAM_CFLAGS) -c $< -o $@

$(PAM_CLIENT): $(PAM_CLIENT_OBJS)
	@$(CC) $(CFLAGS) $(PAM_CFLAGS) $< -o $@ $(PAM_LIBS)

$(PAM_SSS_SOLIB): $(PAM_SSS_OBJS)
	$(SHLD) $(SHLD_FLAGS) -o $@ $(PAM_SSS_OBJS) $(PAM_LIBS)

all: showflags $(NSS_SSS_OBJS) $(NSS_SSS_SOLIB) $(NSS_SSS_SONAME) $(PAM_SSS_SOLIB) $(PAM_CLIENT)

install: all
	$(INSTALLCMD) -d $(DESTDIR)${libdir}
	$(INSTALLCMD) -m 755 $(NSS_SSS_SOLIB) $(DESTDIR)${libdir}
	ln -fs $(NSS_SSS_SOLIB) $(DESTDIR)${libdir}/$(NSS_SSS_SONAME)
	$(INSTALLCMD) -d $(DESTDIR)${libdir}/security
	$(INSTALLCMD) -m 755 $(PAM_SSS_SOLIB) $(DESTDIR)${libdir}/security

clean:
	rm -f *.o *.a */*.o
	rm -f $(NSS_SSS_SOLIB) $(NSS_SSS_SONAME) $(PAM_SSS_SOLIB) $(PAM_CLIENT)

distclean: clean
	rm -f config.log config.status config.h config.cache
	rm -f Makefile
	rm -f *~ */*~

realdistclean: distclean
	rm -f configure config.h.in