GNUmakefile.in 2.65 KB
Newer Older
1
#
Leigh B. Stoller's avatar
Leigh B. Stoller committed
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
# All rights reserved.
5
#
Leigh B. Stoller's avatar
Leigh B. 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 B Stoller's avatar
Leigh B Stoller committed
17
SUBDIRS	= imagezip frisbee.redux 
Mike Hibler's avatar
Mike Hibler committed
18 19 20
ifeq ($(SYSTEM),FreeBSD)
SUBDIRS += growdisk 
endif
21

Leigh B. Stoller's avatar
Leigh B. Stoller committed
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 B. Stoller's avatar
Leigh B. 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)
Mike Hibler's avatar
Mike Hibler committed
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
subboss: client
52
	$(MAKE) -C frisbee.redux subboss
53 54 55

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

61
mfs:
62 63
	$(MAKE) -C frisbee.redux client
	$(MAKE) -C growdisk client
64
	$(MAKE) -C imagezip client
Mike Hibler's avatar
Mike Hibler committed
65
	$(MAKE) -C zapdisk mfs
66 67

mfs-install: mfs
68 69
	$(INSTALL_PROGRAM) $(SRCDIR)/create-image $(LBINDIR)/
	$(INSTALL_PROGRAM) $(SRCDIR)/create-swapimage $(LBINDIR)/
70 71
	CLIENT_BINDIR=/usr/local/bin $(MAKE) -e -C frisbee.redux client-install
	CLIENT_BINDIR=/usr/local/bin $(MAKE) -e -C growdisk client-install
72
	$(MAKE) -C imagezip client-install
Mike Hibler's avatar
Mike Hibler committed
73
	$(MAKE) -C zapdisk mfs-install
74 75 76 77 78 79

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

frisbee-mfs-install: frisbee-mfs
80
ifeq ($(SYSTEM),FreeBSD)
81 82
	CLIENT_BINDIR=/etc/testbed $(MAKE) -e -C frisbee.redux client-install
	CLIENT_BINDIR=/etc/testbed $(MAKE) -e -C growdisk client-install
83 84 85 86
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
87

88
cdboot-install: mfs-install
89

90
remote-install: 
91

Leigh B. Stoller's avatar
Leigh B. Stoller committed
92
clean:		clean-subdirs
93 94 95 96 97
distclean:	subdir-distclean

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

Leigh B. Stoller's avatar
Leigh B. Stoller committed
98 99 100 101 102 103
# How to recursively descend into subdirectories to make general
# targets such as `all'.
%.MAKE:
	@$(MAKE) -C $(dir $@) $(basename $(notdir $@))
%-subdirs: $(addsuffix /%.MAKE,$(SUBDIRS)) ;

104 105
.PHONY:	$(SUBDIRS)