GNUmakefile.in 2.31 KB
Newer Older
1
#
Leigh Stoller's avatar
Leigh Stoller committed
2 3 4
# EMULAB-COPYRIGHT
# Copyright (c) 2002-2006 University of Utah and the Flux Group.
# All rights reserved.
5 6 7 8
#
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= ..
9
SUBDIR		= sensors
10
EVENTSYS	= @EVENTSYS@
11 12 13

include $(OBJDIR)/Makeconf

14
SUBDIRS	= slothd powermon nfstrace
15

16
SYSTEM            := $(shell uname -s)
17

18
ifeq ($(SYSTEM),FreeBSD)
19 20
FBSDVERSION   := $(shell uname -v | sed -e 's/FreeBSD \([0-9]\).*/FreeBSD\1/')

21 22
# XXX not on FreeBSD 5/6 til I get a chance to fix it
ifeq ($(FBSDVERSION),FreeBSD4)
23
SUBDIRS += and 
24
ifeq ($(EVENTSYS),1) # Also, we have to have the event system enabled
25 26
SUBDIRS	+= canaryd
endif
27
endif
28
endif
29

30
###############################################################################
31

32 33 34
## `ACTIONS' is the set of actions that may be taken on a subdirectory or on
## the current directory.  These become phony targets.
##
35
ACTIONS = all install client client-install control-install clean distclean
36

37 38 39
## `TARGETS' is the set of all `<subdir>.<action>' targets.
##
TARGETS = $(foreach action,$(ACTIONS),$(addsuffix .$(action),$(SUBDIRS)))
40

41
###############################################################################
42

43 44 45 46 47
## Explicitly mention `all' first, so that it will be the default target.  This
## must be a double colon rule; see the rule for `ACTIONS' below.
##
.PHONY: all
all::
48

49 50 51 52 53 54
## Rules for generic actions.  Each is made by applying the action to all of
## the subdirectories.  Note that these are defined as double-colon rules so
## that one can add extra statements in separate rules if necessary.
##
.PHONY: $(ACTIONS)
$(ACTIONS):: %: $(addsuffix .%,$(SUBDIRS))
55

56 57 58 59 60
## Rules for targets of the form `<subdir>.<action>'.
##
.PHONY: $(TARGETS)
$(TARGETS):
	@$(MAKE) -C $(basename $@) $(patsubst .%,%,$(suffix $@))
61

62 63 64 65
## Making a subdirectory is the same as making `<subdir>.<all>'.
##
.PHONY: $(SUBDIRS)
$(SUBDIRS): %: %.all
66

67 68 69 70 71 72 73
#
# Rules to regen configure written files.
#
%: %.in
	@echo "Regenerating $@"
	cd $(OBJDIR) && CONFIG_FILES=$(SUBDIR)/$@ ./config.status

74
###############################################################################
75

76 77 78 79 80 81 82
## Any extra actions can be defined here, e.g.:
##
## clean::
##	$(RM) core

###############################################################################

83 84 85
fs-install:
	@$(MAKE) -C nfstrace fs-install

86
mfs: slothd.client
87

88
mfs-install: mfs slothd.client-install
89 90

.PHONY: mfs mfs-install