# # Copyright (c) 2000-2015 University of Utah and the Flux Group. # # {{{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 . # # }}} # SRCDIR = @srcdir@ TESTBED_SRCDIR = @top_srcdir@ OBJDIR = @top_builddir@ SUBDIR = $(subst $(TESTBED_SRCDIR)/,,$(SRCDIR)) SYSTEM := $(shell uname -s) ARCH := $(shell uname -p) REL := $(shell $(SRCDIR)/tmcc/osstuff.sh -r) include $(OBJDIR)/Makeconf SUBDIRS = lib tools os sensors protogeni ifneq ($(EVENTSYS),0) SUBDIRS += event endif # tmcc should be last as the freenas* install targets mess with the hierarchy SUBDIRS += tmcc ifeq ($(WITH_EMULAB),1) all: all-subdirs install:all boss-install-subdirs else all: client-subdirs install: @echo "Choose an appropriate install target, and make sure you " @echo "you are on a node of that type. Basically, do not do a " @echo "client-install on boss, cause you will be hating life!" endif include $(TESTBED_SRCDIR)/GNUmakerules client: client-subdirs client-install: client client-mkdirs client-install-subdirs client-setversion control-install: control-install-subdirs fs-install: fs-install-subdirs subboss: subboss-subdirs subboss-install: client client-mkdirs subboss-install-subdirs post-install: post-install-subdirs clean: clean-subdirs distclean: distclean-subdirs mfs: mfs-subdirs mfs-install: client-mkdirs mfs-install-subdirs frisbee-mfs: frisbee-mfs-subdirs frisbee-mfs-install: client-mkdirs frisbee-mfs-install-subdirs newnode-mfs: newnode-mfs-subdirs newnode-mfs-install: client-mkdirs newnode-mfs-install-subdirs TARBALLDESTDIR = /var/tmp/emulab-client tarball-check: @if [ `id -u` -ne 0 ]; then \ echo '*** Must run as root!'; \ false; \ fi @if [ -d "$(TARBALLDESTDIR)" ]; then \ echo "$(TARBALLDESTDIR) already exists."; \ echo "Remove it and try again."; \ false; \ fi client-tarball: tarball-check echo "Building and installing client-side in $(TARBALLDESTDIR)..." DESTDIR=$(TARBALLDESTDIR) $(MAKE) client-install echo "Creating tarball..." tar czf emulab-client.tar.gz -C $(TARBALLDESTDIR) . client-mkdirs: -mkdir -p $(DESTDIR)$(CLIENT_BINDIR) -mkdir -p $(DESTDIR)$(CLIENT_MANDIR) freenas-os-check: @if [ "$(SYSTEM)" != "FreeBSD" -o "$(ARCH)" != "amd64" -o \ \( "$(REL)" != "9.2" -a "$(REL)" != "9.3" -a "$(REL)" != "8.3" \) ]; then \ echo "Must run on FreeBSD 8.3 or 9.2 or 9.3 amd64"; \ false; \ fi # # XXX when we have a real freenas9 target, all the moving files around # should be done there... # freenas-tarball: freenas-os-check tarball-check echo "Building and installing client-side in $(TARBALLDESTDIR)..." OSSTUFF="OS=FreeBSD DIST=FreeNAS REL=$(REL)" \ DESTDIR=$(TARBALLDESTDIR) $(MAKE) client-install echo "Creating tarball freenas-client.tar.gz..." tar czf freenas-client.tar.gz -C $(TARBALLDESTDIR) . # # Attempt to find a git commit hash and stash in /etc/emulab. # client-setversion: setversion @echo "Setting Version info" @perl setversion # 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)