summaryrefslogtreecommitdiff
path: root/modules/pam_filter/Makefile
blob: f4db56a9c555eae66d4dc8f99a1afe0d3b8cb4ab (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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#
# $Id$
#
# This Makefile controls a build process of $(TITLE) module for
# Linux-PAM. You should not modify this Makefile (unless you know
# what you are doing!).
#
# Created by Andrew Morgan <morgan@linux.kernel.org> 1996/3/11
#

ifeq ($(OS),solaris)

include ../dont_makefile

else

TITLE=pam_filter
FILTERS=upperLOWER
FILTERSDIR=$(SUPLEMENTED)/pam_filter
export FILTERSDIR

CFLAGS += -I. -I..
#

LIBSRC = $(TITLE).c
LIBOBJ = $(TITLE).o
LIBOBJD = $(addprefix dynamic/,$(LIBOBJ))
LIBOBJS = $(addprefix static/,$(LIBOBJ))

dynamic/%.o : %.c
	$(CC) $(CFLAGS) $(DYNAMIC) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@

static/%.o : %.c
	$(CC) $(CFLAGS) $(STATIC) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@

ifdef DYNAMIC
LIBSHARED = $(TITLE).so
endif

ifdef STATIC
LIBSTATIC = lib$(TITLE).o
endif

####################### don't edit below #######################

dummy:
	@echo "**** This is not a top-level Makefile "
	exit

#
# this is where we compile this module
#

all: dirs $(LIBSHARED) $(LIBSTATIC) register filters

dirs:
	if [ ! -f security ]; then ln -sf include security ; fi
ifdef DYNAMIC
	$(MKDIR) ./dynamic
endif
ifdef STATIC
	$(MKDIR) ./static
endif

register:
ifdef STATIC
	( cd .. ; ./register_static $(TITLE) $(TITLE)/$(LIBSTATIC) )
endif

filters:
	@for i in $(FILTERS) ; do \
		if [ -d $$i ]; then \
		   $(MAKE) -C $$i all ; \
		fi ; \
	done


ifdef DYNAMIC
$(LIBOBJD): $(LIBSRC)
endif

ifdef DYNAMIC
$(LIBSHARED):	$(LIBOBJD)
		$(LD_D) -o $@ $(LIBOBJD)
endif

ifdef STATIC
$(LIBOBJS): $(LIBSRC)
endif

ifdef STATIC
$(LIBSTATIC): $(LIBOBJS)
	$(LD) -r -o $@ $(LIBOBJS)
endif

install: all
	@for i in $(FILTERS) ; do \
		if [ -d $$i ]; then \
		   $(MAKE) -C $$i install ; \
		fi ; \
	done
	$(MKDIR) $(FAKEROOT)$(SECUREDIR)
ifdef DYNAMIC
	$(INSTALL) -m $(SHLIBMODE) $(LIBSHARED) $(FAKEROOT)$(SECUREDIR)
endif
	$(MKDIR) $(FAKEROOT)$(INCLUDED)
	$(INSTALL) -m 644 include/pam_filter.h $(FAKEROOT)$(INCLUDED)

remove:
	rm -f $(FAKEROOT)$(SECUREDIR)/$(TITLE).so
	rm -f $(FAKEROOT)$(INCLUDED)/pam_filter.h
	@for i in $(FILTERS) ; do \
		if [ -d $$i ]; then \
		   $(MAKE) -C $$i remove ; \
		fi ; \
	done

lclean:
	rm -f $(LIBSHARED) $(LIBOBJD) $(LIBOBJS) core *~

clean: lclean
	@for i in $(FILTERS) ; do \
		if [ -d $$i ]; then \
		   $(MAKE) -C $$i clean ; \
		fi ; \
	done

extraclean: lclean
	@rm -f security
	@rm -f *.a *.o *.so *.bak
	for i in $(FILTERS) ; do \
		if [ -d $$i ]; then \
		   $(MAKE) -C $$i extraclean ; \
		fi ; \
	done

security:
	ln -s include security

endif