GNUmakefile.in 3.17 KB
Newer Older
1
#
Leigh B. Stoller's avatar
Leigh B. Stoller committed
2
# EMULAB-COPYRIGHT
3
# Copyright (c) 2000-2009 University of Utah and the Flux Group.
Leigh B. Stoller's avatar
Leigh B. Stoller committed
4
# All rights reserved.
5
#
6 7 8 9
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= ..
SUBDIR		= db
10
UNIFIED         = @UNIFIED_BOSS_AND_OPS@
11

12
include $(OBJDIR)/Makeconf
13

14
BIN_SCRIPTS	= nalloc nfree nodeip readycount 
15
SBIN_SCRIPTS	= avail inuse showgraph if2port backup webcontrol node_status \
16
                  genelists genelists.proxy dhcpd_makeconf nodelog unixgroups \
17
		  dbcheck interswitch dbboot grabron stategraph newwanode \
18
		  idletimes idlemail setsitevar audit changeuid changepid \
19
		  elabinelab_bossinit update_permissions mysqld_watchdog \
20 21
		  dumperrorlog changeleader checkstats changecreator \
		  dbupdate
22

23 24
WEB_SBIN_SCRIPTS= webnodelog webnewwanode webidlemail webchangeuid \
		  webchangeleader
25 26
WEB_BIN_SCRIPTS = webnfree
LIBEXEC_SCRIPTS = $(WEB_BIN_SCRIPTS) $(WEB_SBIN_SCRIPTS) xmlconvert
27
LIB_SCRIPTS     = libdb.pm Node.pm libdb.py libadminctrl.pm Experiment.pm \
28
		  NodeType.pm Interface.pm User.pm Group.pm Project.pm \
29
		  Image.pm OSinfo.pm Archive.pm Logfile.pm Lan.pm emdbi.pm \
30
		  emutil.pm Firewall.pm
31

32
# Stuff installed on plastic.
33
USERSBINS	= genelists.proxy dumperrorlog.proxy
David Johnson's avatar
David Johnson committed
34
USERLIBS	= libtbdb.pm libdb.py
35

36 37
# These scripts installed setuid, with sudo. 
SETUID_BIN_SCRIPTS   = 
38 39
SETUID_SBIN_SCRIPTS  = genelists dhcpd_makeconf elabinelab_bossinit \
                       changecreator
40 41
SETUID_LIBX_SCRIPTS  = 

42
#
43 44 45
# Force dependencies on the scripts so that they will be rerun through
# configure if the .in file is changed.
# 
46
all:	$(BIN_SCRIPTS) $(SBIN_SCRIPTS) $(LIBEXEC_SCRIPTS) $(LIB_SCRIPTS) \
47
	$(USERSBINS) $(USERLIBS) schemacheck dbfillcheck
48

49
include $(TESTBED_SRCDIR)/GNUmakerules
50

51 52
install: $(addprefix $(INSTALL_BINDIR)/, $(BIN_SCRIPTS)) \
	$(addprefix $(INSTALL_SBINDIR)/, $(SBIN_SCRIPTS)) \
53
	$(addprefix $(INSTALL_LIBDIR)/, $(LIB_SCRIPTS)) \
54 55 56
	$(addprefix $(INSTALL_LIBEXECDIR)/, $(LIBEXEC_SCRIPTS)) \
        $(addprefix $(INSTALL_DIR)/opsdir/sbin/, $(USERSBINS)) \
        $(addprefix $(INSTALL_DIR)/opsdir/lib/, $(USERLIBS))
57

Leigh B. Stoller's avatar
Leigh B. Stoller committed
58 59
boss-install: install

60 61 62
post-install: 
	chown root $(INSTALL_SBINDIR)/genelists
	chmod u+s $(INSTALL_SBINDIR)/genelists
63 64
	chown root $(INSTALL_SBINDIR)/dhcpd_makeconf
	chmod u+s $(INSTALL_SBINDIR)/dhcpd_makeconf
65 66
	chown root $(INSTALL_SBINDIR)/elabinelab_bossinit
	chmod u+s $(INSTALL_SBINDIR)/elabinelab_bossinit
67

68 69 70
#
# Control node installation (okay, plastic)
#
71 72
control-install: $(addprefix $(INSTALL_SBINDIR)/, $(USERSBINS)) \
	$(addprefix $(INSTALL_LIBDIR)/, $(USERLIBS))
73

74 75 76 77 78 79 80 81 82 83
# This rule says what web* script depends on which installed binary directory.
$(WEB_SBIN_SCRIPTS): $(INSTALL_SBINDIR)
$(WEB_BIN_SCRIPTS):  $(INSTALL_BINDIR)

# Just in case the dirs are not yet created,
$(INSTALL_SBINDIR) $(INSTALL_BINDIR):

# And then how to turn the template into the actual script. 
$(WEB_SBIN_SCRIPTS) $(WEB_BIN_SCRIPTS): $(TESTBED_SRCDIR)/WEBtemplate.in
	@echo "Generating $@"
84
	cat $< | sed -e 's,@PROGTOINVOKE@,$(word 2,$^)/$(subst web,,$@),' > $@
85

86
clean:
87 88 89 90 91 92 93 94 95 96 97

$(INSTALL_DIR)/opsdir/sbin/%: %
	@echo "Installing $<"
	-mkdir -p $(INSTALL_DIR)/opsdir/sbin
	$(INSTALL) $< $@

$(INSTALL_DIR)/opsdir/lib/%: %
	@echo "Installing $<"
	-mkdir -p $(INSTALL_DIR)/opsdir/lib
	$(INSTALL_DATA) $< $@