GNUmakefile.in 2.54 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
SUBDIRS = lib assign discvr tbsetup db os security pxe tmcd utils www \
13
		tip capture ipod vis @optional_subdirs@
Christopher Alfeld's avatar
Christopher Alfeld committed
14

15
all:		all-subdirs
16

17
install:	
18
	@echo "Choose either boss-install (paper) or ops-install (plastic)"
19
	@echo "Choose tipserv-install for dedicated tip server machines."
20 21

#
22
# For installation on boss node (okay, paper).
23
# 
24 25 26 27 28 29 30
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 
31
	@echo "DON'T FORGET TO RUN A POST-INSTALL AS ROOT"
32

33
post-install:
34
	@$(MAKE) -C db post-install
Mike Hibler's avatar
Mike Hibler committed
35
	@$(MAKE) -C ipod post-install
36 37
	@$(MAKE) -C tbsetup post-install
	@$(MAKE) -C security post-install
38

39
#
40
# For installation on the 'ops' or 'users' node (okay, plastic)
41
# 
42
ops-install:
43 44
	@$(MAKE) -C tbsetup control-install
	@$(MAKE) -C security control-install
45 46 47 48
	@$(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
49
	@$(MAKE) -C utils control-install
50

51 52 53 54
install-mkdirs:
	-mkdir -p $(INSTALL_TOPDIR)/locks
	-mkdir -p $(INSTALL_TOPDIR)/log
	-mkdir -p $(INSTALL_TOPDIR)/lists
55
	-mkdir -p $(INSTALL_TOPDIR)/backup
56 57
	-mkdir -p $(INSTALL_TOPDIR)/batch
	-chmod 777 $(INSTALL_TOPDIR)/batch
58 59
	-mkdir -p $(INSTALL_TOPDIR)/expinfo
	-chmod 777 $(INSTALL_TOPDIR)/expinfo
60

61 62 63 64 65 66
tipserv-install:
	-mkdir -p $(INSTALL_TOPDIR)/log/tiplogs
	@$(MAKE) -C tip tipserv-install
	@$(MAKE) -C capture tipserv-install
	@$(MAKE) -C tbsetup tipserv-install

67 68 69 70 71
#
# 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)
72
SCHEMACHECK= cd $(OBJDIR)/db && perl schemacheck
73 74 75 76 77 78 79
else
SCHEMACHECK= @echo "Skipping schema check, since prefix isn't /usr/testbed"
endif
install-schemacheck:
	@echo "Checking DB schema..."
	$(SCHEMACHECK)

80 81 82
clean:		clean-subdirs
distclean:	distclean-subdirs
	rm -f Makeconf GNUmakefile config.status config.cache config.log
83
	rm -f $(DISTCLEAN_FILES)
84

85 86 87 88 89
# How to recursively descend into subdirectories to make general
# targets such as `all'.
%.MAKE:
	@$(MAKE) -C $(dir $@) $(basename $(notdir $@))
%-subdirs: $(addsuffix /%.MAKE,$(SUBDIRS)) ;
90

91 92
# By default, make any target by descending into subdirectories.
%: %-subdirs ;
93

94
.PHONY: post-install install-mkdirs
95 96 97

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