Yes, the one in tinyos-2.x does exist, I just looked at it. I haven't changed anything there and it's the stock Makerules file from when I first installed tinyos.
Here it is: #-*-Makefile-*- vim:syntax=make #$Id: Makerules,v 1.6 2008/09/26 20:13:58 klueska Exp $ # @author Cory Sharp <[email protected]> ### --- This makefile requires GNU Make version 3.80 or newer. ### --- ### --- Prepare variables ### --- # Get TOSDIR from ncc if it isn't set already. ifndef TOSDIR TOSDIR := $(shell ncc -print-tosdir) endif # Mung MAKERULES for Cygwin; see the warning below for more details. ifneq ($(findstring \,$(MAKERULES)),) MAKERULES := $(subst \,/,$(MAKERULES)) define BACKSLASH_WARNING warning, MAKERULES contains backslashes. The environment variable MAKERULES contains backslashes \'s. This can cause shell scripts including ones in this make system to fail in strange ways. I've changed those to forward slashes for you for this build. However, you are strongly encouraged to respecify MAKERULES as either a standard unix-style path or as a mixed-style path where the backslashes are replaced with forward slashes /'s. endef $(warning $(BACKSLASH_WARNING)) endif # Deduce TINYOS_MAKE_PATH, the path to this file, if it's not defined already. ifndef TINYOS_MAKE_PATH ifdef MAKERULES TINYOS_MAKE_PATH := $(dir $(MAKERULES)) TINYOS_MAKE_PATH := $(TINYOS_MAKE_PATH:%/=%) else TINYOS_MAKE_PATH := $(TOSDIR)/../support/make endif endif # Use a default Makelocal if it's not defined already. TINYOS_MAKELOCAL ?= $(TINYOS_MAKE_PATH)/Makelocal # Use a default Makedefaults if it's not defined already. TINYOS_MAKEDEFAULTS ?= $(TINYOS_MAKE_PATH)/Makedefaults # Allow users to specify additional directories to find TOSMake files. TOSMAKE_TEMP_PATH := $(TOSMAKE_PATH) TOSMAKE_PATH = $(TINYOS_MAKE_PATH) TOSMAKE_PATH += $(TOSMAKE_TEMP_PATH) # Save makecmdgoals (a read only var) to goals so that we can modify it. GOALS += $(MAKECMDGOALS) # Extract user options from goals of the form opt,arg, transform to opt=arg, # and evaluate. Then, reduce GOALS to have the args removed. OptRE := [,.] GoalOpts := $(shell perl -e 'print join " ", map {s{^(.*?)$(OptRE)}{\U$$1=};$$_} grep /$(OptRE)/, split /\s+/, "$(GOALS)";') GOALS := $(shell perl -e '$$_="$(GOALS)"; s{$(OptRE)\S*}{}g; print;') $(foreach opt,$(GoalOpts),$(eval $(opt))) ### --- ### --- Define make functions. ### --- (Lord, this is ugly. I want a real scripting language so bad.) ### --- ### --- The functions a user will generally be interested in are ### --- TOSMake_include(file) ### --- TOSMake_include_platform(dir) ### --- # names(words) # Produce option names, like junk from /path/to/junk.target. names = $(sort $(basename $(notdir $(1)))) # TOSMake_find(file_or_dir) # Search for file_or_dir within TOSMAKE_PATH. For the special case of # initializing TOSMAKE_PATH itself, this function does not search # TOSMAKE_PATH if file_or_dir begins with +. sh_search = for a in $(TOSMAKE_PATH); do [ -e "$$a/$$n" ] && echo "$$a/$$n" && break; done TOSMake_find = $(if $(filter +%,$(1)),$(1:+%=%),$(shell n="$(1)"; $(sh_search))) # TOSMake_makelist(dir,extension) # Get a list of files with the given extension from a directory which MUST # be a subdir under TOSMAKE_PATH. TOSMake_makelist = $(wildcard $(call TOSMake_find,$(1))/*.$(2)) # TOSMake_include(file) # Include a makefile which MUST be in a dir or subdir under TOSMAKE_PATH. TOSMake_include = $(eval include $(call TOSMake_find,$(1))) # TOSMake_extra_targets(name) # Create a default make targets for a TOSMake extra full with its possible # options afterward. define TOSMake_extra_targets $(subst :,%,$(1)): FORCE @: endef # TOSMake_include_dir(dir) # Pull in .extras and .targets from a directory which MUST be a subdir # under TOSMAKE_PATH. Create default extra rules as necessary, etc. TOSMake_include_dir = $(eval $(call TOSMake_include_dir_define,$(1))) define TOSMake_include_dir_define $(eval NEW_EXTRAS := $(call TOSMake_makelist,$(1),extra)) $(eval NEW_TARGETS := $(call TOSMake_makelist,$(1),target)) $(eval VALID_EXTRAS += $(NEW_EXTRAS)) $(eval VALID_TARGETS += $(NEW_TARGETS)) $(eval EXTRAS = $(filter $(call names,$(VALID_EXTRAS)),$(GOALS))) $(eval TARGETS = $(filter $(call names,$(VALID_TARGETS)),$(GOALS))) $(eval OTHERS = $(filter-out $(EXTRAS) $(TARGETS),$(GOALS))) $(foreach file,$(NEW_EXTRAS) $(NEW_TARGETS),$(if $(filter $(call names,$(file)),$(GOALS)),$(eval include $(file)))) endef # TOSMake_include_platform(dir) # Pull in a directory as a new TOSMake platform, which MUST be a subdir of # TOSMAKE_PATH. A platform directory must also have a .rules file, which # is automatically evaluated. TOSMake_include_platform=$(eval $(call TOSMake_include_platform_define,$(1))) define TOSMake_include_platform_define $(call TOSMake_include_dir,$(1)) $(call TOSMake_include,$(1)/$(1).rules) endef ### --- ### --- Include Makelocal and Makedefaults ### --- # Makelocal comes first to allow overriding Makedefaults. -include $(TINYOS_MAKELOCAL) -include $(TINYOS_MAKEDEFAULTS) PLATFORMDIR ?= $(TOSDIR)/platforms/$(PLATFORM) # Mark TOSMAKE_PATH with a + so that they're not searched for by TOSMake_find. $(foreach incdir,$(addprefix +,$(TOSMAKE_PATH)),$(call TOSMake_include_dir,$(incdir))) # Make default rules for each extra with full argument $(foreach goal,$(MAKECMDGOALS),$(if $(filter-out $(TARGETS) help,$(goal)),$(eval $(call TOSMake_extra_targets,$(goal))))) ### --- ### --- Define USAGE, print help if necessary or requested, etc. ### --- # USAGE is printed out when help is requested. Files other than this should # add text to HELP, not USAGE. define USAGE Usage: make <target> <extras> make <target> help Valid targets: $(call names,$(VALID_TARGETS)) Valid extras: $(call names,$(VALID_EXTRAS)) $(HELP) endef # If no target or an invalid target is specified, print usage. ifeq ($(TARGETS),) ifeq ($(GOALS),) $(error $(USAGE)Please specify a valid target) else $(error $(USAGE)ERROR, "$(GOALS)" does not specify a valid target) endif endif # If the user specifically had help on the command line, don't build any # targets, instead display help information and exit with a nice error. ifeq ($(filter help,$(GOALS)),help) define USAGE Usage: make $(TARGETS) <extras> Valid targets: $(call names,$(VALID_TARGETS)) Valid extras: $(call names,$(VALID_EXTRAS)) $(HELP) endef $(error $(USAGE)Thank you) endif .PHONY: FORCE On Thu, Apr 23, 2009 at 2:41 PM, Michael Schippling <[email protected]>wrote: > Make sure the file actually exists. > The error says it can't find a tinyos-2.x rules file, > but it looks like you have posted a tinyos-1.x file. > > MS > > John Smith wrote: > >> Hi again, >> >> I'm trying to have my simple program compile. >> >> This is the error that I'm getting. >> >> $ make >> ../Makerules:28: "/opt/tinyos-2.x/support/make/Makerules": No such file or >> directory >> make: *** No rule to make target >> `"/opt/tinyos-2.x/support/make/Makerules"'. Stop. >> >> I'm confused. I set the variable Makerules... so I don't understand why >> it's not compiling. >> >> tinyos-1.x/apps/Makerules: >> #-*-Makefile-*- vim:syntax=make >> #$Id: Makerules,v 1.37 2004/11/07 15:22:14 mdwelsh Exp $ >> >> ###################################################################### >> # Base Makefile for nesC apps. >> # >> # Created: 6/2002, Philip Levis <[email protected] <mailto: >> [email protected]>> >> # >> # Updated: 6/18/2002 Rob von Behren <[email protected] <mailto: >> [email protected]>> >> # Multi-platform support >> # >> # Updated: 6/20/2002 David Gay <[email protected] <mailto: >> [email protected]>> >> # Compile via gcc, make tos.th <http://tos.th> system-wide, not >> app-wide >> # (still need to ponder group selection) >> # >> # Updated: 6/27/2003 Jaein Jeong <[email protected] <mailto: >> [email protected]>> >> # In-network programming support for mica2, mica2dot platforms >> # >> ###################################################################### >> >> *export MAKERULES="/opt/tinyos-2.x/support/make/Makerules"* >> >> ifndef MAKERULES >> MAKERULES=$(shell ncc -print-tosdir)/../apps/Makerules >> endif >> ifndef QUELL_RECURSIVE_TINYOS_APPS_MAKERULES >> QUELL_RECURSIVE_TINYOS_APPS_MAKERULES=1 >> include $(MAKERULES) >> else >> >> # this needs to be -dlpt=3 on thinkpads >> # PROGRAMMER_EXTRA_FLAGS := >> # We don't actually set it here, so you can either set the >> # PROGRAMMER_EXTRA_FLAGS environment variable (recommended) or >> # define it in ../Makelocal >> >> -include $(shell ncc -print-tosdir)/../apps/Makelocal >> >> # User configuration: >> # Specify user values in Makelocal to override the defaults here >> >> ifndef DEFAULT_LOCAL_GROUP >> DEFAULT_LOCAL_GROUP := 0x7d >> >> .................................... >> >> What am I missing? >> >> I looked at this source for information. >> >> >> http://mail.millennium.berkeley.edu/pipermail/tinyos-help/2008-January/030286.html >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Tinyos-help mailing list >> [email protected] >> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help >> >
_______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
