GNUmakefile.in 3.25 KB
Newer Older
1
#
2
# Copyright (c) 2002-2012 University of Utah and the Flux Group.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
# 
# {{{EMULAB-LICENSE
# 
# This file is part of the Emulab network testbed software.
# 
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
# 
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public
# License for more details.
# 
# You should have received a copy of the GNU Affero General Public License
# along with this file.  If not, see <http://www.gnu.org/licenses/>.
# 
# }}}
22 23 24 25
#
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= ..
26
SUBDIR		= sensors
27
EVENTSYS	= @EVENTSYS@
28
ISMAINSITE	= @TBMAINSITE@
29 30 31

include $(OBJDIR)/Makeconf

32 33 34 35 36
SYSTEM        := $(shell uname -s)
ifeq ($(SYSTEM),FreeBSD)
FBSDVERSION   := $(shell uname -v | sed -e 's/FreeBSD \([0-9]\).*/FreeBSD\1/')
FBSDARCH      := $(shell uname -m)
endif
37

38
SUBDIRS	= powermon
39

40
# XXX a couple of FreeBSD-only utilities
41
ifeq ($(SYSTEM),FreeBSD)
42

43
# XXX only at Utah...
44
ifeq ($(ISMAINSITE),1)
45
# XXX ...and FreeBSD 7 and below...
46 47
ifneq ($(FBSDVERSION),FreeBSD8)
ifneq ($(FBSDVERSION),FreeBSD9)
48 49
# XXX ...and only if 32-bit (til we work out linuxthread dependency)!
ifeq ($(FREEBSDARCH),i386)
50 51 52 53
SUBDIRS += nfstrace
endif
endif
endif
54
endif
55

56 57
# XXX not on FreeBSD 5/6 til I get a chance to fix it
ifeq ($(FBSDVERSION),FreeBSD4)
58
SUBDIRS += and 
59
endif
60
endif
61

62
###############################################################################
63

64 65 66
## `ACTIONS' is the set of actions that may be taken on a subdirectory or on
## the current directory.  These become phony targets.
##
67
ACTIONS = all install client client-install control-install clean distclean
68

69 70 71
## `TARGETS' is the set of all `<subdir>.<action>' targets.
##
TARGETS = $(foreach action,$(ACTIONS),$(addsuffix .$(action),$(SUBDIRS)))
72

73
###############################################################################
74

75 76 77 78 79
## 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::
80

81 82 83 84 85 86
## 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))
87

88 89 90 91 92
## Rules for targets of the form `<subdir>.<action>'.
##
.PHONY: $(TARGETS)
$(TARGETS):
	@$(MAKE) -C $(basename $@) $(patsubst .%,%,$(suffix $@))
93

94 95 96 97
## Making a subdirectory is the same as making `<subdir>.<all>'.
##
.PHONY: $(SUBDIRS)
$(SUBDIRS): %: %.all
98

99 100 101 102 103 104 105
#
# Rules to regen configure written files.
#
%: %.in
	@echo "Regenerating $@"
	cd $(OBJDIR) && CONFIG_FILES=$(SUBDIR)/$@ ./config.status

106
###############################################################################
107

108 109 110 111 112 113 114
## Any extra actions can be defined here, e.g.:
##
## clean::
##	$(RM) core

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

115 116 117
fs-install:
	@$(MAKE) -C nfstrace fs-install

Leigh Stoller's avatar
Leigh Stoller committed
118 119
mfs:
mfs-install:
120 121

.PHONY: mfs mfs-install