GNUmakefile.in 1.89 KB
Newer Older
1 2
#
# EMULAB-COPYRIGHT
3
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
4 5 6 7 8
# All rights reserved.
#
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= @top_builddir@
9
SUBDIR		= $(subst $(TESTBED_SRCDIR)/,,$(SRCDIR))
10 11 12 13
SYSTEM	       := $(shell uname -s)

include $(OBJDIR)/Makeconf

14
SUBDIRS         = lib event tools os sensors tmcc
15

Leigh Stoller's avatar
Leigh Stoller committed
16
ifeq ($(WITH_EMULAB),1)
17
all:	all-subdirs
18
install:all boss-install-subdirs
Leigh Stoller's avatar
Leigh Stoller committed
19 20
else
all:	client-subdirs
Leigh Stoller's avatar
Leigh Stoller committed
21 22 23 24
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!"
Leigh Stoller's avatar
Leigh Stoller committed
25
endif
26 27 28
include $(TESTBED_SRCDIR)/GNUmakerules

client:		client-subdirs
Leigh Stoller's avatar
Leigh Stoller committed
29
client-install: client client-mkdirs client-install-subdirs
30
control-install: control-install-subdirs
Leigh Stoller's avatar
Leigh Stoller committed
31 32
subboss:	subboss-subdirs
subboss-install: client subboss-install-subdirs
33
post-install:	post-install-subdirs
34 35
clean:		clean-subdirs
distclean:	distclean-subdirs
Leigh Stoller's avatar
Leigh Stoller committed
36
mfs:		mfs-subdirs
Leigh Stoller's avatar
Leigh Stoller committed
37
mfs-install:	client-mkdirs mfs-install-subdirs
Leigh Stoller's avatar
Leigh Stoller committed
38
frisbee-mfs:	frisbee-mfs-subdirs
Leigh Stoller's avatar
Leigh Stoller committed
39 40
frisbee-mfs-install:	client-mkdirs frisbee-mfs-install-subdirs

41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
TARBALLDESTDIR = /var/tmp/emulab-client
client-tarball:
	@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
	echo "Building and installing client-side in $(TARBALLDESTDIR)..."
	DESTDIR=$(TARBALLDESTDIR) $(MAKE) client-install
	echo "Creating tarball..."
	tar czf emulab-client.tar.gz -C $(TARBALLDESTDIR) .

Leigh Stoller's avatar
Leigh Stoller committed
57 58 59
client-mkdirs:
	-mkdir -p $(DESTDIR)$(CLIENT_BINDIR)
	-mkdir -p $(DESTDIR)$(CLIENT_MANDIR)
60 61 62 63 64 65 66 67

# 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)