GNUmakefile.in 2.52 KB
Newer Older
1
#
Leigh Stoller's avatar
Leigh Stoller committed
2
# EMULAB-COPYRIGHT
Leigh Stoller's avatar
Leigh Stoller committed
3
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
Leigh Stoller's avatar
Leigh Stoller committed
4
# All rights reserved.
5
#
Leigh Stoller's avatar
Leigh Stoller committed
6

7 8 9 10 11
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= ..
SUBDIR		= os

12
LBINDIR		= $(DESTDIR)/usr/local/bin
13
SYSTEM	       := $(shell uname -s)
14

15
include $(OBJDIR)/Makeconf
16

Leigh Stoller's avatar
Leigh Stoller committed
17
SUBDIRS	= imagezip frisbee.redux 
18 19 20
ifeq ($(SYSTEM),FreeBSD)
SUBDIRS += growdisk 
endif
21

22
all:	all-subdirs split-image.sh
23

24
include $(TESTBED_SRCDIR)/GNUmakerules
25

26
install: $(INSTALL_SBINDIR)/split-image.sh
27
	@$(MAKE) -C imagezip install
Leigh Stoller's avatar
Leigh Stoller committed
28
	@$(MAKE) -C frisbee.redux install
29 30
	$(INSTALL_PROGRAM) $(SRCDIR)/template_record \
		$(INSTALL_DIR)/opsdir/bin/template_record
31 32 33

control-install: 
	@$(MAKE) -C imagezip install
34
	$(INSTALL_PROGRAM) $(SRCDIR)/template_record $(LBINDIR)/template_record
35

36
client:
37
ifeq ($(SYSTEM),FreeBSD)
38 39
	$(MAKE) -C growdisk client
endif
40
	$(MAKE) -C frisbee.redux client
41 42

client-install: client
43
	$(INSTALL_PROGRAM) $(SRCDIR)/template_record $(LBINDIR)/template_record
44
ifeq ($(SYSTEM),FreeBSD)
45 46
	$(INSTALL_PROGRAM) $(SRCDIR)/create-image $(LBINDIR)/
	$(INSTALL_PROGRAM) $(SRCDIR)/create-swapimage $(LBINDIR)/
47
	$(MAKE) -C growdisk client-install
48
endif
49
	$(MAKE) -C frisbee.redux client-install
50

51 52 53 54 55 56 57 58 59 60
subboss: client
	$(MAKE) -C frisbee.redux all

subboss-install: subboss client-install
ifeq ($(SYSTEM),FreeBSD)
	CLIENT_BINDIR=/etc/testbed $(MAKE) -e -C frisbee.redux install
else
	CLIENT_BINDIR=/usr/local/bin $(MAKE) -e -C frisbee.redux install
endif

61 62
mfs:
	$(MAKE) -C imagezip client
63
	$(MAKE) -C zapdisk mfs
64 65

mfs-install: mfs
66 67
	$(INSTALL_PROGRAM) $(SRCDIR)/create-image $(LBINDIR)/
	$(INSTALL_PROGRAM) $(SRCDIR)/create-swapimage $(LBINDIR)/
68
	$(MAKE) -C imagezip client-install
69
	$(MAKE) -C zapdisk mfs-install
70 71 72 73 74 75

frisbee-mfs:
	$(MAKE) -C frisbee.redux client
	$(MAKE) -C growdisk client

frisbee-mfs-install: frisbee-mfs
76
ifeq ($(SYSTEM),FreeBSD)
77 78
	CLIENT_BINDIR=/etc/testbed $(MAKE) -e -C frisbee.redux client-install
	CLIENT_BINDIR=/etc/testbed $(MAKE) -e -C growdisk client-install
79 80 81 82
else
	CLIENT_BINDIR=/usr/local/bin $(MAKE) -e -C frisbee.redux client-install
	CLIENT_BINDIR=/usr/local/bin $(MAKE) -e -C growdisk client-install
endif
83

84 85 86 87
cdboot-install: mfs-install frisbee-mfs
	$(MAKE) -e -C frisbee.redux client-install
	$(MAKE) -e -C growdisk client-install

88
remote-install: 
89

90
clean:		clean-subdirs
91 92 93 94 95
distclean:	subdir-distclean

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

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

102 103
.PHONY:	$(SUBDIRS)