GNUmakefile.in 1.49 KB
Newer Older
1
#
Leigh B. Stoller's avatar
Leigh B. Stoller committed
2
# EMULAB-COPYRIGHT
3
# Copyright (c) 2000-2004, 2006 University of Utah and the Flux Group.
Leigh B. Stoller's avatar
Leigh B. Stoller committed
4
# All rights reserved.
5
#
Leigh B. Stoller's avatar
Leigh B. Stoller committed
6

7 8 9 10 11 12
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= ..
SUBDIR		= security

include $(OBJDIR)/Makeconf
13

14
BINS		= suexec
15
SBINS		= genlastlog lastlog_daemon
Leigh B. Stoller's avatar
Leigh B. Stoller committed
16

17 18 19 20 21
# These scripts installed setuid, with sudo. 
SETUID_BIN_SCRIPTS   = 
SETUID_SBIN_SCRIPTS  = 
SETUID_LIBX_SCRIPTS  = suexec

22 23 24 25
#
# Force dependencies on the scripts so that they will be rerun through
# configure if the .in file is changed.
# 
26
all:	$(BINS) $(SBINS)
Leigh B. Stoller's avatar
Leigh B. Stoller committed
27

28
include $(TESTBED_SRCDIR)/GNUmakerules
29

30
CFLAGS	+= -O2 -g
31

32 33 34 35 36 37
suexec:		suexec.c suexec.h
	$(CC) $(CFLAGS) \
		-DLOG_EXEC='"$(prefix)/log/suexec.log"' \
		-DDOC_ROOT='"$(prefix)/libexec/"' \
		-DSAFE_PATH='"$(prefix)/libexec:/usr/local/bin:/usr/bin:/bin"'\
		-o suexec $<
38

39
genlastlog:	genlastlog.c
40
	$(CC) $(CFLAGS) -I/usr/local/include -I$(TESTBED_SRCDIR)/lib/libtb \
41 42 43 44
		-DTBDBNAME='"$(TBDBNAME)"' \
		-DUSERSVAR='"$(prefix)/usersvar"' \
		-DOURDOMAIN='"$(OURDOMAIN)"' \
                -DUSERNODE='"$(USERNODE)"' \
45
		-DLOG_TESTBED=$(LOG_TESTBED) \
46 47
		-o genlastlog $< ${OBJDIR}/lib/libtb/libtb.a \
		-L/usr/local/lib/mysql -lmysqlclient
48

49
install: $(addprefix $(INSTALL_LIBEXECDIR)/, $(BINS)) \
50
	$(addprefix $(INSTALL_SBINDIR)/, $(SBINS))
Leigh B. Stoller's avatar
Leigh B. Stoller committed
51 52 53
	@echo "Don't forget to do a post-install as root"

post-install:
54 55
	chown root $(INSTALL_LIBEXECDIR)/suexec
	chmod u+s $(INSTALL_LIBEXECDIR)/suexec
Leigh B. Stoller's avatar
Leigh B. Stoller committed
56

57 58 59
#
# Control node installation (okay, plastic)
#
60
control-install:
61

Leigh B. Stoller's avatar
Leigh B. Stoller committed
62
clean:
Mike Hibler's avatar
Mike Hibler committed
63
	rm -f *.o genlastlog suexec core