## Process this file with `automake' to generate `Makefile.in' ## -*-makefile-*- ## ## $Id$ ## ## Makefile for `become' ## ## (c) 1998 EBI ## ##----- Licensing notice ---------------------------------------------------- ## ## This file is part of `become' ## ## `Become' is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at your option) any later version. ## ## `Become' is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with `become'; if not, write to the Free Software Foundation, ## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ##----- General setup things ------------------------------------------------ ## --- What to make --- bin_PROGRAMS = become bcquery noinst_LIBRARIES = libbecome.a ##----- Building the main code ---------------------------------------------- ## --- The library contains most of the interesting stuff --- libbecome_a_SOURCES = \ check.c daemon.c \ lexer.l parser.y \ class.c name.c netg.c rule.c userdb.c ypstuff.c \ \ become.h \ check.h daemon.h \ lexer.h parse.h \ class.h name.h netg.h rule.h userdb.h ypstuff.h BUILT_SOURCES = \ parser.c parser.h lexer.c ## --- Yaccing and lexing --- AM_YFLAGS = -d -v dist-hook: for i in $(BUILT_SOURCES); do \ [ -r $(distdir)/$$i ] || ln $$i $(distdir)/$$i; \ done ## --- The main programs --- LDADD = libbecome.a @LEXLIB@ become_SOURCES = become.c bcquery_SOURCES = bcquery.c become_DEPENDENCIES = libbecome.a bcquery_DEPENDENCIES = libbecome.a ##----- Become must be setuid root ------------------------------------------ install-exec-hook: become_prog=$(DESTDIR)/${bindir}/`echo become|sed '${transform}'`; \ { chown root $${become_prog} && \ chmod 4755 $${become_prog}; } || \ { echo ">>>>>"; \ echo ">>>>> $${become_prog} must be installed setuid-root"; \ echo ">>>>>"; \ } ##----- Testing ------------------------------------------------------------- ## --- The test programs --- TESTS = name-test netg-test userdb-test ## --- How to build a test rig --- SUFFIXES = .tro .c.tro: $(COMPILE) -DTEST_RIG $< -c -o $@ ## --- Now build all the test programs --- ## ## This is a right pain. However, `automake' provides no way of automating ## this. (A drop-out to raw perl would be nice, for example.) name-test: name.tro libbecome.a $(LINK) name.tro libbecome.a $(LIBS) userdb-test: userdb.tro libbecome.a $(LINK) userdb.tro libbecome.a $(LIBS) netg-test: netg.tro libbecome.a $(LINK) netg.tro libbecome.a $(LIBS) CLEANFILES = *.tro y.output ##----- That's all, folks ---------------------------------------------------