aboutsummaryrefslogtreecommitdiffstats
path: root/modules/Makefile
blob: a05e97a0fad849f75d5110472aeee1369f8aa9a0 (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
# $Id$
#
# Makefile for autofs
#

-include ../Makefile.conf
include ../Makefile.rules

SRCS :=	lookup_yp.c  lookup_file.c  lookup_program.c  lookup_userhome.c \
	lookup_multi.c \
	parse_sun.c    \
	mount_generic.c  mount_nfs.c  mount_afs.c  mount_autofs.c \
	mount_changer.c  mount_bind.c mount_default.c

MODS :=	lookup_yp.so lookup_file.so lookup_program.so lookup_userhome.so \
	lookup_multi.so \
	parse_sun.so \
	mount_generic.so mount_nfs.so mount_afs.so mount_autofs.so \
	mount_changer.so mount_bind.so mount_default.so

ifeq ($(EXT2FS), 1)
  SRCS += mount_ext2.c
  MODS += mount_ext2.so
endif

ifeq ($(HESIOD), 1)
  SRCS += lookup_hesiod.c  parse_hesiod.c
  MODS += lookup_hesiod.so parse_hesiod.so
endif

ifeq ($(NISPLUS), 1)
  SRCS += lookup_nisplus.c
  MODS += lookup_nisplus.so
endif

ifeq ($(LDAP), 1)
  SRCS += lookup_ldap.c
  MODS += lookup_ldap.so
endif

CFLAGS += -I../include -fPIC -DAUTOFS_LIB_DIR=\"$(autofslibdir)\" -DPATH_AUTOMOUNT=\"$(sbindir)/automount\"

all: $(MODS)

clean:
	rm -f *.o *.s *.so

# mount_smbfs.so is an obsolete module which must be removed
install: all
	install -d -m 755 $(INSTALLROOT)$(autofslibdir)
	install -c $(MODS) -m 755 $(INSTALLROOT)$(autofslibdir)
	-rm -f $(INSTALLROOT)$(autofslibdir)/mount_smbfs.so

#
# Ad hoc compilation rules for modules which need auxilliary libraries
#
lookup_yp.so: lookup_yp.c
	$(CC) $(SOLDFLAGS) $(CFLAGS) -o lookup_yp.so lookup_yp.c $(LIBNSL)
	$(STRIP) lookup_yp.so

lookup_nisplus.so: lookup_nisplus.c
	$(CC) $(SOLDFLAGS) $(CFLAGS) -o lookup_nisplus.so lookup_nisplus.c \
		$(LIBNSL)
	$(STRIP) lookup_nisplus.so

lookup_hesiod.so: lookup_hesiod.c
	$(CC) $(SOLDFLAGS) $(CFLAGS) $(HESIOD_FLAGS) -o lookup_hesiod.so \
		lookup_hesiod.c $(LIBHESIOD) $(LIBRESOLV)
	$(STRIP) lookup_hesiod.so

lookup_ldap.so: lookup_ldap.c
	$(CC) $(SOLDFLAGS) $(CFLAGS) $(LDAP_FLAGS) -o lookup_ldap.so \
		lookup_ldap.c $(LIBLDAP)
	$(STRIP) lookup_ldap.so