GNUmakefile.in 3.74 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
15
SUBBOSS_BIN_SCRIPTS	= subboss_dhcpd_makeconf

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

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

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

38
39
# These scripts installed setuid, with sudo. 
SETUID_BIN_SCRIPTS   = 
40
41
SETUID_SBIN_SCRIPTS  = genelists dhcpd_makeconf elabinelab_bossinit \
                       changecreator
42
43
44
45
46
47
48
49
50
51
52
53
SETUID_LIBX_SCRIPTS  =

#
# Targets
#
ifeq ($(STANDALONE_CLEARINGHOUSE),0)
TARGETS	= $(BIN_SCRIPTS) $(SBIN_SCRIPTS) $(LIBEXEC_SCRIPTS) $(LIB_SCRIPTS) \
	$(USERSBINS) $(USERLIBS) schemacheck dbfillcheck
else
TARGETS = emdb.pm emutil.pm emdbi.pm
SETUID_SBIN_SCRIPTS =
endif
54

55
#
56
57
58
# Force dependencies on the scripts so that they will be rerun through
# configure if the .in file is changed.
# 
59
all:	$(TARGETS)
60

61
62
$(SUBBOSS_BIN_SCRIPTS):

63
include $(TESTBED_SRCDIR)/GNUmakerules
64

65
66
67
68
69
70
ifeq ($(STANDALONE_CLEARINGHOUSE),0)
install: boss-install
else
install: clrhouse-install
endif

71
72
subboss-install: $(addprefix $(INSTALL_BINDIR)/, $(SUBBOSS_BIN_SCRIPTS))

73
boss-install: $(addprefix $(INSTALL_BINDIR)/, $(BIN_SCRIPTS)) \
74
	$(addprefix $(INSTALL_SBINDIR)/, $(SBIN_SCRIPTS)) \
75
	$(addprefix $(INSTALL_LIBDIR)/, $(LIB_SCRIPTS)) \
76
77
78
	$(addprefix $(INSTALL_LIBEXECDIR)/, $(LIBEXEC_SCRIPTS)) \
        $(addprefix $(INSTALL_DIR)/opsdir/sbin/, $(USERSBINS)) \
        $(addprefix $(INSTALL_DIR)/opsdir/lib/, $(USERLIBS))
79

80
post-install: 
Ryan Jackson's avatar
Ryan Jackson committed
81
	chown root $(INSTALL_BINDIR)/subboss_dhcpd_makeconf
82
83
	chown root $(INSTALL_SBINDIR)/genelists
	chmod u+s $(INSTALL_SBINDIR)/genelists
84
85
	chown root $(INSTALL_SBINDIR)/dhcpd_makeconf
	chmod u+s $(INSTALL_SBINDIR)/dhcpd_makeconf
86
87
	chown root $(INSTALL_SBINDIR)/elabinelab_bossinit
	chmod u+s $(INSTALL_SBINDIR)/elabinelab_bossinit
88

89
90
91
#
# Control node installation (okay, plastic)
#
92
93
control-install: $(addprefix $(INSTALL_SBINDIR)/, $(USERSBINS)) \
	$(addprefix $(INSTALL_LIBDIR)/, $(USERLIBS))
94

95
96
97
# Clearinghouse install.
clrhouse-install: $(addprefix $(INSTALL_LIBDIR)/, $(TARGETS))

98
99
100
101
102
103
104
105
106
107
# 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 $@"
108
	cat $< | sed -e 's,@PROGTOINVOKE@,$(word 2,$^)/$(subst web,,$@),' > $@
109

110
clean:
111
112
113
114
115
116
117
118
119
120
121

$(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) $< $@