GNUmakefile.in 4.69 KB
Newer Older
Leigh B Stoller's avatar
Leigh B Stoller committed
1
#
2
# Copyright (c) 2000-2015 University of Utah and the Flux Group.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
# 
# {{{EMULAB-LICENSE
# 
# This file is part of the Emulab network testbed software.
# 
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
# 
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public
# License for more details.
# 
# You should have received a copy of the GNU Affero General Public License
# along with this file.  If not, see <http://www.gnu.org/licenses/>.
# 
# }}}
Leigh B Stoller's avatar
Leigh B Stoller committed
22 23 24 25 26 27
#
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= @top_builddir@
SUBDIR		= $(subst $(TESTBED_SRCDIR)/,,$(SRCDIR))
SYSTEM	       := $(shell uname -s)
28
CBINDIR		= $(DESTDIR)$(CLIENT_BINDIR)
Leigh B Stoller's avatar
Leigh B Stoller committed
29
LBINDIR		= $(DESTDIR)/usr/local/bin
30
LSBINDIR	= $(DESTDIR)/usr/local/sbin
Leigh B Stoller's avatar
Leigh B Stoller committed
31 32 33 34
SYSTEM	       := $(shell uname -s)

include $(OBJDIR)/Makeconf

35
SUBDIRS	= syncd dijkstra genhostsfile imagezip frisbee.redux capture
36 37 38
ifeq ($(SYSTEM),FreeBSD)
SUBDIRS += growdisk
endif
39

Kirk Webb's avatar
Kirk Webb committed
40
# XXX: Remove imagezip and frisbee from Cygwin builds - not working.
41
ifeq ($(findstring CYGWIN_NT,$(SYSTEM)),CYGWIN_NT)
Kirk Webb's avatar
Kirk Webb committed
42
SUBDIRS := $(filter-out imagezip frisbee.redux,$(SUBDIRS))
43 44
endif

Leigh B Stoller's avatar
Leigh B Stoller committed
45 46 47 48
all:	all-subdirs

include $(TESTBED_SRCDIR)/GNUmakerules

49
boss-install:
Leigh B Stoller's avatar
Leigh B Stoller committed
50 51
	$(MAKE) -C genhostsfile boss-install
	$(MAKE) -C syncd boss-install
52 53
	$(MAKE) -C imagezip boss-install
	$(MAKE) -C frisbee.redux install
54
	$(MAKE) -C capture install
Leigh B Stoller's avatar
Leigh B Stoller committed
55 56 57 58 59
	-mkdir -p $(INSTALL_DIR)/opsdir/man/man1
	$(INSTALL) -m 644 $(SRCDIR)/install-tarfile.1 \
		$(INSTALL_DIR)/opsdir/man/man1/install-tarfile.1

control-install: 
60
	@$(MAKE) -C imagezip install
Leigh B Stoller's avatar
Leigh B Stoller committed
61

62 63
fs-install:

64
client: client-subdirs
Leigh B Stoller's avatar
Leigh B Stoller committed
65 66

client-install: client
67
	-mkdir -p $(LBINDIR) $(LSBINDIR)
Leigh B Stoller's avatar
Leigh B Stoller committed
68 69 70 71 72 73
	$(INSTALL_PROGRAM) $(SRCDIR)/install-tarfile $(LBINDIR)/install-tarfile
	-mkdir -p $(DESTDIR)$(CLIENT_MANDIR)/man1
	$(INSTALL) -m 644 $(SRCDIR)/install-tarfile.1 $(DESTDIR)$(CLIENT_MANDIR)/man1/install-tarfile.1
	$(INSTALL_PROGRAM) $(SRCDIR)/install-rpm $(LBINDIR)/install-rpm
	$(MAKE) -C syncd client-install
	$(MAKE) -C dijkstra client-install
74
ifneq ($(findstring CYGWIN_NT,$(SYSTEM)),CYGWIN_NT) # Filter out again...
75
	$(MAKE) -C imagezip client-install
76
	$(MAKE) -C frisbee.redux client-install
77
	$(MAKE) -C capture client-install
78 79
endif
	$(MAKE) -C genhostsfile client-install
80 81
ifeq ($(SYSTEM),FreeBSD)
	$(MAKE) -C growdisk client-install
82
	$(INSTALL_PROGRAM) $(SRCDIR)/create-swapimage $(LBINDIR)/
83
endif
84
	$(INSTALL_PROGRAM) $(SRCDIR)/create-image $(LBINDIR)/
85
	$(INSTALL_PROGRAM) $(SRCDIR)/create-versioned-image $(LBINDIR)/
86

87 88 89 90 91 92
mfs:
	$(MAKE) -C growdisk client
	$(MAKE) -C zapdisk mfs
	$(MAKE) -C imagezip client
	$(MAKE) -C frisbee.redux client

93 94 95 96 97
subboss: subboss-subdirs

subboss-install: subboss
	$(MAKE) -C genhostsfile subboss-install
ifneq ($(findstring CYGWIN_NT,$(SYSTEM)),CYGWIN_NT) # Filter out again...
98
	$(MAKE) -C capture client-install
99 100
	$(MAKE) -C imagezip client-install
	$(MAKE) -C frisbee.redux subboss-install
101
endif
Leigh B Stoller's avatar
Leigh B Stoller committed
102 103 104 105 106 107 108 109

remote-install: 
	-mkdir -p $(LBINDIR)
	$(INSTALL_PROGRAM) $(SRCDIR)/install-tarfile $(LBINDIR)/install-tarfile
	$(INSTALL_PROGRAM) $(SRCDIR)/install-rpm $(LBINDIR)/install-rpm

clean:		clean-subdirs
distclean:	subdir-distclean
110

Leigh B Stoller's avatar
Leigh B Stoller committed
111
frisbee-mfs:
112
	$(MAKE) -C growdisk client
113
	$(MAKE) -C zapdisk mfs
114 115
	$(MAKE) -C frisbee.redux client

Leigh B Stoller's avatar
Leigh B Stoller committed
116
frisbee-mfs-install:
117
ifeq ($(SYSTEM),FreeBSD)
118
	CLIENT_BINDIR=/etc/testbed $(MAKE) -e -C frisbee.redux client-install
119 120
	CLIENT_BINDIR=/etc/testbed $(MAKE) -e -C growdisk client-install
	CLIENT_BINDIR=/etc/testbed $(MAKE) -e -C zapdisk frisbee-mfs-install
121
else
122
	CLIENT_BINDIR=/usr/local/bin $(MAKE) -e -C frisbee.redux client-install
123 124 125
	$(MAKE) -C growdisk client-install
	$(MAKE) -C zapdisk frisbee-mfs-install
	rm -f $(CBINDIR)/frisbee $(CBINDIR)/frisupload
126 127 128 129
endif

mfs-install:
	$(MAKE) -C imagezip client-install
130 131 132
	$(MAKE) -C frisbee.redux client-install
	$(MAKE) -C growdisk client-install
	$(MAKE) -C zapdisk mfs-install
133 134 135
	$(INSTALL_PROGRAM) $(SRCDIR)/create-image $(LBINDIR)/
	$(INSTALL_PROGRAM) $(SRCDIR)/create-versioned-image $(LBINDIR)/
	$(INSTALL_PROGRAM) $(SRCDIR)/create-swapimage $(LBINDIR)/
136 137
	rm -f $(CBINDIR)/frisbee $(CBINDIR)/frisupload
	rm -f $(CBINDIR)/imagezip $(CBINDIR)/imageunzip $(CBINDIR)/imagedump
138

139 140 141
newnode-mfs: mfs
newnode-mfs-install: mfs-install

142
cdboot-install: mfs-install
Leigh B Stoller's avatar
Leigh B Stoller committed
143 144 145 146 147 148 149 150 151 152 153 154

subdir-distclean:
	@$(MAKE) -C imagezip distclean

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

.PHONY:	$(SUBDIRS)