# # Insert Copyright Here. # SRCDIR = @srcdir@ TESTBED_SRCDIR = @top_srcdir@ OBJDIR = .. SUBDIR = sensors EVENTSYS = @EVENTSYS@ include $(OBJDIR)/Makeconf SUBDIRS = slothd powermon nfstrace SYSTEM := $(shell uname -s) ifeq ($(SYSTEM),FreeBSD) FBSDVERSION := $(shell uname -v | sed -e 's/FreeBSD \([0-9]\).*/FreeBSD\1/') # XXX not on FreeBSD 5/6 til I get a chance to fix it ifeq ($(FBSDVERSION),FreeBSD4) SUBDIRS += and ifeq ($(EVENTSYS),1) # Also, we have to have the event system enabled SUBDIRS += canaryd endif endif endif ############################################################################### ## `ACTIONS' is the set of actions that may be taken on a subdirectory or on ## the current directory. These become phony targets. ## ACTIONS = all install client client-install control-install clean distclean ## `TARGETS' is the set of all `.' targets. ## TARGETS = $(foreach action,$(ACTIONS),$(addsuffix .$(action),$(SUBDIRS))) ############################################################################### ## 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:: ## 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)) ## Rules for targets of the form `.'. ## .PHONY: $(TARGETS) $(TARGETS): @$(MAKE) -C $(basename $@) $(patsubst .%,%,$(suffix $@)) ## Making a subdirectory is the same as making `.'. ## .PHONY: $(SUBDIRS) $(SUBDIRS): %: %.all # # Rules to regen configure written files. # %: %.in @echo "Regenerating $@" cd $(OBJDIR) && CONFIG_FILES=$(SUBDIR)/$@ ./config.status ############################################################################### ## Any extra actions can be defined here, e.g.: ## ## clean:: ## $(RM) core ############################################################################### fs-install: @$(MAKE) -C nfstrace fs-install mfs: slothd.client mfs-install: mfs slothd.client-install .PHONY: mfs mfs-install