1## Process this file with automake to produce Makefile.in
2
3# Package: am-utils
4# Level: Makefile for amd/ directory
5# Author: Erez Zadok
6
7# no need for libaminfo to be yet another dynamic library
8noinst_LIBRARIES = libaminfo.a
9sbin_PROGRAMS = amd sun2amd
10
11# man pages
12man_MANS = amd.8 sun2amd.8
13
14# test scripts
15TESTS = test1.sh
16
17# headers this depends on, not to be installed
18noinst_HEADERS = amd.h sun_map.h
19
20# sources which get auto-built (from yacc/lex)
21BUILT_SOURCES =		\
22	conf_parse.c conf_parse.h conf_tok.c	\
23	sun_map_parse.c sun_map_parse.h sun_map_tok.c
24AM_YFLAGS = -d
25
26##############################################################################
27# *.y must be listed before *.l, because of a bug in automake-1.2
28# which will not generate the .h needs for the lex file from the yacc file.
29# I took out the conf .y/.l files b/c of bad interaction between bsd44 make
30# and automake-1.2 rules.
31libaminfo_a_SOURCES =	\
32	sun_map_parse.y	\
33	sun_map_tok.l	\
34	sun_map.c
35
36# the complete list of all optional sources for libaminfo
37EXTRA_libaminfo_a_SOURCES =	\
38	info_file.c	\
39	info_exec.c	\
40	info_hesiod.c	\
41	info_ldap.c	\
42	info_ndbm.c	\
43	info_nis.c	\
44	info_nisplus.c	\
45	info_passwd.c	\
46	info_sun.c	\
47	info_union.c
48
49# AMD_INFO_OBJS: a list of info_*.o objects added, depending on which map
50# types this system supports.
51EXTRA_libaminfo_a_OBJECTS = @AMD_INFO_OBJS@
52libaminfo_a_LIBADD = @AMD_INFO_OBJS@
53libaminfo_a_DEPENDENCIES = @AMD_INFO_OBJS@
54
55##############################################################################
56# sources needed: note .y and .l files have to be first
57# get_args.c is handled separately
58amd_SOURCES =			\
59	conf_parse.y		\
60	conf_tok.l		\
61	\
62	am_ops.c		\
63	amd.c			\
64	amfs_auto.c		\
65	amfs_direct.c		\
66	amfs_error.c		\
67	amfs_generic.c		\
68	amfs_host.c		\
69	amfs_link.c		\
70	amfs_linkx.c		\
71	amfs_nfsl.c		\
72	amfs_nfsx.c		\
73	amfs_program.c		\
74	amfs_root.c		\
75	amfs_toplvl.c		\
76	amfs_union.c		\
77	amq_subr.c		\
78	amq_svc.c		\
79	autil.c			\
80	clock.c			\
81	conf.c			\
82	map.c			\
83	mapc.c			\
84	mntfs.c			\
85	nfs_prot_svc.c		\
86	nfs_start.c		\
87	nfs_subr.c		\
88	opts.c			\
89	readdir.c		\
90	restart.c		\
91	rpc_fwd.c		\
92	sched.c			\
93	srvr_amfs_auto.c	\
94	srvr_nfs.c
95
96# the complete list of all optional sources for amd
97EXTRA_amd_SOURCES =	\
98	ops_cachefs.c	\
99	ops_cdfs.c	\
100	ops_efs.c	\
101	ops_lofs.c	\
102	ops_mfs.c	\
103	ops_nfs.c	\
104	ops_nfs3.c	\
105	ops_nullfs.c	\
106	ops_pcfs.c	\
107	ops_tfs.c	\
108	ops_tmpfs.c	\
109	ops_ufs.c	\
110	ops_umapfs.c	\
111	ops_unionfs.c	\
112	ops_xfs.c	\
113	\
114	get_args.c
115
116# AMD_FS_OBJS: a list of ops_*.o objects added, depending on which
117# filesystem types this system supports.
118EXTRA_amd_OBJECTS = @AMD_FS_OBJS@
119amd_LDADD = $(EXTRA_amd_OBJECTS) get_args.o libaminfo.a ../libamu/libamu.la
120
121##############################################################################
122sun2amd_SOURCES =		\
123	sun2amd.c
124
125sun2amd_LDADD = libaminfo.a ../libamu/libamu.la
126
127##############################################################################
128# must manually add f/lex library to LIBS, and not to LDADD.
129##LIBS = @LIBS@ @LEXLIB@ @WRAPLIB@
130# f/lex libraries are incomatible with multiple scanners: don't include
131LIBS = @LIBS@ @WRAPLIB@
132
133# additional files to distribute and clean
134EXTRA_DIST = ops_TEMPLATE.c $(man_MANS) $(TESTS)
135CLEANFILES = $(BUILT_SOURCES)
136DISTCLEANFILES = build_version.h ops_autofs.c
137
138# do not distribute files that should be generated by lex/yacc locally
139dist-hook:
140	(cd $(distdir) && rm -f $(BUILT_SOURCES))
141
142INCLUDES = -I$(top_srcdir)/include
143
144# allow users to add their own flags via "configure --enable-am-flags=ARG"
145AMU_CFLAGS = @AMU_CFLAGS@
146AM_CFLAGS = @CFLAGS@ $(AMU_CFLAGS)
147
148# dependencies
149$(PROGRAMS): $(LDADD)
150get_args.o: build_version.h
151$(amd_OBJECTS) $(EXTRA_amd_OBJECTS) $(sun2amd_OBJECTS) $(libaminfo_a_OBJECTS) $(EXTRA_libaminfo_a_OBJECTS): \
152	../config.h				\
153	../aux_conf.h				\
154	$(top_srcdir)/include/am_compat.h	\
155	$(top_srcdir)/include/am_defs.h		\
156	$(top_srcdir)/include/am_utils.h	\
157	$(top_srcdir)/include/am_xdr_func.h	\
158	$(top_srcdir)/include/amq_defs.h	\
159	@AMU_NFS_PROT_HEADER@			\
160	@AMU_AUTOFS_PROT_HEADER@		\
161	$(noinst_HEADERS)
162
163# auto-generate build number
164build_version.h: $(amd_OBJECTS) $(EXTRA_amd_OBJECTS) $(libaminfo_a_OBJECTS) $(EXTRA_libaminfo_a_OBJECTS) get_args.c
165	$(top_srcdir)/m4/update_build_version
166