GNUmakefile.in 4.67 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
#
# Ordering here matters!
# Things with no dependencies go first: 
15
#   assign db lib www
16
17
# 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
24
SUBDIRS = lib db assign www @optional_subdirs@ ipod security sensors \
		pxe tbsetup account tmcd utils tip capture ipod vis \
25
		sensors os xmlrpc install/newnode_sshkeys
Christopher Alfeld's avatar
Christopher Alfeld committed
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
37
boss-install:	install-schemacheck install-sitevarscheck install-dbfillcheck \
		install-subdirs install-mkdirs 
38
39
40
41
42
43
	@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 
44
	@echo "DON'T FORGET TO RUN A POST-INSTALL AS ROOT"
45

46
post-install:
47
	@$(MAKE) -C db post-install
Mike Hibler's avatar
Mike Hibler committed
48
	@$(MAKE) -C ipod post-install
49
	@$(MAKE) -C tbsetup post-install
50
	@$(MAKE) -C account post-install
51
	@$(MAKE) -C security post-install
52
53
	@$(MAKE) -C vis post-install
	@$(MAKE) -C www post-install
54

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

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

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

95
96
97
98
client-mkdirs:
	-mkdir -p $(DESTDIR)$(CLIENT_BINDIR)

client:
99
	@$(MAKE) -C lib/libtb client
100
101
102
103
104
105
	@$(MAKE) -C event client
	@$(MAKE) -C os client
	@$(MAKE) -C sensors client
	@$(MAKE) -C tmcd client

client-install: client client-mkdirs
106
107
	@$(MAKE) -C event client-install
	@$(MAKE) -C os client-install
108
	@$(MAKE) -C sensors client-install
109
110
	@$(MAKE) -C tmcd client-install

111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
destdircheck:
	@if [ -z "$(DESTDIR)" ]; then \
	    echo "You must define DESTDIR for this target!"; \
	    false; \
	fi

mfs:
	@$(MAKE) -C os mfs
	@$(MAKE) -C sensors mfs
	@$(MAKE) -C tmcd mfs

mfs-install: destdircheck mfs
	@$(MAKE) -C os mfs-install
	@$(MAKE) -C sensors mfs-install
	@$(MAKE) -C tmcd mfs-install

127
128
129
130
131
#
# 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)
132
SCHEMACHECK= cd $(OBJDIR)/db && perl schemacheck
133
134
135
136
137
138
139
else
SCHEMACHECK= @echo "Skipping schema check, since prefix isn't /usr/testbed"
endif
install-schemacheck:
	@echo "Checking DB schema..."
	$(SCHEMACHECK)

Chad Barb's avatar
   
Chad Barb committed
140
141
142
143
144
145
146
147
148
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)

149
150
151
152
153
154
155
156
157
ifeq ($(TBROOT),/usr/testbed)
DBFILLCHECK= cd $(OBJDIR)/db && perl dbfillcheck
else
DBFILLCHECK= @echo "Skipping DB fill check, since prefix isn't /usr/testbed"
endif
install-dbfillcheck:
	@echo "Checking Initial DB Fill ..."
	$(DBFILLCHECK)

158
159
clean:		clean-subdirs
distclean:	distclean-subdirs
Mike Hibler's avatar
Mike Hibler committed
160
	rm -f Makeconf GNUmakefile config.h config.status config.cache config.log
161
	rm -f $(DISTCLEAN_FILES)
162

163
164
165
166
167
# How to recursively descend into subdirectories to make general
# targets such as `all'.
%.MAKE:
	@$(MAKE) -C $(dir $@) $(basename $(notdir $@))
%-subdirs: $(addsuffix /%.MAKE,$(SUBDIRS)) ;
168

169
170
# By default, make any target by descending into subdirectories.
%: %-subdirs ;
171

172
.PHONY: post-install install-mkdirs
173
174
175

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