Expunge revision histories in files.
[become] / src / Makefile.am
1 ## Process this file with `automake' to generate `Makefile.in'
2 ## -*-makefile-*-
3 ##
4 ## $Id: Makefile.am,v 1.17 2004/04/08 01:36:20 mdw Exp $
5 ##
6 ## Makefile for `become'
7 ##
8 ## (c) 1998 EBI
9 ##
10
11 ##----- Licensing notice ----------------------------------------------------
12 ##
13 ## This file is part of `become'
14 ##
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.
19 ##
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.
24 ##
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.
28
29 ##----- General setup things ------------------------------------------------
30
31 ## --- What to make ---
32
33 bin_PROGRAMS = become bcquery
34 noinst_LIBRARIES = libbecome.a
35
36 ##----- Building the main code ----------------------------------------------
37
38 ## --- The library contains most of the interesting stuff ---
39
40 libbecome_a_SOURCES = \
41 check.c daemon.c \
42 lexer.l parser.y \
43 class.c name.c netg.c rule.c userdb.c ypstuff.c \
44 \
45 become.h \
46 check.h daemon.h \
47 lexer.h parse.h \
48 class.h name.h netg.h rule.h userdb.h ypstuff.h
49
50 BUILT_SOURCES = \
51 parser.c parser.h lexer.c
52
53 ## --- Yaccing and lexing ---
54
55 YFLAGS = -d -v
56
57 dist-hook:
58 for i in $(BUILT_SOURCES); do \
59 [ -r $(distdir)/$$i ] || ln $$i $(distdir)/$$i; \
60 done
61
62 ## --- The main programs ---
63
64 LDADD = libbecome.a @LEXLIB@
65
66 become_SOURCES = become.c
67 bcquery_SOURCES = bcquery.c
68
69 become_DEPENDENCIES = libbecome.a
70 bcquery_DEPENDENCIES = libbecome.a
71
72 ##----- Become must be setuid root ------------------------------------------
73
74 install-exec-hook:
75 become_prog=$(DESTDIR)/${bindir}/`echo become|sed '${transform}'`; \
76 { chown root $${become_prog} && \
77 chmod 4755 $${become_prog}; } || \
78 { echo ">>>>>"; \
79 echo ">>>>> $${become_prog} must be installed setuid-root"; \
80 echo ">>>>>"; \
81 }
82
83 ##----- Testing -------------------------------------------------------------
84
85 ## --- The test programs ---
86
87 TESTS = name-test netg-test userdb-test
88
89 ## --- How to build a test rig ---
90
91 SUFFIXES = .tro
92 .c.tro:
93 $(COMPILE) -DTEST_RIG $< -c -o $@
94
95 ## --- Now build all the test programs ---
96 ##
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.)
99
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)
106
107 CLEANFILES = *.tro y.output
108
109 ##----- That's all, folks ---------------------------------------------------