[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Passing directory to submake

From: Paul D. Smith
Subject: Re: Passing directory to submake
Date: Sat, 19 Oct 2002 09:14:12 -0400

%% Russell <address@hidden> writes:

  r> SUBDIRS= analog
  r> .PHONY: $(SUBDIRS) clean proj

  r> proj:   $(SUBDIRS)
  r>         cd objs \
  r>         avr-ld -o proj.o -Map $(addsuffix .o,$(SUBDIRS)) \
  r>         avr-objcopy -O ihex -R .eeprom -g proj.o proj.hex

This syntax is wrong.  You must separate your commands with ";" if you
connect them all with backslashes.

Remember the backslash/newline pairs are removed, so your command above
really is interpreted as:

  cd objs avr-ld -o proj.o -Map $(addsuffix .o,$(SUBDIRS)) avr-objcopy 
-O ihex -R .eeprom -g proj.o proj.hex

which I feel confident is not what you want.

  r> In the submake below, make is executed in a subdirectory.
  r> How can i access the name of the subdirectory in this
  r> submake?

  r> $(SUBDIRS):
  r>         $(MAKE) -C $@

Look in the GNU make manual for the CURDIR variable.

 Paul D. Smith <address@hidden>          Find some GNU make tips at:            
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist

reply via email to

[Prev in Thread] Current Thread [Next in Thread]