GNUmakefile.in 3.22 KB
Newer Older
Leigh B Stoller's avatar
Leigh B Stoller committed
1 2
#
# EMULAB-COPYRIGHT
3
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
Leigh B Stoller's avatar
Leigh B Stoller committed
4 5 6 7 8 9 10 11 12 13 14 15
# All rights reserved.
#
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= @top_builddir@
SUBDIR		= $(subst $(TESTBED_SRCDIR)/,,$(SRCDIR))
SYSTEM	       := $(shell uname -s)
LBINDIR		= $(DESTDIR)/usr/local/bin
SYSTEM	       := $(shell uname -s)

include $(OBJDIR)/Makeconf

16 17 18 19
SUBDIRS	= syncd dijkstra genhostsfile imagezip frisbee.redux 
ifeq ($(SYSTEM),FreeBSD)
SUBDIRS += growdisk
endif
20

Kirk Webb's avatar
Kirk Webb committed
21
# XXX: Remove imagezip and frisbee from Cygwin builds - not working.
22
ifeq ($(findstring CYGWIN_NT,$(SYSTEM)),CYGWIN_NT)
Kirk Webb's avatar
Kirk Webb committed
23
SUBDIRS := $(filter-out imagezip frisbee.redux,$(SUBDIRS))
24 25
endif

Leigh B Stoller's avatar
Leigh B Stoller committed
26 27 28 29
all:	all-subdirs

include $(TESTBED_SRCDIR)/GNUmakerules

30
boss-install:
Leigh B Stoller's avatar
Leigh B Stoller committed
31 32
	$(MAKE) -C genhostsfile boss-install
	$(MAKE) -C syncd boss-install
33 34
	$(MAKE) -C imagezip boss-install
	$(MAKE) -C frisbee.redux install
Leigh B Stoller's avatar
Leigh B Stoller committed
35 36 37 38 39
	-mkdir -p $(INSTALL_DIR)/opsdir/man/man1
	$(INSTALL) -m 644 $(SRCDIR)/install-tarfile.1 \
		$(INSTALL_DIR)/opsdir/man/man1/install-tarfile.1

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

42
client: client-subdirs
Leigh B Stoller's avatar
Leigh B Stoller committed
43 44 45 46 47 48 49 50

client-install: client
	-mkdir -p $(LBINDIR)
	$(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
51
ifneq ($(findstring CYGWIN_NT,$(SYSTEM)),CYGWIN_NT) # Filter out again...
Leigh B Stoller's avatar
Leigh B Stoller committed
52
	$(MAKE) -C dijkstra client-install
53
	$(MAKE) -C imagezip client-install
54 55 56
	$(MAKE) -C frisbee.redux client-install
endif
	$(MAKE) -C genhostsfile client-install
57 58 59
ifeq ($(SYSTEM),FreeBSD)
	$(MAKE) -C growdisk client-install
endif
60

Leigh B Stoller's avatar
Leigh B Stoller committed
61 62 63

subboss: client

64 65 66 67 68 69 70
mfs:
	$(MAKE) -C growdisk client
	$(MAKE) -C zapdisk mfs
	$(MAKE) -C growdisk client
	$(MAKE) -C imagezip client
	$(MAKE) -C frisbee.redux client

Leigh B Stoller's avatar
Leigh B Stoller committed
71
subboss-install: subboss client-install
72 73 74 75 76
ifeq ($(SYSTEM),FreeBSD)
	CLIENT_BINDIR=/etc/testbed $(MAKE) -e -C frisbee.redux subboss-install
else
	CLIENT_BINDIR=/usr/local/bin $(MAKE) -e -C frisbee.redux subboss-install
endif
Leigh B Stoller's avatar
Leigh B Stoller committed
77 78 79 80 81 82 83 84

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
85

Leigh B Stoller's avatar
Leigh B Stoller committed
86
frisbee-mfs:
87 88 89
	$(MAKE) -C growdisk client
	$(MAKE) -C frisbee.redux client

Leigh B Stoller's avatar
Leigh B Stoller committed
90
frisbee-mfs-install:
91 92
ifeq ($(SYSTEM),FreeBSD)
	CLIENT_BINDIR=/etc/testbed $(MAKE) -e -C growdisk client-install
93
	CLIENT_BINDIR=/etc/testbed $(MAKE) -e -C frisbee.redux client-install
94 95
else
	CLIENT_BINDIR=/usr/local/bin $(MAKE) -e -C growdisk client-install
96
	CLIENT_BINDIR=/usr/local/bin $(MAKE) -e -C frisbee.redux client-install
97 98 99 100 101 102 103 104 105
endif

mfs-install:
	$(MAKE) -C zapdisk mfs-install
	$(MAKE) -C imagezip client-install
	CLIENT_BINDIR=/usr/local/bin $(MAKE) -e -C growdisk client-install
	CLIENT_BINDIR=/usr/local/bin $(MAKE) -e -C frisbee.redux client-install

cdboot-install: mfs-install
Leigh B Stoller's avatar
Leigh B Stoller committed
106 107 108 109 110 111 112 113 114 115 116 117

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)