GNUmakefile.in 4.94 KB
Newer Older
Leigh B Stoller's avatar
Leigh B Stoller committed
1
#
2
# Copyright (c) 2000-2018 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 bootinfo
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

45 46 47 48 49 50 51
ifeq ($(SYSTEM),Linux)
OSTAG=$(shell $(SRCDIR)/../tmcc/osstuff.sh -t)
ifeq ($(OSTAG),alpine)
SUBDIRS := $(filter-out imagezip frisbee.redux capture,$(SUBDIRS))
endif
endif

Leigh B Stoller's avatar
Leigh B Stoller committed
52 53 54 55
all:	all-subdirs

include $(TESTBED_SRCDIR)/GNUmakerules

56
boss-install:
Leigh B Stoller's avatar
Leigh B Stoller committed
57 58
	$(MAKE) -C genhostsfile boss-install
	$(MAKE) -C syncd boss-install
59 60
	$(MAKE) -C imagezip boss-install
	$(MAKE) -C frisbee.redux install
61
	$(MAKE) -C capture install
Leigh B Stoller's avatar
Leigh B Stoller committed
62 63 64 65
	-mkdir -p $(INSTALL_DIR)/opsdir/man/man1
	$(INSTALL) -m 644 $(SRCDIR)/install-tarfile.1 \
		$(INSTALL_DIR)/opsdir/man/man1/install-tarfile.1

66 67
control: control-subdirs

Leigh B Stoller's avatar
Leigh B Stoller committed
68
control-install: 
69
	@$(MAKE) -C imagezip install
70
	$(MAKE) -C frisbee.redux control-install
Leigh B Stoller's avatar
Leigh B Stoller committed
71

72 73
fs-install:

74
client: client-subdirs
Leigh B Stoller's avatar
Leigh B Stoller committed
75 76

client-install: client
77
	-mkdir -p $(LBINDIR) $(LSBINDIR)
Leigh B Stoller's avatar
Leigh B Stoller committed
78 79 80 81 82 83
	$(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
84
ifneq ($(findstring CYGWIN_NT,$(SYSTEM)),CYGWIN_NT) # Filter out again...
85
ifneq ($(OSTAG),alpine)
86
	$(MAKE) -C imagezip client-install
87
	$(MAKE) -C frisbee.redux client-install
88
	$(MAKE) -C capture client-install
89
endif
90 91
endif
	$(MAKE) -C genhostsfile client-install
92 93
ifeq ($(SYSTEM),FreeBSD)
	$(MAKE) -C growdisk client-install
94
	$(INSTALL_PROGRAM) $(SRCDIR)/create-swapimage $(LBINDIR)/
95
endif
96
	$(INSTALL_PROGRAM) $(SRCDIR)/create-image $(LBINDIR)/
97
	$(INSTALL_PROGRAM) $(SRCDIR)/create-versioned-image $(LBINDIR)/
98

99 100 101 102 103 104
mfs:
	$(MAKE) -C growdisk client
	$(MAKE) -C zapdisk mfs
	$(MAKE) -C imagezip client
	$(MAKE) -C frisbee.redux client

105 106 107 108 109
subboss: subboss-subdirs

subboss-install: subboss
	$(MAKE) -C genhostsfile subboss-install
ifneq ($(findstring CYGWIN_NT,$(SYSTEM)),CYGWIN_NT) # Filter out again...
110
	$(MAKE) -C capture client-install
111 112
	$(MAKE) -C imagezip client-install
	$(MAKE) -C frisbee.redux subboss-install
113
endif
Leigh B Stoller's avatar
Leigh B Stoller committed
114 115 116 117 118 119 120 121

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
122

Leigh B Stoller's avatar
Leigh B Stoller committed
123
frisbee-mfs:
124
	$(MAKE) -C growdisk client
125
	$(MAKE) -C zapdisk mfs
126
	$(MAKE) -C frisbee.redux frisbee-mfs
127

Leigh B Stoller's avatar
Leigh B Stoller committed
128
frisbee-mfs-install:
129
ifeq ($(SYSTEM),FreeBSD)
130
	CLIENT_BINDIR=/etc/testbed $(MAKE) -e -C frisbee.redux frisbee-mfs-install
131 132
	CLIENT_BINDIR=/etc/testbed $(MAKE) -e -C growdisk client-install
	CLIENT_BINDIR=/etc/testbed $(MAKE) -e -C zapdisk frisbee-mfs-install
133
else
134
	$(MAKE) -C frisbee.redux client-install
135 136 137
	$(MAKE) -C growdisk client-install
	$(MAKE) -C zapdisk frisbee-mfs-install
	rm -f $(CBINDIR)/frisbee $(CBINDIR)/frisupload
138 139 140 141
endif

mfs-install:
	$(MAKE) -C imagezip client-install
142 143 144
	$(MAKE) -C frisbee.redux client-install
	$(MAKE) -C growdisk client-install
	$(MAKE) -C zapdisk mfs-install
145 146 147
	$(INSTALL_PROGRAM) $(SRCDIR)/create-image $(LBINDIR)/
	$(INSTALL_PROGRAM) $(SRCDIR)/create-versioned-image $(LBINDIR)/
	$(INSTALL_PROGRAM) $(SRCDIR)/create-swapimage $(LBINDIR)/
148 149
	rm -f $(CBINDIR)/frisbee $(CBINDIR)/frisupload
	rm -f $(CBINDIR)/imagezip $(CBINDIR)/imageunzip $(CBINDIR)/imagedump
150

151 152 153
newnode-mfs: mfs
newnode-mfs-install: mfs-install

154
cdboot-install: mfs-install
Leigh B Stoller's avatar
Leigh B Stoller committed
155 156 157 158 159 160 161 162 163 164 165 166

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)