Light fixes for strange building.
[become] / src / Makefile.am
CommitLineData
8ddbfc62 1## Process this file with `automake' to generate `Makefile.in'
2## -*-makefile-*-
3##
8bdddfb7 4## $Id: Makefile.am,v 1.16 2003/10/12 00:39:16 mdw Exp $
8ddbfc62 5##
6## Makefile for `become'
7##
c758e654 8## (c) 1998 EBI
8ddbfc62 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##----- Revision history ----------------------------------------------------
30##
31## $Log: Makefile.am,v $
8bdddfb7 32## Revision 1.16 2003/10/12 00:39:16 mdw
33## Light fixes for strange building.
34##
bc8fea85 35## Revision 1.15 2003/10/12 00:15:34 mdw
36## Fix to makefile install rules.
37##
f60a3434 38## Revision 1.14 2003/10/12 00:14:55 mdw
39## Major overhaul. Now uses DSA signatures rather than the bogus symmetric
40## encrypt-and-hope thing. Integrated with mLib and Catacomb.
41##
e646baee 42## Revision 1.13 1999/05/04 16:50:59 mdw
43## Change library to `libbecome.a', for aesthetic reasons.
44##
03820e87 45## Revision 1.12 1999/05/04 16:36:03 mdw
46## Changes for new Automake version.
47##
48## Revision 1.11 1998/06/18 15:52:05 mdw
705e795a 49## Remove the IDEA test case.
50##
4710b942 51## Revision 1.10 1998/04/23 13:17:17 mdw
52## New program `bcquery', and `ypstuff' module added.
53##
5b175cbb 54## Revision 1.9 1998/02/20 18:12:35 mdw
55## Make the `become' program setuid root when installing.
56##
c758e654 57## Revision 1.8 1998/01/12 16:45:36 mdw
58## Fix copyright date.
59##
9e5602f0 60## Revision 1.7 1997/09/26 09:14:57 mdw
61## Merged blowfish branch into trunk.
62##
63## Revision 1.6.2.1 1997/09/26 09:07:56 mdw
64## Use the Blowfish encryption algorithm instead of IDEA. This is partly
65## because I prefer Blowfish (without any particularly strong evidence) but
66## mainly because IDEA is patented and Blowfish isn't.
67##
07d8362a 68## Revision 1.6 1997/09/18 11:17:18 mdw
69## Fix comment leaders. Don't know why this CVS keeps breaking them.
70## Could be DEC's bogus version of RCS being picked up.
71##
72## Revision 1.5 1997/09/17 10:28:25 mdw
c426c3c9 73## Remove `set.c'. No longer necessary.
0d036225 74##
07d8362a 75## Revision 1.4 1997/08/20 16:14:12 mdw
76## Build parser and lexer into the source directory. Other cosmetic
77## things.
78##
a68d9c21 79## Revision 1.3 1997/08/07 09:39:36 mdw
80## Add new source files, and remove options inappropriate for subsidiary
81## Makefiles.
82##
03f996bd 83## Revision 1.2 1997/08/04 10:24:19 mdw
8ddbfc62 84## Sources placed under CVS control.
85##
86
87##----- General setup things ------------------------------------------------
88
8ddbfc62 89## --- What to make ---
90
f60a3434 91bin_PROGRAMS = become bcquery
e646baee 92noinst_LIBRARIES = libbecome.a
8ddbfc62 93
94##----- Building the main code ----------------------------------------------
95
96## --- The library contains most of the interesting stuff ---
97
e646baee 98libbecome_a_SOURCES = \
8ddbfc62 99 check.c daemon.c \
100 lexer.l parser.y \
f60a3434 101 class.c name.c netg.c rule.c userdb.c ypstuff.c \
8ddbfc62 102 \
103 become.h \
104 check.h daemon.h \
03820e87 105 lexer.h parse.h \
f60a3434 106 class.h name.h netg.h rule.h userdb.h ypstuff.h
8ddbfc62 107
e646baee 108BUILT_SOURCES = \
109 parser.c parser.h lexer.c
110
8ddbfc62 111## --- Yaccing and lexing ---
112
03820e87 113YFLAGS = -d -v
114
03820e87 115dist-hook:
116 for i in $(BUILT_SOURCES); do \
117 [ -r $(distdir)/$$i ] || ln $$i $(distdir)/$$i; \
118 done
8ddbfc62 119
120## --- The main programs ---
121
e646baee 122LDADD = libbecome.a @LEXLIB@
0d036225 123
8ddbfc62 124become_SOURCES = become.c
4710b942 125bcquery_SOURCES = bcquery.c
8ddbfc62 126
e646baee 127become_DEPENDENCIES = libbecome.a
e646baee 128bcquery_DEPENDENCIES = libbecome.a
8ddbfc62 129
5b175cbb 130##----- Become must be setuid root ------------------------------------------
131
03820e87 132install-exec-hook:
bc8fea85 133 become_prog=$(DESTDIR)/${bindir}/`echo become|sed '${transform}'`; \
5b175cbb 134 { chown root $${become_prog} && \
135 chmod 4755 $${become_prog}; } || \
136 { echo ">>>>>"; \
137 echo ">>>>> $${become_prog} must be installed setuid-root"; \
138 echo ">>>>>"; \
139 }
140
8ddbfc62 141##----- Testing -------------------------------------------------------------
142
143## --- The test programs ---
144
8bdddfb7 145TESTS = name-test netg-test userdb-test
8ddbfc62 146
147## --- How to build a test rig ---
148
149SUFFIXES = .tro
150.c.tro:
8bdddfb7 151 $(COMPILE) -DTEST_RIG $< -c -o $@
8ddbfc62 152
153## --- Now build all the test programs ---
154##
155## This is a right pain. However, `automake' provides no way of automating
156## this. (A drop-out to raw perl would be nice, for example.)
157
e646baee 158name-test: name.tro libbecome.a
159 $(LINK) name.tro libbecome.a $(LIBS)
e646baee 160userdb-test: userdb.tro libbecome.a
161 $(LINK) userdb.tro libbecome.a $(LIBS)
e646baee 162netg-test: netg.tro libbecome.a
8bdddfb7 163 $(LINK) netg.tro libbecome.a $(LIBS)
8ddbfc62 164
0d036225 165CLEANFILES = *.tro y.output
166
8ddbfc62 167##----- That's all, folks ---------------------------------------------------