GNUmakefile.in 3.66 KB
Newer Older
1 2 3
#
# Testbed Makefile
#
4 5 6 7 8
SRCDIR		= @srcdir@
OBJDIR		= .
SUBDIR		= 
TESTBED_SRCDIR  = @top_srcdir@
DISTCLEAN_FILES = @DISTCLEAN_FILES@ 
9

10 11
include Makeconf

12 13 14 15 16 17
#
# Ordering here matters!
# Things with no dependencies go first: 
#   assign db lib 
# Things that may have dependencies go next:
#   @optional_subdirs@ (has event)
18
#   ipod os security sensors 
19 20 21 22
# Then things that only depend on stuff we've done:
#   pxe tbsetup tmcd utils www tip capture vis
# Then things that depend on stuff we just did:
#
23
SUBDIRS = lib db assign @optional_subdirs@ ipod security sensors \
24
		pxe tbsetup account tmcd utils www tip capture ipod vis \
25
		sensors os install/newnode_sshkeys
26

27
all:		all-subdirs
28

29
install:	
30
	@echo "Choose either boss-install (paper) or ops-install (plastic)"
31
	@echo "Choose tipserv-install for dedicated tip server machines."
32 33

#
34
# For installation on boss node (okay, paper).
35
# 
36
boss-install:	install-schemacheck install-sitevarscheck install-subdirs install-mkdirs 
37 38 39 40 41 42
	@echo "DON'T FORGET TO RUN A POST-INSTALL AS ROOT"

#
# Same target, with the install-schemacheck dependency omitted
# 
boss-install-force:	install-subdirs install-mkdirs 
43
	@echo "DON'T FORGET TO RUN A POST-INSTALL AS ROOT"
44

45
post-install:
46
	@$(MAKE) -C db post-install
47
	@$(MAKE) -C ipod post-install
48
	@$(MAKE) -C tbsetup post-install
49
	@$(MAKE) -C account post-install
50
	@$(MAKE) -C security post-install
51 52
	@$(MAKE) -C vis post-install
	@$(MAKE) -C www post-install
53

54
#
55
# For installation on the 'ops' or 'users' node (okay, plastic)
56
# 
57
ops-install:
58 59
	@$(MAKE) -C tbsetup control-install
	@$(MAKE) -C security control-install
60
	@$(MAKE) -C tip control-install
Leigh Stoller's avatar
Leigh Stoller committed
61
#	@$(MAKE) -C os control-install
62 63
	@$(MAKE) -C db control-install
	@$(MAKE) -C tbsetup control-install
64
	@$(MAKE) -C utils control-install
65
	@$(MAKE) -C event control-install
66

67
install-mkdirs:
68
	-mkdir -p $(INSTALL_TOPDIR)/opsdir
69 70
	-mkdir -p $(INSTALL_TOPDIR)/locks
	-mkdir -p $(INSTALL_TOPDIR)/log
71 72
	-mkdir -p $(INSTALL_TOPDIR)/log/mysql
	-mkdir -p $(INSTALL_TOPDIR)/log/exports
73
	-mkdir -p $(INSTALL_TOPDIR)/lists
74
	-mkdir -p $(INSTALL_TOPDIR)/backup
75
	-mkdir -p $(INSTALL_TOPDIR)/etc
76
	-mkdir -p $(INSTALL_TOPDIR)/expwork
77 78
	-mkdir -p $(INSTALL_TOPDIR)/batch
	-chmod 777 $(INSTALL_TOPDIR)/batch
79 80
	-mkdir -p $(INSTALL_TOPDIR)/expinfo
	-chmod 777 $(INSTALL_TOPDIR)/expinfo
81 82
	-mkdir -p $(INSTALL_TOPDIR)/images
	-chmod 775 $(INSTALL_TOPDIR)/images
83
	-ln -s /usr/testbed/bin/nse $(INSTALL_TOPDIR)/bin
84

85 86
tipserv-install:
	-mkdir -p $(INSTALL_TOPDIR)/log/tiplogs
87
	-mkdir -p $(INSTALL_TOPDIR)/etc
88 89 90 91
	@$(MAKE) -C tip tipserv-install
	@$(MAKE) -C capture tipserv-install
	@$(MAKE) -C tbsetup tipserv-install

92 93 94 95 96
#
# A check to see if this is a 'real' install. Kinda hacky, but as far as I can
# tell, you can't put ifeq()'s inside of targets
#
ifeq ($(TBROOT),/usr/testbed)
97
SCHEMACHECK= cd $(OBJDIR)/db && perl schemacheck
98 99 100 101 102 103 104
else
SCHEMACHECK= @echo "Skipping schema check, since prefix isn't /usr/testbed"
endif
install-schemacheck:
	@echo "Checking DB schema..."
	$(SCHEMACHECK)

105 106 107 108 109 110 111 112 113
ifeq ($(TBROOT),/usr/testbed)
SITEVARSCHECK= cd $(OBJDIR)/db && perl sitevarscheck
else
SITEVARSCHECK= @echo "Skipping sitevars check, since prefix isn't /usr/testbed"
endif
install-sitevarscheck:
	@echo "Checking Site variables..."
	$(SITEVARSCHECK)

114 115 116
clean:		clean-subdirs
distclean:	distclean-subdirs
	rm -f Makeconf GNUmakefile config.status config.cache config.log
117
	rm -f $(DISTCLEAN_FILES)
118

119 120 121 122 123
# How to recursively descend into subdirectories to make general
# targets such as `all'.
%.MAKE:
	@$(MAKE) -C $(dir $@) $(basename $(notdir $@))
%-subdirs: $(addsuffix /%.MAKE,$(SUBDIRS)) ;
124

125 126
# By default, make any target by descending into subdirectories.
%: %-subdirs ;
127

128
.PHONY: post-install install-mkdirs
129 130 131

# Get rid of a bunch of nasty built-in implicit rules.
.SUFFIXES: