GNUmakefile.in 3.17 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@ 
Christopher Alfeld's avatar
Christopher Alfeld committed
9

10 11
include Makeconf

12 13 14 15 16 17 18 19 20 21 22 23 24
#
# Ordering here matters!
# Things with no dependencies go first: 
#   assign db lib 
# Things that may have dependencies go next:
#   @optional_subdirs@ (has event)
#   discvr ipod os security sensors 
# 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:
#
SUBDIRS = lib db assign @optional_subdirs@ discvr ipod os security sensors \
		pxe tbsetup tmcd utils www tip capture ipod vis sensors 
Christopher Alfeld's avatar
Christopher Alfeld committed
25

26
all:		all-subdirs
27

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

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

44
post-install:
45
	@$(MAKE) -C db post-install
Mike Hibler's avatar
Mike Hibler committed
46
	@$(MAKE) -C ipod post-install
47 48
	@$(MAKE) -C tbsetup post-install
	@$(MAKE) -C security post-install
49

50
#
51
# For installation on the 'ops' or 'users' node (okay, plastic)
52
# 
53
ops-install:
54 55
	@$(MAKE) -C tbsetup control-install
	@$(MAKE) -C security control-install
56 57 58 59
	@$(MAKE) -C tip control-install
	@$(MAKE) -C os control-install
	@$(MAKE) -C db control-install
	@$(MAKE) -C tbsetup control-install
Mac Newbold's avatar
Mac Newbold committed
60
	@$(MAKE) -C utils control-install
61
	@$(MAKE) -C event control-install
62

63 64 65
install-mkdirs:
	-mkdir -p $(INSTALL_TOPDIR)/locks
	-mkdir -p $(INSTALL_TOPDIR)/log
66 67
	-mkdir -p $(INSTALL_TOPDIR)/log/mysql
	-mkdir -p $(INSTALL_TOPDIR)/log/exports
68
	-mkdir -p $(INSTALL_TOPDIR)/lists
69
	-mkdir -p $(INSTALL_TOPDIR)/backup
70
	-mkdir -p $(INSTALL_TOPDIR)/etc
71
	-mkdir -p $(INSTALL_TOPDIR)/expwork
72 73
	-mkdir -p $(INSTALL_TOPDIR)/batch
	-chmod 777 $(INSTALL_TOPDIR)/batch
74 75
	-mkdir -p $(INSTALL_TOPDIR)/expinfo
	-chmod 777 $(INSTALL_TOPDIR)/expinfo
76
	-ln -s /usr/testbed/bin/nse $(INSTALL_TOPDIR)/bin
77

78 79
tipserv-install:
	-mkdir -p $(INSTALL_TOPDIR)/log/tiplogs
80
	-mkdir -p $(INSTALL_TOPDIR)/etc
81 82 83 84
	@$(MAKE) -C tip tipserv-install
	@$(MAKE) -C capture tipserv-install
	@$(MAKE) -C tbsetup tipserv-install

85 86 87 88 89
#
# 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)
90
SCHEMACHECK= cd $(OBJDIR)/db && perl schemacheck
91 92 93 94 95 96 97
else
SCHEMACHECK= @echo "Skipping schema check, since prefix isn't /usr/testbed"
endif
install-schemacheck:
	@echo "Checking DB schema..."
	$(SCHEMACHECK)

98 99 100
clean:		clean-subdirs
distclean:	distclean-subdirs
	rm -f Makeconf GNUmakefile config.status config.cache config.log
101
	rm -f $(DISTCLEAN_FILES)
102

103 104 105 106 107
# How to recursively descend into subdirectories to make general
# targets such as `all'.
%.MAKE:
	@$(MAKE) -C $(dir $@) $(basename $(notdir $@))
%-subdirs: $(addsuffix /%.MAKE,$(SUBDIRS)) ;
108

109 110
# By default, make any target by descending into subdirectories.
%: %-subdirs ;
111

112
.PHONY: post-install install-mkdirs
113 114 115

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