You're right. When I did echo $MAKERULES, there was nothing. I added this line to .bashrc in my home folder.
export MAKERULES="/opt/tinyos-2.x/support/make/Makerules" Now when I do ls on that string, it shows me this: -rw-r--r-- 1 Roboto None 6398 Sep 26 2008 /opt/tinyos-2.x/support/make/Makerules But now I'm getting this. $ 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. On Thu, Apr 23, 2009 at 3:16 PM, Michael Schippling <[email protected]>wrote: > The red herring thing was a joke, but you're original post referenced > both t1 and t2 makerules so I was (more) confused (than usual)... > > The result of your ls indicates that MAKERULES is not set in > your environment...Looks like you got a listing of your current > directory which is equivalent to "ls -l". So...try "echo $MAKERULES" > just to make sure you get nothing, then go look at where you are > setting that variable. Two things can go wrong, A) you need to > "export" the setting, and B) you have to "source" any script file > that does settings, not just execute it because that happens in > a sub-shell and settings are lost when the sub-shell exits. > > Try "man bash" for way more information about how to use the shell... > > Also, if my presumption above is correct you are trying to make from > the top app directory, not in a specific application directory (one > step down, e.g., CntToLeds), and it won't do anything useful anyway. > > As to understanding the TOS makefiles...when you do please explain > them to me... > > MS > > John Smith wrote: > >> ... not sure why you think it's a red herring. That was not my intent. >> I'm just trying to figure out to how this compilation process works (I've >> worked with Makefiles when it comes compiling C/C++ apps in Linux). I won't >> deny that I feel like someone walking in the dark and only holding on to >> different things in an attempt to figure out where I am :-) . >> >> I'm doing this in Cygwin. >> >> This is what I get when I do ls -l $MAKERULES >> >> $ ls -l $MAKERULES >> total 188 >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 Blink >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 BlinkTask >> drwxr-xr-x+ 3 Roboto None 0 Apr 22 23:22 Bombilla >> drwxr-xr-x+ 2 Roboto None 4096 Apr 22 23:22 CVS >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 CntToLeds >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 CntToLedsAndRfm >> drwxr-xr-x+ 3 Roboto None 0 Apr 22 23:22 CntToRfm >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 CountRadio >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 GenericBase >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 GlowLeds >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 GlowRadio >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 HighFrequencySampling >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 Ident >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 LittleGuySleep >> -rw-r--r-- 1 Roboto None 794 Oct 7 2003 Makefile >> -rw-r--r-- 1 Roboto None 13455 Apr 23 14:08 Makerules >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 MicaHWVerify >> drwxr-xr-x+ 6 Roboto None 4096 Apr 22 23:26 MicaSBVerify >> drwxr-xr-x+ 9 Roboto None 4096 Apr 22 23:22 MicaWBVerify >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 Oscilloscope >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 OscilloscopeRF >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 Pong >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 ReverseUART >> drwxr-xr-x+ 3 Roboto None 0 Apr 22 23:22 RfmToLeds >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 SecureTOSBase >> drwxr-xr-x+ 3 Roboto None 0 Apr 22 23:22 Sense >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 SenseLightToLog >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 SenseTask >> drwxr-xr-x+ 3 Roboto None 0 Apr 22 23:22 SenseToLeds >> drwxr-xr-x+ 3 Roboto None 0 Apr 22 23:22 SenseToRfm >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 SimpleCmd >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 Surge >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 SurgeTelos >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 TASKApp >> drwxr-xr-x+ 3 Roboto None 0 Apr 22 23:22 TOSBase >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 TelosADC >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 TelosPWM >> drwxr-xr-x+ 6 Roboto None 4096 Apr 22 23:22 TestDeluge >> drwxr-xr-x+ 3 Roboto None 0 Apr 22 23:22 TestDrip >> drwxr-xr-x+ 4 Roboto None 4096 Apr 22 23:22 TestDripDrain >> drwxr-xr-x+ 8 Roboto None 4096 Apr 22 23:22 TestEEPROM >> drwxr-xr-x+ 5 Roboto None 0 Apr 22 23:22 TestMatchbox >> drwxr-xr-x+ 5 Roboto None 0 Apr 22 23:22 TestNewFlash >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 TestPC2420 >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 TestSnooze >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 TestTimeStamping >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 TestTinyAlloc >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 TestTinySec >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 TestTinyViz >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 TestUart >> drwxr-xr-x+ 3 Roboto None 0 Apr 22 23:22 TestWDT >> drwxr-xr-x+ 4 Roboto None 4096 Apr 22 23:26 TinyDBApp >> drwxr-xr-x+ 3 Roboto None 0 Apr 22 23:22 TransparentBase >> drwxr-xr-x+ 2 Roboto None 0 Apr 23 12:17 Tree >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 XnpCount >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 XnpOscopeRF >> drwxr-xr-x+ 3 Roboto None 4096 Apr 22 23:22 XnpRfmToLeds >> >> On Thu, Apr 23, 2009 at 2:54 PM, Michael Schippling >> <[email protected]<mailto: >> [email protected]>> wrote: >> >> So the T1 file was a red herring to see if we were paying attention? >> heh... >> >> Try this from the directory where your make is failing: >> >> ls -l $MAKERULES >> >> just to make sure you have the variable set right and the >> file is accessible. After that I'm at a loss... >> >> MS >> >> John Smith wrote: >> >> 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] >> <mailto:[email protected]> >> <mailto:[email protected] >> <mailto:[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] <mailto:[email protected]> >> <mailto:[email protected] <mailto:[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]> >> <mailto:[email protected] <mailto:[email protected]>> >> <mailto:[email protected] <mailto:[email protected]> >> >> <mailto:[email protected] <mailto:[email protected]>>>> >> # >> # Updated: 6/18/2002 Rob von Behren <[email protected] >> <mailto:[email protected]> >> <mailto:[email protected] >> <mailto:[email protected]>> <mailto:[email protected] >> <mailto:[email protected]> >> >> <mailto:[email protected] <mailto:[email protected] >> >>>> >> # Multi-platform support >> # >> # Updated: 6/20/2002 David Gay <[email protected] >> <mailto:[email protected]> >> <mailto:[email protected] >> <mailto:[email protected]>> >> <mailto:[email protected] <mailto:[email protected]> >> >> <mailto:[email protected] >> <mailto:[email protected]>>>> >> # Compile via gcc, make tos.th <http://tos.th> >> <http://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]> >> <mailto:[email protected] >> <mailto:[email protected]>> <mailto:[email protected] >> >> <mailto:[email protected]> >> >> <mailto:[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] >> <mailto:[email protected]> >> <mailto:[email protected] >> <mailto:[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
