1 ## Process this file with `automake' to generate `Makefile.in'
6 ## Makefile for `become'
11 ##----- Licensing notice ----------------------------------------------------
13 ## This file is part of `become'
15 ## `Become' is free software; you can redistribute it and/or modify
16 ## it under the terms of the GNU General Public License as published by
17 ## the Free Software Foundation; either version 2 of the License, or
18 ## (at your option) any later version.
20 ## `Become' is distributed in the hope that it will be useful,
21 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
22 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ## GNU General Public License for more details.
25 ## You should have received a copy of the GNU General Public License
26 ## along with `become'; if not, write to the Free Software Foundation,
27 ## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 ##----- General setup things ------------------------------------------------
31 ## --- What to make ---
33 bin_PROGRAMS = become bcquery
34 noinst_LIBRARIES = libbecome.a
36 ##----- Building the main code ----------------------------------------------
38 ## --- The library contains most of the interesting stuff ---
40 libbecome_a_SOURCES = \
43 class.c name.c netg.c rule.c userdb.c ypstuff.c \
48 class.h name.h netg.h rule.h userdb.h ypstuff.h
51 parser.c parser.h lexer.c
53 ## --- Yaccing and lexing ---
58 for i in $(BUILT_SOURCES); do \
59 [ -r $(distdir)/$$i ] || ln $$i $(distdir)/$$i; \
62 ## --- The main programs ---
64 LDADD = libbecome.a @LEXLIB@
66 become_SOURCES = become.c
67 bcquery_SOURCES = bcquery.c
69 become_DEPENDENCIES = libbecome.a
70 bcquery_DEPENDENCIES = libbecome.a
72 ##----- Become must be setuid root ------------------------------------------
75 become_prog=$(DESTDIR)/${bindir}/`echo become|sed '${transform}'`; \
76 { chown root $${become_prog} && \
77 chmod 4755 $${become_prog}; } || \
79 echo ">>>>> $${become_prog} must be installed setuid-root"; \
83 ##----- Testing -------------------------------------------------------------
85 ## --- The test programs ---
87 TESTS = name-test netg-test userdb-test
89 ## --- How to build a test rig ---
93 $(COMPILE) -DTEST_RIG $< -c -o $@
95 ## --- Now build all the test programs ---
97 ## This is a right pain. However, `automake' provides no way of automating
98 ## this. (A drop-out to raw perl would be nice, for example.)
100 name-test: name.tro libbecome.a
101 $(LINK) name.tro libbecome.a $(LIBS)
102 userdb-test: userdb.tro libbecome.a
103 $(LINK) userdb.tro libbecome.a $(LIBS)
104 netg-test: netg.tro libbecome.a
105 $(LINK) netg.tro libbecome.a $(LIBS)
107 CLEANFILES = *.tro y.output
109 ##----- That's all, folks ---------------------------------------------------